1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #25075 from mshabunin:cleanup-imgproc-1

C-API cleanup: apps, imgproc_c and some constants #25075

Merge with https://github.com/opencv/opencv_contrib/pull/3642

* Removed obsolete apps - traincascade and createsamples (please use older OpenCV versions if you need them). These apps relied heavily on C-API
* removed all mentions of imgproc C-API headers (imgproc_c.h, types_c.h) - they were empty, included core C-API headers
* replaced usage of several C constants with C++ ones (error codes, norm modes, RNG modes, PCA modes, ...) - most part of this PR (split into two parts - all modules and calib+3d - for easier backporting)
* removed imgproc C-API headers (as separate commit, so that other changes could be backported to 4.x)

Most of these changes can be backported to 4.x.
This commit is contained in:
Maksim Shabunin
2024-03-05 12:18:31 +03:00
committed by GitHub
parent 1d1faaabef
commit 8cbdd0c833
152 changed files with 820 additions and 18160 deletions
+5 -3
View File
@@ -44,6 +44,8 @@
namespace cvtest {
using namespace cv;
static int cvTsRodrigues( const CvMat* src, CvMat* dst, CvMat* jacobian )
{
int depth;
@@ -223,7 +225,7 @@ static int cvTsRodrigues( const CvMat* src, CvMat* dst, CvMat* jacobian )
cvMulTransposed( &matR, &matA, 0 );
cvSetIdentity( &matI );
if( cvNorm( &matA, &matI, CV_C ) > 1e-3 ||
if( cvNorm( &matA, &matI, NORM_INF ) > 1e-3 ||
fabs( cvDet(&matR) - 1 ) > 1e-3 )
return 0;
@@ -717,7 +719,7 @@ void CV_RodriguesTest::prepare_to_validation( int /*test_case_idx*/ )
cvtest::Rodrigues( m, vec2, m2v_jac );
cvtest::copy( vec, vec2 );
theta0 = cvtest::norm( vec2, CV_L2 );
theta0 = cvtest::norm( vec2, NORM_L2 );
theta1 = fmod( theta0, CV_PI*2 );
if( theta1 > CV_PI )
@@ -727,7 +729,7 @@ void CV_RodriguesTest::prepare_to_validation( int /*test_case_idx*/ )
if( calc_jacobians )
{
//cvInvert( v2m_jac, m2v_jac, CV_SVD );
double nrm = cvtest::norm(test_mat[REF_OUTPUT][3], CV_C);
double nrm = cvtest::norm(test_mat[REF_OUTPUT][3], NORM_INF);
if( FLT_EPSILON < nrm && nrm < 1000 )
{
gemm( test_mat[OUTPUT][1], test_mat[OUTPUT][3],
+1 -1
View File
@@ -41,7 +41,7 @@
//M*/
#include "test_precomp.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/core/core_c.h"
namespace opencv_test { namespace {
+8 -8
View File
@@ -106,15 +106,15 @@ void CV_UndistortPointsBadArgTest::run(int)
src_points = cv::cvarrToMat(&_src_points_orig);
src_points.create(2, 2, CV_32FC2);
errcount += run_test_case( CV_StsAssert, "Invalid input data matrix size" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid input data matrix size" );
src_points = cv::cvarrToMat(&_src_points_orig);
src_points.create(1, 4, CV_64FC2);
errcount += run_test_case( CV_StsAssert, "Invalid input data matrix type" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid input data matrix type" );
src_points = cv::cvarrToMat(&_src_points_orig);
src_points = cv::Mat();
errcount += run_test_case( CV_StsBadArg, "Input data matrix is not continuous" );
errcount += run_test_case( cv::Error::StsBadArg, "Input data matrix is not continuous" );
src_points = cv::cvarrToMat(&_src_points_orig);
//------------
@@ -181,19 +181,19 @@ void CV_InitUndistortRectifyMapBadArgTest::run(int)
mapy = cv::cvarrToMat(&_mapy_orig);
mat_type = CV_64F;
errcount += run_test_case( CV_StsAssert, "Invalid map matrix type" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid map matrix type" );
mat_type = mat_type_orig;
camera_mat.create(3, 2, CV_32F);
errcount += run_test_case( CV_StsAssert, "Invalid camera data matrix size" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid camera data matrix size" );
camera_mat = cv::cvarrToMat(&_camera_mat_orig);
R.create(4, 3, CV_32F);
errcount += run_test_case( CV_StsAssert, "Invalid R data matrix size" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid R data matrix size" );
R = cv::cvarrToMat(&_R_orig);
distortion_coeffs.create(6, 1, CV_32F);
errcount += run_test_case( CV_StsAssert, "Invalid distortion coefficients data matrix size" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid distortion coefficients data matrix size" );
distortion_coeffs = cv::cvarrToMat(&_distortion_coeffs_orig);
//------------
@@ -256,7 +256,7 @@ void CV_UndistortBadArgTest::run(int)
dst = cv::cvarrToMat(&_dst_orig);
camera_mat.create(5, 5, CV_64F);
errcount += run_test_case( CV_StsAssert, "Invalid camera data matrix size" );
errcount += run_test_case( cv::Error::StsAssert, "Invalid camera data matrix size" );
//------------
ts->set_failed_test_info(errcount > 0 ? cvtest::TS::FAIL_BAD_ARG_CHECK : cvtest::TS::OK);