mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Merge pull request #785 from taka-no-me:split_c_cpp2
This commit is contained in:
@@ -45,8 +45,10 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
# include "opencv2/core.hpp"
|
||||
# include "opencv2/imgproc.hpp"
|
||||
#endif
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -345,7 +345,7 @@ _exit_:
|
||||
|
||||
if( code < 0 )
|
||||
{
|
||||
#if defined _DEBUG && defined WIN32
|
||||
#if 0 //defined _DEBUG && defined WIN32
|
||||
IplImage* dst = cvCreateImage( img_size, 8, 3 );
|
||||
cvNamedWindow( "test", 1 );
|
||||
cvCmpS( img, 0, img, CV_CMP_GT );
|
||||
@@ -484,7 +484,7 @@ _exit_:
|
||||
|
||||
if( code < 0 )
|
||||
{
|
||||
#if defined _DEBUG && defined WIN32
|
||||
#if 0// defined _DEBUG && defined WIN32
|
||||
IplImage* dst = cvCreateImage( img_size, 8, 3 );
|
||||
cvNamedWindow( "test", 1 );
|
||||
cvCmpS( img, 0, img, CV_CMP_GT );
|
||||
|
||||
@@ -72,8 +72,9 @@ void CV_OptFlowPyrLKTest::run( int )
|
||||
CvMat *_u = 0, *_v = 0, *_v2 = 0;
|
||||
char* status = 0;
|
||||
|
||||
IplImage* imgI = 0;
|
||||
IplImage* imgJ = 0;
|
||||
IplImage imgI;
|
||||
IplImage imgJ;
|
||||
cv::Mat imgI2, imgJ2;
|
||||
|
||||
int n = 0, i = 0;
|
||||
|
||||
@@ -115,9 +116,10 @@ void CV_OptFlowPyrLKTest::run( int )
|
||||
|
||||
/* read first image */
|
||||
sprintf( filename, "%soptflow/%s", ts->get_data_path().c_str(), "rock_1.bmp" );
|
||||
imgI = cvLoadImage( filename, -1 );
|
||||
imgI2 = cv::imread( filename, cv::IMREAD_UNCHANGED );
|
||||
imgI = imgI2;
|
||||
|
||||
if( !imgI )
|
||||
if( imgI2.empty() )
|
||||
{
|
||||
ts->printf( cvtest::TS::LOG, "could not read %s\n", filename );
|
||||
code = cvtest::TS::FAIL_MISSING_TEST_DATA;
|
||||
@@ -126,9 +128,10 @@ void CV_OptFlowPyrLKTest::run( int )
|
||||
|
||||
/* read second image */
|
||||
sprintf( filename, "%soptflow/%s", ts->get_data_path().c_str(), "rock_2.bmp" );
|
||||
imgJ = cvLoadImage( filename, -1 );
|
||||
imgJ2 = cv::imread( filename, cv::IMREAD_UNCHANGED );
|
||||
imgJ = imgJ2;
|
||||
|
||||
if( !imgJ )
|
||||
if( imgJ2.empty() )
|
||||
{
|
||||
ts->printf( cvtest::TS::LOG, "could not read %s\n", filename );
|
||||
code = cvtest::TS::FAIL_MISSING_TEST_DATA;
|
||||
@@ -139,7 +142,7 @@ void CV_OptFlowPyrLKTest::run( int )
|
||||
status = (char*)cvAlloc(n*sizeof(status[0]));
|
||||
|
||||
/* calculate flow */
|
||||
cvCalcOpticalFlowPyrLK( imgI, imgJ, 0, 0, u, v2, n, cvSize( 41, 41 ),
|
||||
cvCalcOpticalFlowPyrLK( &imgI, &imgJ, 0, 0, u, v2, n, cvSize( 41, 41 ),
|
||||
4, status, 0, cvTermCriteria( CV_TERMCRIT_ITER|
|
||||
CV_TERMCRIT_EPS, 30, 0.01f ), 0 );
|
||||
|
||||
@@ -201,9 +204,6 @@ _exit_:
|
||||
cvReleaseMat( &_v );
|
||||
cvReleaseMat( &_v2 );
|
||||
|
||||
cvReleaseImage( &imgI );
|
||||
cvReleaseImage( &imgJ );
|
||||
|
||||
if( code < 0 )
|
||||
ts->set_failed_test_info( code );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user