mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -119,7 +119,7 @@ CvSeq* icvApproximateChainTC89( CvChain* chain, int header_size,
|
||||
}
|
||||
}
|
||||
|
||||
//assert( pt.x == chain->origin.x && pt.y == chain->origin.y );
|
||||
//CV_Assert( pt.x == chain->origin.x && pt.y == chain->origin.y );
|
||||
|
||||
if( method <= CV_CHAIN_APPROX_SIMPLE )
|
||||
return cvEndWriteSeq( &writer );
|
||||
@@ -129,7 +129,7 @@ CvSeq* icvApproximateChainTC89( CvChain* chain, int header_size,
|
||||
len = i;
|
||||
current = temp.next;
|
||||
|
||||
assert( current );
|
||||
CV_Assert( current );
|
||||
|
||||
/* Pass 1.
|
||||
Determines support region for all the remained points */
|
||||
@@ -148,7 +148,7 @@ CvSeq* icvApproximateChainTC89( CvChain* chain, int header_size,
|
||||
int dx, dy;
|
||||
Cv32suf d;
|
||||
|
||||
assert( k <= len );
|
||||
CV_Assert( k <= len );
|
||||
|
||||
/* calc indices */
|
||||
i1 = i - k;
|
||||
@@ -205,7 +205,7 @@ CvSeq* icvApproximateChainTC89( CvChain* chain, int header_size,
|
||||
((double)dx2 * dx2 + (double)dy2 * dy2) ));
|
||||
sk.f = (float) (temp_num + 1.1);
|
||||
|
||||
assert( 0 <= sk.f && sk.f <= 2.2 );
|
||||
CV_Assert( 0 <= sk.f && sk.f <= 2.2 );
|
||||
if( j < k && sk.i <= s )
|
||||
break;
|
||||
|
||||
@@ -258,7 +258,7 @@ CvSeq* icvApproximateChainTC89( CvChain* chain, int header_size,
|
||||
/* Pass 3.
|
||||
Removes non-dominant points with 1-length support region */
|
||||
current = temp.next;
|
||||
assert( current );
|
||||
CV_Assert( current );
|
||||
prev_current = &temp;
|
||||
|
||||
do
|
||||
@@ -293,7 +293,7 @@ CvSeq* icvApproximateChainTC89( CvChain* chain, int header_size,
|
||||
|
||||
/* Pass 4.
|
||||
Cleans remained couples of points */
|
||||
assert( temp.next );
|
||||
CV_Assert( temp.next );
|
||||
|
||||
if( array[0].s != 0 && array[len - 1].s != 0 ) /* specific case */
|
||||
{
|
||||
@@ -362,7 +362,7 @@ copy_vect:
|
||||
|
||||
// gather points
|
||||
current = temp.next;
|
||||
assert( current );
|
||||
CV_Assert( current );
|
||||
|
||||
do
|
||||
{
|
||||
@@ -439,7 +439,7 @@ cvApproxChains( CvSeq* src_seq,
|
||||
|
||||
if( src_seq->v_next && len >= minimal_perimeter )
|
||||
{
|
||||
assert( prev_contour != 0 );
|
||||
CV_Assert( prev_contour != 0 );
|
||||
parent = prev_contour;
|
||||
prev_contour = 0;
|
||||
src_seq = src_seq->v_next;
|
||||
@@ -590,7 +590,7 @@ approxPolyDP_( const Point_<T>* src_contour, int count0, Point_<T>* dst_contour,
|
||||
dx = end_pt.x - start_pt.x;
|
||||
dy = end_pt.y - start_pt.y;
|
||||
|
||||
assert( dx != 0 || dy != 0 );
|
||||
CV_Assert( dx != 0 || dy != 0 );
|
||||
|
||||
while( pos != slice.end )
|
||||
{
|
||||
@@ -815,7 +815,7 @@ cvApproxPoly( const void* array, int header_size,
|
||||
CV_Error( CV_StsBadArg, "Invalid approximation method" );
|
||||
}
|
||||
|
||||
assert( contour );
|
||||
CV_Assert( contour );
|
||||
|
||||
if( header_size >= (int)sizeof(CvContour))
|
||||
cvBoundingRect( contour, 1 );
|
||||
@@ -836,7 +836,7 @@ cvApproxPoly( const void* array, int header_size,
|
||||
|
||||
if( src_seq->v_next )
|
||||
{
|
||||
assert( prev_contour != 0 );
|
||||
CV_Assert( prev_contour != 0 );
|
||||
parent = prev_contour;
|
||||
prev_contour = 0;
|
||||
src_seq = src_seq->v_next;
|
||||
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( cn == 3 );
|
||||
CV_Assert( cn == 3 );
|
||||
AutoBuffer<float> buf(alignSize(size.width, CV_SIMD_WIDTH)*3 + size.width + CV_SIMD_WIDTH - 1);
|
||||
memset(buf.data(), 0, buf.size() * sizeof(float));
|
||||
float *sum_b = alignPtr(buf.data(), CV_SIMD_WIDTH);
|
||||
|
||||
@@ -3567,7 +3567,7 @@ struct Luv2RGBinteger
|
||||
|
||||
long long int xv = ((int)up)*(long long)vp;
|
||||
int x = (int)(xv/BASE);
|
||||
x = y*x/BASE;
|
||||
x = ((long long int)y)*x/BASE;
|
||||
|
||||
long long int vpl = LUVLUT.LvToVpl_b[LL*256+vv];
|
||||
long long int zp = vpl - xv*(255/3);
|
||||
@@ -3689,6 +3689,7 @@ struct Luv2RGBinteger
|
||||
vzm[i] = zm;
|
||||
|
||||
vx[i] = (int32_t)(xv >> base_shift);
|
||||
vx[i] = (((int64_t)y_)*vx[i]) >> base_shift;
|
||||
}
|
||||
v_int32 zm[4];
|
||||
for(int k = 0; k < 4; k++)
|
||||
@@ -3697,11 +3698,6 @@ struct Luv2RGBinteger
|
||||
zm[k] = vx_load_aligned(vzm + k*vsize/4);
|
||||
}
|
||||
|
||||
for(int k = 0; k < 4; k++)
|
||||
{
|
||||
x[k] = (y[k]*x[k]) >> base_shift;
|
||||
}
|
||||
|
||||
// z = zm/256 + zm/65536;
|
||||
for (int k = 0; k < 4; k++)
|
||||
{
|
||||
|
||||
@@ -97,7 +97,7 @@ cvReadChainPoint( CvChainPtReader * reader )
|
||||
|
||||
reader->ptr = ptr;
|
||||
reader->code = (schar)code;
|
||||
assert( (code & ~7) == 0 );
|
||||
CV_Assert( (code & ~7) == 0 );
|
||||
reader->pt.x = pt.x + icvCodeDeltas[code].x;
|
||||
reader->pt.y = pt.y + icvCodeDeltas[code].y;
|
||||
}
|
||||
@@ -1187,7 +1187,7 @@ cvFindNextContour( CvContourScanner scanner )
|
||||
}
|
||||
|
||||
/* hole flag of the parent must differ from the flag of the contour */
|
||||
assert( par_info->is_hole != is_hole );
|
||||
CV_Assert( par_info->is_hole != is_hole );
|
||||
if( par_info->contour == 0 ) /* removed contour */
|
||||
goto resume_scan;
|
||||
}
|
||||
|
||||
@@ -716,7 +716,7 @@ CV_IMPL CvSeq* cvConvexityDefects( const CvArr* array,
|
||||
|
||||
dx0 = (double)hull_next->x - (double)hull_cur->x;
|
||||
dy0 = (double)hull_next->y - (double)hull_cur->y;
|
||||
assert( dx0 != 0 || dy0 != 0 );
|
||||
CV_Assert( dx0 != 0 || dy0 != 0 );
|
||||
scale = 1./std::sqrt(dx0*dx0 + dy0*dy0);
|
||||
|
||||
defect.start = hull_cur;
|
||||
|
||||
@@ -270,7 +270,7 @@ distanceTransformEx_5x5( const Mat& _src, Mat& _temp, Mat& _dist, Mat& _labels,
|
||||
if( !s[j] )
|
||||
{
|
||||
tmp[j] = 0;
|
||||
//assert( lls[j] != 0 );
|
||||
//CV_Assert( lls[j] != 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -138,7 +138,7 @@ bool clipLine( Size2l img_size, Point2l& pt1, Point2l& pt2 )
|
||||
}
|
||||
}
|
||||
|
||||
assert( (c1 & c2) != 0 || (x1 | y1 | x2 | y2) >= 0 );
|
||||
CV_Assert( (c1 & c2) != 0 || (x1 | y1 | x2 | y2) >= 0 );
|
||||
}
|
||||
|
||||
return (c1 | c2) == 0;
|
||||
@@ -648,7 +648,7 @@ Line2( Mat& img, Point2l pt1, Point2l pt2, const void* color)
|
||||
size_t step = img.step;
|
||||
Size size = img.size();
|
||||
|
||||
//assert( img && (nch == 1 || nch == 3) && img.depth() == CV_8U );
|
||||
//CV_Assert( img && (nch == 1 || nch == 3) && img.depth() == CV_8U );
|
||||
|
||||
Size2l sizeScaled(((int64)size.width) << XY_SHIFT, ((int64)size.height) << XY_SHIFT);
|
||||
if( !clipLine( sizeScaled, pt1, pt2 ))
|
||||
@@ -1120,7 +1120,7 @@ FillConvexPoly( Mat& img, const Point2l* v, int npts, const void* color, int lin
|
||||
p0.x <<= XY_SHIFT - shift;
|
||||
p0.y <<= XY_SHIFT - shift;
|
||||
|
||||
assert( 0 <= shift && shift <= XY_SHIFT );
|
||||
CV_Assert( 0 <= shift && shift <= XY_SHIFT );
|
||||
xmin = xmax = v[0].x;
|
||||
ymin = ymax = v[0].y;
|
||||
|
||||
@@ -1340,7 +1340,7 @@ FillEdgeCollection( Mat& img, std::vector<PolyEdge>& edges, const void* color )
|
||||
for( i = 0; i < total; i++ )
|
||||
{
|
||||
PolyEdge& e1 = edges[i];
|
||||
assert( e1.y0 < e1.y1 );
|
||||
CV_Assert( e1.y0 < e1.y1 );
|
||||
// Determine x-coordinate of the end of the edge.
|
||||
// (This is not necessary x-coordinate of any vertex in the array.)
|
||||
int64 x1 = e1.x + (e1.y1 - e1.y0) * e1.dx;
|
||||
@@ -2613,7 +2613,7 @@ cvDrawContours( void* _img, CvSeq* contour,
|
||||
char code;
|
||||
CV_READ_SEQ_ELEM( code, reader );
|
||||
|
||||
assert( (code & ~7) == 0 );
|
||||
CV_Assert( (code & ~7) == 0 );
|
||||
|
||||
if( code != prev_code )
|
||||
{
|
||||
|
||||
@@ -336,7 +336,7 @@ static int icvInitEMD( const float* signature1, int size1,
|
||||
char *buffer, *buffer_end;
|
||||
|
||||
memset( state, 0, sizeof( *state ));
|
||||
assert( cost_step % sizeof(float) == 0 );
|
||||
CV_Assert( cost_step % sizeof(float) == 0 );
|
||||
cost_step /= sizeof(float);
|
||||
|
||||
/* calculate buffer size */
|
||||
@@ -510,7 +510,7 @@ static int icvInitEMD( const float* signature1, int size1,
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( cost );
|
||||
CV_Assert( cost );
|
||||
val = cost[cost_step*ci + cj];
|
||||
}
|
||||
state->cost[i][j] = val;
|
||||
@@ -552,7 +552,7 @@ static int icvInitEMD( const float* signature1, int size1,
|
||||
buffer += dsize;
|
||||
}
|
||||
|
||||
assert( buffer <= buffer_end );
|
||||
CV_Assert( buffer <= buffer_end );
|
||||
|
||||
icvRussel( state );
|
||||
|
||||
|
||||
@@ -340,8 +340,8 @@ HoughLinesSDiv( InputArray image, OutputArray lines, int type,
|
||||
rv = r0 * std::cos( phi );
|
||||
i = (int)rv * tn;
|
||||
i += cvFloor( phi1 );
|
||||
assert( i >= 0 );
|
||||
assert( i < rn * tn );
|
||||
CV_Assert( i >= 0 );
|
||||
CV_Assert( i < rn * tn );
|
||||
caccum[i] = (uchar) (caccum[i] + ((i ^ iprev) != 0));
|
||||
iprev = i;
|
||||
if( cmax < caccum[i] )
|
||||
@@ -405,8 +405,8 @@ HoughLinesSDiv( InputArray image, OutputArray lines, int type,
|
||||
i = CV_IMAX( i, -1 );
|
||||
i = CV_IMIN( i, sfn );
|
||||
mcaccum[i]++;
|
||||
assert( i >= -1 );
|
||||
assert( i <= sfn );
|
||||
CV_Assert( i >= -1 );
|
||||
CV_Assert( i <= sfn );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -463,7 +463,7 @@ medianBlur_8u_Om( const Mat& _src, Mat& _dst, int m )
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( cn == 4 );
|
||||
CV_Assert( cn == 4 );
|
||||
for( k = 0; k < m*4; k += 4 )
|
||||
{
|
||||
UPDATE_ACC01( src_top[k], 0, -- );
|
||||
|
||||
@@ -52,7 +52,7 @@ static void completeMomentState( Moments* moments )
|
||||
double cx = 0, cy = 0;
|
||||
double mu20, mu11, mu02;
|
||||
double inv_m00 = 0.0;
|
||||
assert( moments != 0 );
|
||||
CV_Assert( moments != 0 );
|
||||
|
||||
if( fabs(moments->m00) > DBL_EPSILON )
|
||||
{
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
#include "hal_replacement.hpp"
|
||||
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -3191,7 +3191,7 @@ static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, Dec
|
||||
|
||||
if( sx1 - fsx1 > 1e-3 )
|
||||
{
|
||||
assert( k < ssize*2 );
|
||||
CV_Assert( k < ssize*2 );
|
||||
tab[k].di = dx * cn;
|
||||
tab[k].si = (sx1 - 1) * cn;
|
||||
tab[k++].alpha = (float)((sx1 - fsx1) / cellWidth);
|
||||
@@ -3199,7 +3199,7 @@ static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, Dec
|
||||
|
||||
for(int sx = sx1; sx < sx2; sx++ )
|
||||
{
|
||||
assert( k < ssize*2 );
|
||||
CV_Assert( k < ssize*2 );
|
||||
tab[k].di = dx * cn;
|
||||
tab[k].si = sx * cn;
|
||||
tab[k++].alpha = float(1.0 / cellWidth);
|
||||
@@ -3207,7 +3207,7 @@ static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, Dec
|
||||
|
||||
if( fsx2 - sx2 > 1e-3 )
|
||||
{
|
||||
assert( k < ssize*2 );
|
||||
CV_Assert( k < ssize*2 );
|
||||
tab[k].di = dx * cn;
|
||||
tab[k].si = sx2 * cn;
|
||||
tab[k++].alpha = (float)(std::min(std::min(fsx2 - sx2, 1.), cellWidth) / cellWidth);
|
||||
@@ -3899,7 +3899,7 @@ void resize(int src_type,
|
||||
{
|
||||
if( k == 0 || ytab[k].di != ytab[k-1].di )
|
||||
{
|
||||
assert( ytab[k].di == dy );
|
||||
CV_Assert( ytab[k].di == dy );
|
||||
tabofs[dy++] = k;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ adjustRect( const uchar* src, size_t src_step, int pix_size,
|
||||
src += rect.width*pix_size;
|
||||
rect.width = 0;
|
||||
}
|
||||
assert( rect.width <= win_size.width );
|
||||
CV_Assert( rect.width <= win_size.width );
|
||||
}
|
||||
|
||||
if( ip.y >= 0 )
|
||||
|
||||
@@ -155,7 +155,7 @@ void cv::watershed( InputArray _src, InputOutputArray _markers )
|
||||
dr = std::abs((ptr1)[2] - (ptr2)[2]);\
|
||||
diff = ws_max(db,dg); \
|
||||
diff = ws_max(diff,dr); \
|
||||
assert( 0 <= diff && diff <= 255 ); \
|
||||
CV_Assert( 0 <= diff && diff <= 255 ); \
|
||||
}
|
||||
|
||||
CV_Assert( src.type() == CV_8UC3 && dst.type() == CV_32SC1 );
|
||||
@@ -215,7 +215,7 @@ void cv::watershed( InputArray _src, InputOutputArray _markers )
|
||||
}
|
||||
|
||||
// Add to according queue
|
||||
assert( 0 <= idx && idx <= 255 );
|
||||
CV_Assert( 0 <= idx && idx <= 255 );
|
||||
ws_push( idx, i*mstep + j, i*istep + j*3 );
|
||||
m[0] = IN_QUEUE;
|
||||
}
|
||||
@@ -286,7 +286,7 @@ void cv::watershed( InputArray _src, InputOutputArray _markers )
|
||||
}
|
||||
|
||||
// Set label to current pixel in marker image
|
||||
assert( lab != 0 );
|
||||
CV_Assert( lab != 0 );
|
||||
m[0] = lab;
|
||||
|
||||
if( lab == WSHED )
|
||||
|
||||
@@ -436,7 +436,7 @@ int Subdiv2D::insert(Point2f pt)
|
||||
else
|
||||
CV_Error_(CV_StsError, ("Subdiv2D::locate returned invalid location = %d", location) );
|
||||
|
||||
assert( curr_edge != 0 );
|
||||
CV_Assert( curr_edge != 0 );
|
||||
validGeometry = false;
|
||||
|
||||
curr_point = newPoint(pt, false);
|
||||
|
||||
@@ -182,7 +182,7 @@ int CV_ApproxPolyTest::check_slice( CvPoint StartPt, CvPoint EndPt,
|
||||
////////////////////////////////
|
||||
if( SrcReader == NULL )
|
||||
{
|
||||
assert( false );
|
||||
CV_Assert( false );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ int CV_ApproxPolyTest::check( CvSeq* SrcSeq, CvSeq* DstSeq, float Eps )
|
||||
int Count;
|
||||
int i,j;
|
||||
|
||||
assert( SrcSeq && DstSeq );
|
||||
CV_Assert( SrcSeq && DstSeq );
|
||||
|
||||
////////// init ////////////////////
|
||||
Count = SrcSeq->total;
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace opencv_test { namespace {
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( cn == 3 );
|
||||
CV_Assert( cn == 3 );
|
||||
for( j = 0; j < size.width*3; j += 3 )
|
||||
{
|
||||
float sum_b = 0, sum_g = 0, sum_r = 0, wsum = 0;
|
||||
|
||||
@@ -249,7 +249,7 @@ test_Canny( const Mat& src, Mat& dst,
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( fabs(tg) > tan_3pi_8 );
|
||||
CV_Assert( fabs(tg) > tan_3pi_8 );
|
||||
x1 = x2 = x; y1 = y + 1; y2 = y - 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ void CV_ColorCvtBaseTest::convert_forward( const Mat& src, Mat& dst )
|
||||
float* dst_buf = &_dst_buf[0];
|
||||
int i, j;
|
||||
|
||||
assert( (cn == 3 || cn == 4) && (dst_cn == 3 || dst_cn == 1) );
|
||||
CV_Assert( (cn == 3 || cn == 4) && (dst_cn == 3 || dst_cn == 1) );
|
||||
|
||||
for( i = 0; i < src.rows; i++ )
|
||||
{
|
||||
@@ -281,7 +281,7 @@ void CV_ColorCvtBaseTest::convert_forward( const Mat& src, Mat& dst )
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -312,7 +312,7 @@ void CV_ColorCvtBaseTest::convert_backward( const Mat& src, const Mat& dst, Mat&
|
||||
float* dst_buf = &_dst_buf[0];
|
||||
int i, j;
|
||||
|
||||
assert( cn == 3 || cn == 4 );
|
||||
CV_Assert( cn == 3 || cn == 4 );
|
||||
|
||||
for( i = 0; i < src.rows; i++ )
|
||||
{
|
||||
@@ -385,7 +385,7 @@ void CV_ColorCvtBaseTest::convert_backward( const Mat& src, const Mat& dst, Mat&
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1501,7 +1501,7 @@ void CV_ColorRGBTest::convert_forward( const Mat& src, Mat& dst )
|
||||
int g_rshift = dst_bits == 16 ? 2 : 3;
|
||||
int r_lshift = dst_bits == 16 ? 11 : 10;
|
||||
|
||||
//assert( (cn == 3 || cn == 4) && (dst_cn == 3 || (dst_cn == 2 && depth == CV_8U)) );
|
||||
//CV_Assert( (cn == 3 || cn == 4) && (dst_cn == 3 || (dst_cn == 2 && depth == CV_8U)) );
|
||||
|
||||
for( i = 0; i < src.rows; i++ )
|
||||
{
|
||||
@@ -1571,7 +1571,7 @@ void CV_ColorRGBTest::convert_forward( const Mat& src, Mat& dst )
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1587,7 +1587,7 @@ void CV_ColorRGBTest::convert_backward( const Mat& /*src*/, const Mat& src, Mat&
|
||||
int g_lshift = dst_bits == 16 ? 2 : 3;
|
||||
int r_rshift = dst_bits == 16 ? 11 : 10;
|
||||
|
||||
//assert( (cn == 3 || cn == 4) && (src_cn == 3 || (src_cn == 2 && depth == CV_8U)) );
|
||||
//CV_Assert( (cn == 3 || cn == 4) && (src_cn == 3 || (src_cn == 2 && depth == CV_8U)) );
|
||||
|
||||
for( i = 0; i < src.rows; i++ )
|
||||
{
|
||||
@@ -1677,7 +1677,7 @@ void CV_ColorRGBTest::convert_backward( const Mat& /*src*/, const Mat& src, Mat&
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1840,6 +1840,21 @@ TEST(Imgproc_ColorLuv, accuracy) { CV_ColorLuvTest test; test.safe_run(); }
|
||||
TEST(Imgproc_ColorRGB, accuracy) { CV_ColorRGBTest test; test.safe_run(); }
|
||||
TEST(Imgproc_ColorBayer, accuracy) { CV_ColorBayerTest test; test.safe_run(); }
|
||||
|
||||
TEST(Imgproc_ColorLuv, Overflow_21112)
|
||||
{
|
||||
const Size sz(107, 16); // unaligned size to run both SIMD and generic code
|
||||
Mat luv_init(sz, CV_8UC3, Scalar(49, 205, 23));
|
||||
Mat rgb;
|
||||
cvtColor(luv_init, rgb, COLOR_Luv2RGB);
|
||||
// Convert to normal Luv coordinates for floats.
|
||||
Mat luv_initf(sz, CV_32FC3, Scalar(49.0f/255.f*100, 205.0f*354/255.f - 134, 23.0f*262/255.f - 140));
|
||||
Mat rgbf;
|
||||
cvtColor(luv_initf, rgbf, COLOR_Luv2RGB);
|
||||
Mat rgb_converted;
|
||||
rgb.convertTo(rgb_converted, CV_32F);
|
||||
EXPECT_LE(cvtest::norm(255.f*rgbf, rgb_converted, NORM_INF), 1e-5);
|
||||
}
|
||||
|
||||
TEST(Imgproc_ColorBayer, regression)
|
||||
{
|
||||
cvtest::TS* ts = cvtest::TS::ptr();
|
||||
@@ -2569,7 +2584,7 @@ int row8uLuv2RGB(const uchar* src_row, uchar *dst_row, int n, int cn, int blue_i
|
||||
|
||||
long long int xv = ((int)up)*(long long)vp;
|
||||
int x = (int)(xv/BASE);
|
||||
x = y*x/BASE;
|
||||
x = ((long long int)y)*x/BASE;
|
||||
|
||||
long long int vpl = LvToVpl_b[LL*256+vv];
|
||||
long long int zp = vpl - xv*(255/3);
|
||||
@@ -2725,11 +2740,11 @@ TEST(Imgproc_ColorLuv_Full, bitExactness)
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
|
||||
0xec311a14, 0x995efefc, 0xf71b590b, 0xc1edfce7, 0x67b2b2e2, 0xe6d7f90d, 0xbcbaff5c, 0xd86ae19c,
|
||||
0x3e8e4647, 0x53f1a5e3, 0x60dfb6ca, 0xcda851fe, 0xd91084b3, 0xe361bf6f, 0x90fe66ed, 0xb19c5b89,
|
||||
0x4bff0e00, 0x76bbff01, 0x80735725, 0xb5e0f137, 0x96abb417, 0xfb2cf5cf, 0x314cf55e, 0x77bde10e,
|
||||
0x2ab24209, 0x81caa6F0, 0x3019b8eb, 0x427c505f, 0x5bba7d77, 0xf29cb4d6, 0x760f65ca, 0xf6b4536c,
|
||||
|
||||
0x190508ec, 0xc7764e22, 0x19b042a8, 0x2db4c5d8, 0x6e1cfd1d, 0x39bddd51, 0x942714ed, 0x19444d39,
|
||||
0xed16e206, 0xc4102784, 0x590075fe, 0xaaef2ec6, 0xbeb84149, 0x8da31e4f, 0x7cbe7d77, 0x1c90b30a,
|
||||
0xb5cd0704, 0x82144fd4, 0x4e6f4843, 0x106bc505, 0xf587fc97, 0x3665d9a3, 0x3ea014a8, 0xec664953,
|
||||
0x6ec9e59e, 0xf9201e08, 0xf3676fb8, 0xe4e42c10, 0x92d33f64, 0x13b923f7, 0x308f7f50, 0xca98b420,
|
||||
};
|
||||
|
||||
RNG rng(0);
|
||||
|
||||
@@ -208,7 +208,7 @@ cvTsMarkContours( IplImage* img, int val )
|
||||
int i, j;
|
||||
int step = img->widthStep;
|
||||
|
||||
assert( img->depth == IPL_DEPTH_8U && img->nChannels == 1 && (val&1) != 0);
|
||||
CV_Assert( img->depth == IPL_DEPTH_8U && img->nChannels == 1 && (val&1) != 0);
|
||||
|
||||
for( i = 1; i < img->height - 1; i++ )
|
||||
for( j = 1; j < img->width - 1; j++ )
|
||||
|
||||
@@ -301,7 +301,7 @@ void CV_BaseShapeDescrTest::generate_point_set( void* pointsSet )
|
||||
else
|
||||
{
|
||||
CvMat* ptm = (CvMat*)pointsSet;
|
||||
assert( CV_IS_MAT(ptm) && CV_IS_MAT_CONT(ptm->type) );
|
||||
CV_Assert( CV_IS_MAT(ptm) && CV_IS_MAT_CONT(ptm->type) );
|
||||
total = ptm->rows + ptm->cols - 1;
|
||||
point_type = CV_MAT_TYPE(ptm->type);
|
||||
data = ptm->data.ptr;
|
||||
@@ -310,7 +310,7 @@ void CV_BaseShapeDescrTest::generate_point_set( void* pointsSet )
|
||||
n = CV_MAT_CN(point_type);
|
||||
point_type = CV_MAT_DEPTH(point_type);
|
||||
|
||||
assert( (point_type == CV_32S || point_type == CV_32F) && n <= 4 );
|
||||
CV_Assert( (point_type == CV_32S || point_type == CV_32F) && n <= 4 );
|
||||
|
||||
for( i = 0; i < total; i++ )
|
||||
{
|
||||
@@ -1335,7 +1335,7 @@ void CV_FitEllipseTest::generate_point_set( void* pointsSet )
|
||||
else
|
||||
{
|
||||
CvMat* ptm = (CvMat*)pointsSet;
|
||||
assert( CV_IS_MAT(ptm) && CV_IS_MAT_CONT(ptm->type) );
|
||||
CV_Assert( CV_IS_MAT(ptm) && CV_IS_MAT_CONT(ptm->type) );
|
||||
total = ptm->rows + ptm->cols - 1;
|
||||
point_type = CV_MAT_TYPE(ptm->type);
|
||||
data = ptm->data.ptr;
|
||||
@@ -1621,7 +1621,7 @@ void CV_FitLineTest::generate_point_set( void* pointsSet )
|
||||
else
|
||||
{
|
||||
CvMat* ptm = (CvMat*)pointsSet;
|
||||
assert( CV_IS_MAT(ptm) && CV_IS_MAT_CONT(ptm->type) );
|
||||
CV_Assert( CV_IS_MAT(ptm) && CV_IS_MAT_CONT(ptm->type) );
|
||||
total = ptm->rows + ptm->cols - 1;
|
||||
point_type = CV_MAT_DEPTH(CV_MAT_TYPE(ptm->type));
|
||||
data = ptm->data.ptr;
|
||||
@@ -1788,13 +1788,13 @@ cvTsGenerateTousledBlob( CvPoint2D32f center, CvSize2D32f axes,
|
||||
else
|
||||
{
|
||||
CvMat* ptm = (CvMat*)points;
|
||||
assert( CV_IS_MAT(ptm) && CV_IS_MAT_CONT(ptm->type) );
|
||||
CV_Assert( CV_IS_MAT(ptm) && CV_IS_MAT_CONT(ptm->type) );
|
||||
total = ptm->rows + ptm->cols - 1;
|
||||
point_type = CV_MAT_TYPE(ptm->type);
|
||||
data = ptm->data.ptr;
|
||||
}
|
||||
|
||||
assert( point_type == CV_32SC2 || point_type == CV_32FC2 );
|
||||
CV_Assert( point_type == CV_32SC2 || point_type == CV_32FC2 );
|
||||
|
||||
for( i = 0; i < total; i++ )
|
||||
{
|
||||
@@ -1874,8 +1874,8 @@ void CV_ContourMomentsTest::generate_point_set( void* pointsSet )
|
||||
center.x = (float)(img_size.width*0.5 + (cvtest::randReal(rng)-0.5)*(img_size.width - max_sz*2)*0.8);
|
||||
center.y = (float)(img_size.height*0.5 + (cvtest::randReal(rng)-0.5)*(img_size.height - max_sz*2)*0.8);
|
||||
|
||||
assert( 0 < center.x - max_sz && center.x + max_sz < img_size.width &&
|
||||
0 < center.y - max_sz && center.y + max_sz < img_size.height );
|
||||
CV_Assert( 0 < center.x - max_sz && center.x + max_sz < img_size.width &&
|
||||
0 < center.y - max_sz && center.y + max_sz < img_size.height );
|
||||
|
||||
max_r_scale = cvtest::randReal(rng)*max_max_r_scale*0.01;
|
||||
angle = cvtest::randReal(rng)*360;
|
||||
|
||||
@@ -161,7 +161,7 @@ cvTsDistTransform( const CvMat* _src, CvMat* _dst, int dist_type,
|
||||
float delta[16];
|
||||
int tstep, count;
|
||||
|
||||
assert( mask_size == 3 || mask_size == 5 );
|
||||
CV_Assert( mask_size == 3 || mask_size == 5 );
|
||||
|
||||
if( dist_type == CV_DIST_USER )
|
||||
memcpy( mask, _mask, sizeof(mask) );
|
||||
|
||||
@@ -992,8 +992,8 @@ static void test_medianFilter( const Mat& src, Mat& dst, int m )
|
||||
median_pair *buf0 = &_buf0[0], *buf1 = &_buf1[0];
|
||||
int step = (int)(src.step/src.elemSize());
|
||||
|
||||
assert( src.rows == dst.rows + m - 1 && src.cols == dst.cols + m - 1 &&
|
||||
src.type() == dst.type() && src.type() == CV_8UC1 );
|
||||
CV_Assert( src.rows == dst.rows + m - 1 && src.cols == dst.cols + m - 1 &&
|
||||
src.type() == dst.type() && src.type() == CV_8UC1 );
|
||||
|
||||
for( i = 0; i < dst.rows; i++ )
|
||||
{
|
||||
@@ -1050,7 +1050,7 @@ static void test_medianFilter( const Mat& src, Mat& dst, int m )
|
||||
*buf1++ = buf0[k++];
|
||||
else
|
||||
{
|
||||
assert( col_buf[l] < INT_MAX );
|
||||
CV_Assert( col_buf[l] < INT_MAX );
|
||||
*buf1++ = median_pair(ins_col,col_buf[l++]);
|
||||
}
|
||||
}
|
||||
@@ -1061,7 +1061,7 @@ static void test_medianFilter( const Mat& src, Mat& dst, int m )
|
||||
if( del_col < 0 )
|
||||
n += m;
|
||||
buf1 -= n;
|
||||
assert( n == m2 );
|
||||
CV_Assert( n == m2 );
|
||||
dst1[j] = (uchar)buf1[n/2].val;
|
||||
median_pair* tbuf;
|
||||
CV_SWAP( buf0, buf1, tbuf );
|
||||
|
||||
@@ -169,7 +169,7 @@ int CV_ImgWarpBaseTest::prepare_test_case( int test_case_idx )
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
}
|
||||
|
||||
/*switch( depth )
|
||||
@@ -187,7 +187,7 @@ int CV_ImgWarpBaseTest::prepare_test_case( int test_case_idx )
|
||||
((float*)ptr)[j] = (float)buffer[j];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
}*/
|
||||
cv::Mat src(1, cols*cn, CV_32F, &buffer[0]);
|
||||
cv::Mat dst(1, cols*cn, depth, ptr);
|
||||
@@ -482,7 +482,7 @@ static void test_remap( const Mat& src, Mat& dst, const Mat& mapx, const Mat& ma
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -935,7 +935,7 @@ void CV_Remap_Test::remap_generic(const Mat& _src, Mat& _dst)
|
||||
else if (interpolation == INTER_LANCZOS4)
|
||||
ksize = 8;
|
||||
else if (interpolation != INTER_LINEAR)
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
int ofs = (ksize / 2) - 1;
|
||||
|
||||
CV_Assert(_src.depth() == CV_32F && _dst.type() == _src.type());
|
||||
|
||||
@@ -185,7 +185,7 @@ static void cvTsMatchTemplate( const CvMat* img, const CvMat* templ, CvMat* resu
|
||||
b_denom = 1.;
|
||||
}
|
||||
|
||||
assert( CV_TM_SQDIFF <= method && method <= CV_TM_CCOEFF_NORMED );
|
||||
CV_Assert( CV_TM_SQDIFF <= method && method <= CV_TM_CCOEFF_NORMED );
|
||||
|
||||
for( i = 0; i < result->rows; i++ )
|
||||
{
|
||||
|
||||
@@ -474,7 +474,7 @@ static void test_threshold( const Mat& _src, Mat& _dst,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user