if( (depth != CV_32F && depth != CV_64F) || (cn != 1 && cn != 2 && cn != 3) )
CV_Error( CV_StsUnsupportedFormat, "The format of point matrix is unsupported" );
- if( points->rows > points->cols )
+ if( cn > 1 )
+ {
+ dims = cn;
+ CV_Assert( points->rows == 1 || points->cols == 1 );
+ count = points->rows * points->cols;
+ }
+ else if( points->rows > points->cols )
{
dims = cn*points->cols;
count = points->rows;
{
if( (points->rows > 1 && cn > 1) || (points->rows == 1 && cn == 1) )
CV_Error( CV_StsBadSize, "The point matrix does not have a proper layout (2xn, 3xn, nx2 or nx3)" );
- dims = cn * points->rows;
+ dims = points->rows;
count = points->cols;
}
if( (abc_depth != CV_32F && abc_depth != CV_64F) || (abc_cn != 1 && abc_cn != 3) )
CV_Error( CV_StsUnsupportedFormat, "The format of the matrix of lines is unsupported" );
- if( lines->rows > lines->cols )
+ if( abc_cn > 1 )
+ {
+ abc_dims = abc_cn;
+ CV_Assert( lines->rows == 1 || lines->cols == 1 );
+ abc_count = lines->rows * lines->cols;
+ }
+ else if( lines->rows > lines->cols )
{
abc_dims = abc_cn*lines->cols;
abc_count = lines->rows;
{
if( (lines->rows > 1 && abc_cn > 1) || (lines->rows == 1 && abc_cn == 1) )
CV_Error( CV_StsBadSize, "The lines matrix does not have a proper layout (3xn or nx3)" );
- abc_dims = abc_cn * lines->rows;
+ abc_dims = lines->rows;
abc_count = lines->cols;
}
elem_size = CV_ELEM_SIZE(depth);
abc_elem_size = CV_ELEM_SIZE(abc_depth);
- if( points->rows == dims )
+ if( cn == 1 && points->rows == dims )
{
plane_stride = points->step;
stride = elem_size;
stride = points->rows == 1 ? dims*elem_size : points->step;
}
- if( lines->rows == 3 )
+ if( abc_cn == 1 && lines->rows == 3 )
{
abc_plane_stride = lines->step;
abc_stride = abc_elem_size;
int fm_depth = cvtest::randInt(rng) % 2 == 0 ? CV_32F : CV_64F;
int pt_depth = cvtest::randInt(rng) % 2 == 0 ? CV_32F : CV_64F;
int ln_depth = cvtest::randInt(rng) % 2 == 0 ? CV_32F : CV_64F;
- double pt_count_exp = cvtest::randReal(rng)*6 + 1;
+ double pt_count_exp = cvtest::randReal(rng)*6;
which_image = 1 + (cvtest::randInt(rng) % 2);
pt_count = cvRound(exp(pt_count_exp));
- pt_count = MAX( pt_count, 5 );
+ pt_count = MAX( pt_count, 1 );
+ bool few_points = pt_count < 5;
dims = 2 + (cvtest::randInt(rng) % 2);
types[INPUT][0] = CV_MAKETYPE(pt_depth, 1);
- if( cvtest::randInt(rng) % 2 )
+ if( cvtest::randInt(rng) % 2 && !few_points )
sizes[INPUT][0] = cvSize(pt_count, dims);
else
{
sizes[INPUT][0] = cvSize(dims, pt_count);
- if( cvtest::randInt(rng) % 2 )
+ if( cvtest::randInt(rng) % 2 || few_points )
{
types[INPUT][0] = CV_MAKETYPE(pt_depth, dims);
if( cvtest::randInt(rng) % 2 )
types[OUTPUT][0] = CV_MAKETYPE(ln_depth, 1);
- if( cvtest::randInt(rng) % 2 )
+ if( cvtest::randInt(rng) % 2 && !few_points )
sizes[OUTPUT][0] = cvSize(pt_count, 3);
else
{
sizes[OUTPUT][0] = cvSize(3, pt_count);
- if( cvtest::randInt(rng) % 2 )
+ if( cvtest::randInt(rng) % 2 || few_points )
{
types[OUTPUT][0] = CV_MAKETYPE(ln_depth, 3);
if( cvtest::randInt(rng) % 2 )
test_convertHomogeneous( lines, test_mat[REF_OUTPUT][0] );
}
-
TEST(Calib3d_Rodrigues, accuracy) { CV_RodriguesTest test; test.safe_run(); }
TEST(Calib3d_FindFundamentalMat, accuracy) { CV_FundamentalMatTest test; test.safe_run(); }
TEST(Calib3d_ConvertHomogeneoous, accuracy) { CV_ConvertHomogeneousTest test; test.safe_run(); }
TEST(Calib3d_ComputeEpilines, accuracy) { CV_ComputeEpilinesTest test; test.safe_run(); }
+
/* End of file. */