mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
don't use constructors for C API structures
This commit is contained in:
@@ -161,7 +161,7 @@ void CV_MomentsTest::run_func()
|
||||
ttime += (double)getTickCount() - t;
|
||||
ncalls++;
|
||||
printf("%g\n", ttime/ncalls/u.total()));
|
||||
*m = new_m;
|
||||
*m = cvMoments(new_m);
|
||||
}
|
||||
else
|
||||
cvMoments( test_array[INPUT][0], m, is_binary );
|
||||
@@ -179,22 +179,13 @@ void CV_MomentsTest::run_func()
|
||||
void CV_MomentsTest::prepare_to_validation( int /*test_case_idx*/ )
|
||||
{
|
||||
Mat& src = test_mat[INPUT][0];
|
||||
CvMoments m;
|
||||
CvMoments m = cvMoments();
|
||||
double* mdata = test_mat[REF_OUTPUT][0].ptr<double>();
|
||||
int depth = src.depth();
|
||||
int cn = src.channels();
|
||||
int i, y, x, cols = src.cols;
|
||||
double xc = 0., yc = 0.;
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 8
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
memset( &m, 0, sizeof(m));
|
||||
#if defined __GNUC__ && __GNUC__ >= 8
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
int coi = 0;
|
||||
for( y = 0; y < src.rows; y++ )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user