merged the trunk r8735:8766, r8769, r8777:8780, r8790 and r8800:8811

This commit is contained in:
Marina Kolpakova
2012-06-28 17:07:17 +00:00
parent b156e2f7ed
commit 162f9fd7ea
61 changed files with 2738 additions and 1726 deletions

View File

@@ -1 +1 @@
ocv_define_module(legacy opencv_calib3d opencv_highgui opencv_video opencv_ml)
ocv_define_module(legacy opencv_calib3d opencv_video opencv_ml OPTIONAL opencv_highgui)

View File

@@ -17,16 +17,16 @@
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
* The name of Contributor may not be used to endorse or
* promote products derived from this software without
* specific prior written permission.
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
* The name of Contributor may not be used to endorse or
* promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
@@ -71,26 +71,26 @@ cvExtractSURF( const CvArr* _img, const CvArr* _mask,
mask = cvarrToMat(_mask);
vector<KeyPoint> kpt;
Mat descr;
Ptr<Feature2D> surf = Algorithm::create<Feature2D>("Feature2D.SURF");
if( surf.empty() )
CV_Error(CV_StsNotImplemented, "OpenCV was built without SURF support");
surf->set("hessianThreshold", params.hessianThreshold);
surf->set("nOctaves", params.nOctaves);
surf->set("nOctaveLayers", params.nOctaveLayers);
surf->set("upright", params.upright != 0);
surf->set("extended", params.extended != 0);
surf->operator()(img, mask, kpt, _descriptors ? _OutputArray(descr) : noArray(),
useProvidedKeyPts != 0);
if( _keypoints )
*_keypoints = cvCreateSeq(0, sizeof(CvSeq), sizeof(CvSURFPoint), storage);
if( _descriptors )
*_descriptors = cvCreateSeq(0, sizeof(CvSeq), descr.cols*descr.elemSize(), storage);
*_descriptors = cvCreateSeq(0, sizeof(CvSeq), surf->descriptorSize() * CV_ELEM_SIZE(surf->descriptorType()), storage);
for( size_t i = 0; i < kpt.size(); i++ )
{
if( _keypoints )
@@ -113,7 +113,7 @@ cvGetStarKeypoints( const CvArr* _img, CvMemStorage* storage,
params.suppressNonmaxSize);
vector<KeyPoint> kpts;
star->detect(cvarrToMat(_img), kpts, Mat());
CvSeq* seq = cvCreateSeq(0, sizeof(CvSeq), sizeof(CvStarKeypoint), storage);
for( size_t i = 0; i < kpts.size(); i++ )
{

View File

@@ -46,7 +46,10 @@
// */
#include "precomp.hpp"
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_HIGHGUI
# include "opencv2/highgui/highgui_c.h"
#endif
/////////////////////////////// CvImage implementation //////////////////////////////////
@@ -112,8 +115,10 @@ bool CvImage::load( const char* filename, const char* imgname, int color )
img = temp_img;
}*/
}
#ifdef HAVE_OPENCV_HIGHGUI
else
img = cvLoadImage( filename, color );
#endif
attach( img );
return img != 0;
@@ -161,8 +166,12 @@ void CvImage::save( const char* filename, const char* imgname, const int* params
return;
if( icvIsXmlOrYaml( filename ) )
cvSave( filename, image, imgname );
#ifdef HAVE_OPENCV_HIGHGUI
else
cvSaveImage( filename, image, params );
#else
(void)params;
#endif
}
@@ -175,8 +184,12 @@ void CvImage::write( CvFileStorage* fs, const char* imgname )
void CvImage::show( const char* window_name )
{
#ifdef HAVE_OPENCV_HIGHGUI
if( image )
cvShowImage( window_name, image );
#else
(void)window_name;
#endif
}
@@ -238,8 +251,10 @@ bool CvMatrix::load( const char* filename, const char* matname, int color )
m = temp_mat;
}*/
}
#ifdef HAVE_OPENCV_HIGHGUI
else
m = cvLoadImageM( filename, color );
#endif
set( m, false );
return m != 0;
@@ -287,8 +302,12 @@ void CvMatrix::save( const char* filename, const char* matname, const int* param
return;
if( icvIsXmlOrYaml( filename ) )
cvSave( filename, matrix, matname );
#ifdef HAVE_OPENCV_HIGHGUI
else
cvSaveImage( filename, matrix, params );
#else
(void)params;
#endif
}
@@ -301,8 +320,12 @@ void CvMatrix::write( CvFileStorage* fs, const char* matname )
void CvMatrix::show( const char* window_name )
{
#ifdef HAVE_OPENCV_HIGHGUI
if( matrix )
cvShowImage( window_name, matrix );
#else
(void)window_name;
#endif
}

View File

@@ -8,7 +8,10 @@
*/
#include "precomp.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_HIGHGUI
# include "opencv2/highgui/highgui.hpp"
#endif
#include <stdio.h>
namespace cv{
@@ -665,7 +668,11 @@ namespace cv{
cvMinMaxLoc(m_samples[i], 0, &maxval);
cvConvertScale(m_samples[i], patch, 255/maxval);
#ifdef HAVE_OPENCV_HIGHGUI
cvSaveImage(buf, patch);
#else
CV_Error(CV_StsNotImplemented, "OpenCV has been compiled without image I/O support");
#endif
cvReleaseImage(&patch);
}
@@ -1794,7 +1801,12 @@ namespace cv{
sprintf(filename, "%s/%s", path, imagename);
//printf("Reading image %s...", filename);
IplImage* img = cvLoadImage(filename, CV_LOAD_IMAGE_GRAYSCALE);
IplImage* img = 0;
#ifdef HAVE_OPENCV_HIGHGUI
img = cvLoadImage(filename, CV_LOAD_IMAGE_GRAYSCALE);
#else
CV_Error(CV_StsNotImplemented, "OpenCV has been compiled without image I/O support");
#endif
//printf("done\n");
extractPatches (img, patches, patch_size);

View File

@@ -366,7 +366,7 @@ void CV_CvEMTest::run( int /*start_from*/ )
int currCode = runCase(caseIndex++, params, trainData, trainLabels, testData, testLabels, sizes);
code = currCode == cvtest::TS::OK ? code : currCode;
}
ts->set_failed_test_info( code );
}
@@ -382,7 +382,7 @@ protected:
samples.at<float>(0,0) = 1;
samples.at<float>(1,0) = 2;
samples.at<float>(2,0) = 3;
Mat labels(samples.rows, 1, CV_32S);
CvEMParams params;
@@ -398,7 +398,7 @@ protected:
// Write out
string filename = tempfile() + ".xml";
string filename = cv::tempfile(".xml");
{
FileStorage fs = FileStorage(filename, FileStorage::WRITE);
try

View File

@@ -421,7 +421,7 @@ void CV_StereoMatchingTest::run(int)
ts->set_failed_test_info( code );
return;
}
string fullResultFilename = dataPath + ALGORITHMS_DIR + algorithmName + RESULT_FILE;
FileStorage resFS( fullResultFilename, FileStorage::READ );
bool isWrite = true; // write or compare results
@@ -660,7 +660,7 @@ class CV_StereoGCTest : public CV_StereoMatchingTest
public:
CV_StereoGCTest()
{
name = "stereogc";
name = "stereogc";
fill(rmsEps.begin(), rmsEps.end(), 3.f);
fracEps[0] = 0.05f; // all
fracEps[1] = 0.05f; // noOccl