21 #ifndef _INTEGRAL_CHANNEL_FEATURE_H
22 #define _INTEGRAL_CHANNEL_FEATURE_H
33 # include <smmintrin.h>
34 # include <emmintrin.h>
35 # include <mmintrin.h>
59 enum { InvokeParam = 2 };
67 std::cerr <<
"cannot allocate ichn @ scale"<<std::endl;
69 void invert_polarity()
71 std::cerr <<
"cannot invert polarity"<<std::endl;
74 const char *debug_name() {
76 static const char *channel_name[]={
"c0",
"c1",
"c2",
"c3",
"c4",
"c5",
"c6",
"c7",
"c8",
"c9",
"c10",
"c11",
"c12",
"c13",
"c14",
"c15",
"c16" };
79 static void debug_name(
const char *str) { }
85 inline int response(
const unsigned int *pIntImage,
const std::pair<int32_t,int32_t> & params)
const
87 pIntImage +=
channel * params.second;
88 return (
int) pIntImage[x1 + y1 * params.first] +
89 (int) pIntImage[
x0 + y0 * params.first] -
90 (
int) pIntImage[x1 + y0 * params.first] -
91 (
int) pIntImage[
x0 + y1 * params.first];
99 x0 = (
x0 * sx + sx - 1);
100 y0 = (y0 * sy + sy - 1);
101 x1 = (x1 * sx + sx - 1);
102 y1 = (y1 * sy + sy - 1);
126 std::cerr <<
"cannot allocate ichn @ scale"<<std::endl;
129 void invert_polarity()
131 std::cerr <<
"cannot invert polarity"<<std::endl;
137 A = offset + src.
x0 + src.y0 * stride1 + src.
channel * stride2;
138 B = offset + src.
x0 + src.y1 * stride1 + src.
channel * stride2;
139 C = offset + src.x1 + src.y0 * stride1 + src.
channel * stride2;
140 D = offset + src.x1 + src.y1 * stride1 + src.
channel * stride2;
145 A = offset + src.
x0 + src.y0 * p.stride1 + src.
channel * p.stride2;
146 B = offset + src.
x0 + src.y1 * p.stride1 + src.
channel * p.stride2;
147 C = offset + src.x1 + src.y0 * p.stride1 + src.
channel * p.stride2;
148 D = offset + src.x1 + src.y1 * p.stride1 + src.
channel * p.stride2;
152 inline int response(
const unsigned int *pIntImage)
const
154 return (
int) pIntImage[A] + (int) pIntImage[D] - (
int) pIntImage[B] - (int) pIntImage[C];
158 inline __m128i response4(
const unsigned int *pIntImage)
const
161 __m128i p1 = _mm_load_si128((__m128i *)( (
long) (pIntImage + A) ) );
162 __m128i p2 = _mm_load_si128((__m128i *)( (
long) (pIntImage + D) ) );
163 __m128i p3 = _mm_load_si128((__m128i *)( (
long) (pIntImage + B) ) );
164 __m128i p4 = _mm_load_si128((__m128i *)( (
long) (pIntImage + C) ) );
165 p1 = _mm_add_epi32(p1, p2);
166 p3 = _mm_add_epi32(p3, p4);
167 return _mm_sub_epi32(p1, p3);
int channel
channel identifier
Definition: IntegralChannelFeature.h:47
OptimizedIntegralChannelFeature(const IntegralChannelFeature &src, long offset, long stride1, long stride2)
Definition: IntegralChannelFeature.h:135
static std::string signature()
Definition: IntegralChannelFeature.h:82
int DescriptorType
type of data returned by this feature extractor
Definition: IntegralChannelFeature.h:57
IntegralChannelFeature(const IntegralChannelFeature &src, int scale, long offset, long stride)
Definition: IntegralChannelFeature.h:65
unsigned int InputDataType
type of data requested by this Feature Extractor
Definition: IntegralChannelFeature.h:51
OptimizedIntegralChannelFeature OptimizedType
The feature type used during fast execution:
Definition: IntegralChannelFeature.h:54
void rescale(int sx, int sy)
Definition: IntegralChannelFeature.h:97
an optimized SumAreaFeature
Definition: IntegralChannelFeature.h:113
int response(const unsigned int *pIntImage) const
compute the response
Definition: IntegralChannelFeature.h:152
parameters required to address a channel params
Definition: IntegralChannelImagePreprocessor.h:36
Sum of a rectangular area, implemented on top of Integral Image.
Definition: IntegralChannelFeature.h:42
method to convert an image sample in integral Channels Image
OptimizedIntegralChannelFeature(const OptimizedIntegralChannelFeature &src, int scale, long offset, long stride)
Definition: IntegralChannelFeature.h:124
int x0
Definition: IntegralChannelFeature.h:45