endif()
if(CMAKE_COMPILER_IS_GNUCXX)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-parentheses")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-parentheses -Wno-uninitialized -Wno-implicit-function-declaration -Wno-unused")
set_source_files_properties(dlamch.c slamch.c PROPERTIES COMPILE_FLAGS "-ffloat-store -O0")
endif()
endif()
endif()
+if(CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-implicit-function-declaration -Wno-unused")
+endif()
+
set_target_properties(${the_target}
PROPERTIES
OUTPUT_NAME "${the_target}"
float ts = (float)timestamp;\r
float delbound = (float)(timestamp - mhi_duration);\r
int x, y;\r
+#if CV_SSE2\r
volatile bool useSIMD = cv::checkHardwareSupport(CV_CPU_SSE2);\r
+#endif\r
\r
for( y = 0; y < size.height; y++ )\r
{\r
rtype operator ()(type1 arg) const { return arg*(T)(1./(1 << shift)); }\r
};\r
\r
-struct NoVec\r
+template<typename T1, typename T2> struct NoVec\r
{\r
- int operator()(const uchar**, uchar*, int, int) const { return 0; }\r
+ int operator()(T1**, T2*, int, int) const { return 0; }\r
};\r
\r
#if CV_SSE2\r
\r
struct PyrDownVec_32s8u\r
{\r
- int operator()(const uchar** _src, uchar* dst, int, int width) const\r
+ int operator()(int** src, uchar* dst, int, int width) const\r
{\r
if( !checkHardwareSupport(CV_CPU_SSE2) )\r
return 0;\r
\r
int x = 0;\r
- const int** src = (const int**)_src;\r
const int *row0 = src[0], *row1 = src[1], *row2 = src[2], *row3 = src[3], *row4 = src[4];\r
__m128i delta = _mm_set1_epi16(128);\r
\r
\r
struct PyrDownVec_32f\r
{\r
- int operator()(const uchar** _src, uchar* _dst, int, int width) const\r
+ int operator()(float** src, float* dst, int, int width) const\r
{\r
if( !checkHardwareSupport(CV_CPU_SSE) )\r
return 0;\r
\r
int x = 0;\r
- const float** src = (const float**)_src;\r
- float* dst = (float*)_dst;\r
const float *row0 = src[0], *row1 = src[1], *row2 = src[2], *row3 = src[3], *row4 = src[4];\r
__m128 _4 = _mm_set1_ps(4.f), _scale = _mm_set1_ps(1.f/256);\r
for( ; x <= width - 8; x += 8 )\r
\r
#else\r
\r
-typedef NoVec PyrDownVec_32s8u;\r
-typedef NoVec PyrDownVec_32f;\r
+typedef NoVec<int, uchar> PyrDownVec_32s8u;\r
+typedef NoVec<float, float> PyrDownVec_32f;\r
\r
#endif\r
\r
rows[k] = buf + ((y*2 - PD_SZ/2 + k - sy0) % PD_SZ)*bufstep;\r
row0 = rows[0]; row1 = rows[1]; row2 = rows[2]; row3 = rows[3]; row4 = rows[4];\r
\r
- x = vecOp((const uchar**)rows, (uchar*)dst, (int)_dst.step, dsize.width);\r
+ x = vecOp(rows, dst, (int)_dst.step, dsize.width);\r
for( ; x < dsize.width; x++ )\r
dst[x] = castOp(row2[x]*6 + (row1[x] + row3[x])*4 + row0[x] + row4[x]);\r
}\r
rows[k] = buf + ((y - PU_SZ/2 + k - sy0) % PU_SZ)*bufstep;\r
row0 = rows[0]; row1 = rows[1]; row2 = rows[2];\r
\r
- x = vecOp((const uchar**)rows, (uchar*)dst0, (int)_dst.step, dsize.width);\r
+ x = vecOp(rows, dst0, (int)_dst.step, dsize.width);\r
for( ; x < dsize.width; x++ )\r
{\r
T t1 = castOp((row1[x] + row2[x])*4);\r
if( depth == CV_8U )\r
func = pyrDown_<FixPtCast<uchar, 8>, PyrDownVec_32s8u>;\r
else if( depth == CV_16U )\r
- func = pyrDown_<FixPtCast<ushort, 8>, NoVec>;\r
+ func = pyrDown_<FixPtCast<ushort, 8>, NoVec<int, ushort> >;\r
else if( depth == CV_32F )\r
func = pyrDown_<FltCast<float, 8>, PyrDownVec_32f>;\r
else if( depth == CV_64F )\r
- func = pyrDown_<FltCast<double, 8>, NoVec>;\r
+ func = pyrDown_<FltCast<double, 8>, NoVec<double, double> >;\r
else\r
CV_Error( CV_StsUnsupportedFormat, "" );\r
\r
int depth = _src.depth();\r
PyrFunc func = 0;\r
if( depth == CV_8U )\r
- func = pyrUp_<FixPtCast<uchar, 6>, NoVec>;\r
+ func = pyrUp_<FixPtCast<uchar, 6>, NoVec<int, uchar> >;\r
else if( depth == CV_16U )\r
- func = pyrUp_<FixPtCast<ushort, 6>, NoVec>;\r
+ func = pyrUp_<FixPtCast<ushort, 6>, NoVec<int, ushort> >;\r
else if( depth == CV_32F )\r
- func = pyrUp_<FltCast<float, 6>, NoVec>;\r
+ func = pyrUp_<FltCast<float, 6>, NoVec<float, float> >;\r
else if( depth == CV_64F )\r
- func = pyrUp_<FltCast<double, 6>, NoVec>;\r
+ func = pyrUp_<FltCast<double, 6>, NoVec<double, double> >;\r
else\r
CV_Error( CV_StsUnsupportedFormat, "" );\r
\r
cv::findStereoCorrespondenceBM(left, right, disp, state);\r
}\r
\r
-/* End of file. */
\ No newline at end of file
+/* End of file. */\r
buffer -= minX2;
cost -= minX1*D + minD; // simplify the cost indices inside the loop
+#if CV_SSE2
volatile bool useSIMD = checkHardwareSupport(CV_CPU_SSE2);
+#endif
#if 1
for( c = 0; c < cn; c++, prow1 += width, prow2 += width )
6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
};
+
+ volatile bool useSIMD = checkHardwareSupport(CV_CPU_SSE2);
#endif
const int ALIGN = 16;
DispType* disp2ptr = (DispType*)(disp2cost + width);
PixType* tempBuf = (PixType*)(disp2ptr + width);
- volatile bool useSIMD = checkHardwareSupport(CV_CPU_SSE2);
-
// add P2 to every C(x,y). it saves a few operations in the inner loops
for( k = 0; k < width1*D; k++ )
Cbuf[k] = P2;
int segment_hist_max(const MatND& hist, int& low_thresh, int& high_thresh)
{
Mat bw;
- const double max_bell_width = 20; // we expect two bells with width bounded above
- const double min_bell_width = 5; // and below
+ //const double max_bell_width = 20; // we expect two bells with width bounded above
+ //const double min_bell_width = 5; // and below
double total_sum = sum(hist).val[0];
- double thresh = total_sum/(2*max_bell_width)*0.25f; // quarter of a bar inside a bell
+ //double thresh = total_sum/(2*max_bell_width)*0.25f; // quarter of a bar inside a bell
// threshold(hist, bw, thresh, 255.0, CV_THRESH_BINARY);
double quantile_sum = 0.0;
- double min_quantile = 0.2;
+ //double min_quantile = 0.2;
double low_sum = 0;
double max_segment_length = 0;
int max_start_x = -1;
#if CV_SSE2
if( checkHardwareSupport(CV_CPU_SSE) )
{
- static const int CV_DECL_ALIGNED(16) iabsmask[] = {0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff};
- __m128 eps = _mm_set1_ps((float)DBL_EPSILON), absmask = _mm_load_ps((const float*)iabsmask);
+ Cv32suf iabsmask; iabsmask.i = 0x7fffffff;
+ __m128 eps = _mm_set1_ps((float)DBL_EPSILON), absmask = _mm_set1_ps(iabsmask.f);
__m128 _90 = _mm_set1_ps((float)(CV_PI*0.5)), _180 = _mm_set1_ps((float)CV_PI), _360 = _mm_set1_ps((float)(CV_PI*2));
__m128 zero = _mm_setzero_ps(), _0_28 = _mm_set1_ps(0.28f), scale4 = _mm_set1_ps(scale);
static void y162bgr(const unsigned char *src, unsigned char *dest, unsigned long long int NumPixels, int bits);
static void rgb482bgr(const unsigned char *src8, unsigned char *dest, unsigned long long int NumPixels, int bits);
-static char * videodev[4]={
+static const char * videodev[4]={
"/dev/video1394/0",
"/dev/video1394/1",
"/dev/video1394/2",
int mode;
int color_mode;
int frame_rate;
- char * device_name;
+ const char * device_name;
IplImage frame;
int convert;
int buffer_is_writeable; // indicates whether frame.imageData is allocated by OpenCV or DC1394
// now check if the auto is on.
if( dc1394_is_feature_auto(capture->handle, capture->camera->node, feature_id, &isAutoOn ) == DC1394_FAILURE ) {
- fprintf(stderr, "error determining if feature %d has auto on!\n", index);
+ fprintf(stderr, "error determining if feature %d has auto on!\n", feature_id);
return 0;
}
}
// Clamp val to within feature range
CV_DC1394_CALL( dc1394_get_min_value(capture->handle, capture->camera->node, feature_id, &minval));
CV_DC1394_CALL( dc1394_get_max_value(capture->handle, capture->camera->node, feature_id, &maxval));
- val = MIN(maxval, MAX(val, minval));
+ val = (int)MIN(maxval, MAX((unsigned)val, minval));
if (dc1394_set_feature_value(capture->handle, capture->camera->node, feature_id, val) ==
void generateData( Mat& data, Mat& labels, const vector<int>& sizes, const vector<Mat>& means, const vector<Mat>& covs, int labelType )
{
vector<int>::const_iterator sit = sizes.begin();
- int total = 0, setCount = (int)sizes.size();
+ int total = 0;
for( ; sit != sizes.end(); ++sit )
total += *sit;
- assert( (int)means.size() == setCount && (int)covs.size() == setCount );
+ assert( means.size() == sizes.size() && covs.size() == sizes.size() );
assert( !data.empty() && data.rows == total );
assert( data.type() == CV_32FC1 );
assert( cit->rows == data.cols && cit->cols == data.cols );
for( int i = bi; i < ei; i++, p++ )
{
- Mat r(1, data.cols, CV_32FC1, data.ptr<float>(i));\r
+ Mat r(1, data.cols, CV_32FC1, data.ptr<float>(i));
r = r * (*cit) + *mit;
if( labelType == CV_32FC1 )
labels.at<float>(p, 0) = (float)l;
ei = bi + *sit;
if( isFlt )
{
- for( int i = bi; i < ei; i++ )\r
+ for( int i = bi; i < ei; i++ )
count[(int)labels.at<float>(i, 0)]++;
}
else
{
- for( int i = bi; i < ei; i++ )\r
+ for( int i = bi; i < ei; i++ )
count[labels.at<int>(i, 0)]++;
}
// 3. flag==KMEANS_USE_INITIAL_LABELS
labels.copyTo( bestLabels );
RNG rng;
- for( int i = 0; i < 0.5f * pointsCount; i++ )\r
- bestLabels.at<int>( rng.next() % pointsCount, 0 ) = rng.next() % 3;\r
+ for( int i = 0; i < 0.5f * pointsCount; i++ )
+ bestLabels.at<int>( rng.next() % pointsCount, 0 ) = rng.next() % 3;
kmeans( data, 3, bestLabels, TermCriteria( TermCriteria::COUNT, iters, 0.0), 0, KMEANS_USE_INITIAL_LABELS, 0 );
if( calcErr( bestLabels, labels, sizes, false ) > 0.01f )
{