Move cv::Mat out of core.hpp

This commit is contained in:
Andrey Kamaev
2013-03-28 21:01:12 +04:00
parent 135c0b6cb5
commit 715fa3303e
46 changed files with 1854 additions and 1731 deletions

View File

@@ -118,7 +118,7 @@ static void foundCorners(vector<CvPoint2D32f> *srcImagePoints,IplImage* source,
cvNormalize(grayImage, grayImage, 0, 255, CV_MINMAX);
cvThreshold( grayImage, grayImage, 26, 255, CV_THRESH_BINARY_INV);//25
Mat MgrayImage = grayImage;
Mat MgrayImage = cv::cvarrToMat(grayImage);
//For debug
//MgrayImage = MgrayImage.clone();//deep copy
vector<vector<Point> > contours;
@@ -184,7 +184,7 @@ static void foundCorners(vector<CvPoint2D32f> *srcImagePoints,IplImage* source,
}
srcImagePoints->at(3) = srcImagePoints_temp.at(index);
Mat Msource = source;
Mat Msource = cv::cvarrToMat(source);
stringstream ss;
for(size_t i = 0 ; i<srcImagePoints_temp.size(); i++ )
{

View File

@@ -3,6 +3,7 @@
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/flann/miniflann.hpp"
#include "opencv2/core/utility.hpp"
using namespace cv; // all the new API is put into "cv" namespace. Export its content
using namespace std;
@@ -32,7 +33,7 @@ int main( int argc, char** argv )
fprintf(stderr, "Can not load image %s\n", imagename);
return -1;
}
Mat img(iplimg); // cv::Mat replaces the CvMat and IplImage, but it's easy to convert
Mat img = cv::cvarrToMat(iplimg); // cv::Mat replaces the CvMat and IplImage, but it's easy to convert
// between the old and the new data structures (by default, only the header
// is converted, while the data is shared)
#else

View File

@@ -4,6 +4,7 @@
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/utility.hpp>"
using namespace cv; // The new C++ interface API is inside this namespace. Import it.
using namespace std;
@@ -33,7 +34,7 @@ int main( int argc, char** argv )
cerr << "Can not load image " << imagename << endl;
return -1;
}
Mat I(IplI); // Convert to the new style container. Only header created. Image not copied.
Mat I = cv::cvarrToMat(IplI); // Convert to the new style container. Only header created. Image not copied.
#else
Mat I = imread(imagename); // the newer cvLoadImage alternative, MATLAB-style function
if( I.empty() ) // same as if( !I.data )

View File

@@ -6,6 +6,7 @@
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/core/utility.hpp"
#include <iostream>
#include <stdio.h>
@@ -43,7 +44,7 @@ int main( void )
{
for(;;)
{
frame = cvQueryFrame( capture );
frame = cv::cvarrToMat(cvQueryFrame( capture ));
//-- 3. Apply the classifier to the frame
if( !frame.empty() )

View File

@@ -6,6 +6,7 @@
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/core/utility.hpp"
#include <iostream>
#include <stdio.h>
@@ -43,7 +44,7 @@ int main( void )
{
for(;;)
{
frame = cvQueryFrame( capture );
frame = cv::cvarrToMat(cvQueryFrame( capture ));
//-- 3. Apply the classifier to the frame
if( !frame.empty() )