Merge remote-tracking branch 'origin/master'

This commit is contained in:
Vadim Pisarevsky 2012-10-12 16:29:20 +04:00
commit fa368d6202
9 changed files with 23 additions and 9 deletions

View File

@ -1102,7 +1102,7 @@ cv::Mat cv::findFundamentalMat( InputArray _points1, InputArray _points2,
CV_Assert( npoints >= 0 && points2.checkVector(2) == npoints && CV_Assert( npoints >= 0 && points2.checkVector(2) == npoints &&
points1.type() == points2.type()); points1.type() == points2.type());
Mat F(3, 3, CV_64F); Mat F(method == CV_FM_7POINT ? 9 : 3, 3, CV_64F);
CvMat _pt1 = points1, _pt2 = points2; CvMat _pt1 = points1, _pt2 = points2;
CvMat matF = F, c_mask, *p_mask = 0; CvMat matF = F, c_mask, *p_mask = 0;
if( _mask.needed() ) if( _mask.needed() )
@ -1113,6 +1113,8 @@ cv::Mat cv::findFundamentalMat( InputArray _points1, InputArray _points2,
int n = cvFindFundamentalMat( &_pt1, &_pt2, &matF, method, param1, param2, p_mask ); int n = cvFindFundamentalMat( &_pt1, &_pt2, &matF, method, param1, param2, p_mask );
if( n <= 0 ) if( n <= 0 )
F = Scalar(0); F = Scalar(0);
if( n == 1 )
F = F.rowRange(0, 3);
return F; return F;
} }

View File

@ -79,4 +79,6 @@ DEF_PARAM_TEST(Sz_Depth_Cn, cv::Size, MatDepth, MatCn);
::perf::Regression::add(this, std::string(#dmat) + "-response-row", __response, ## __VA_ARGS__); \ ::perf::Regression::add(this, std::string(#dmat) + "-response-row", __response, ## __VA_ARGS__); \
} while(0) } while(0)
#define FAIL_NO_CPU() FAIL() << "No such CPU implementation analogy"
#endif // __OPENCV_PERF_GPU_UTILITY_HPP__ #endif // __OPENCV_PERF_GPU_UTILITY_HPP__

View File

@ -4,7 +4,7 @@ Reading and Writing Images and Video
.. highlight:: cpp .. highlight:: cpp
imdecode imdecode
------------ --------
Reads an image from a buffer in memory. Reads an image from a buffer in memory.
.. ocv:function:: Mat imdecode( InputArray buf, int flags ) .. ocv:function:: Mat imdecode( InputArray buf, int flags )
@ -32,7 +32,7 @@ See
.. note:: In the case of color images, the decoded images will have the channels stored in ``B G R`` order. .. note:: In the case of color images, the decoded images will have the channels stored in ``B G R`` order.
imencode imencode
------------ --------
Encodes an image into a memory buffer. Encodes an image into a memory buffer.
.. ocv:function:: bool imencode( const string& ext, InputArray img, vector<uchar>& buf, const vector<int>& params=vector<int>()) .. ocv:function:: bool imencode( const string& ext, InputArray img, vector<uchar>& buf, const vector<int>& params=vector<int>())
@ -56,7 +56,7 @@ See
.. note:: ``cvEncodeImage`` returns single-row matrix of type ``CV_8UC1`` that contains encoded image as array of bytes. .. note:: ``cvEncodeImage`` returns single-row matrix of type ``CV_8UC1`` that contains encoded image as array of bytes.
imread imread
---------- ------
Loads an image from a file. Loads an image from a file.
.. ocv:function:: Mat imread( const string& filename, int flags=1 ) .. ocv:function:: Mat imread( const string& filename, int flags=1 )
@ -85,7 +85,8 @@ Loads an image from a file.
* **=0** Return a grayscale image * **=0** Return a grayscale image
* **<0** Return the loaded image as is. Note that in the current implementation the alpha channel, if any, is stripped from the output image. For example, a 4-channel RGBA image is loaded as RGB if :math:`flags\ge0` . * **<0** Return the loaded image as is.
.. note:: In the current implementation the alpha channel, if any, is stripped from the output image.
The function ``imread`` loads an image from the specified file and returns it. If the image cannot be read (because of missing file, improper permissions, unsupported or invalid format), the function returns an empty matrix ( ``Mat::data==NULL`` ). Currently, the following file formats are supported: The function ``imread`` loads an image from the specified file and returns it. If the image cannot be read (because of missing file, improper permissions, unsupported or invalid format), the function returns an empty matrix ( ``Mat::data==NULL`` ). Currently, the following file formats are supported:

View File

@ -1111,7 +1111,7 @@ static void mainloop_v4l2(CvCaptureCAM_V4L* capture) {
FD_SET (capture->deviceHandle, &fds); FD_SET (capture->deviceHandle, &fds);
/* Timeout. */ /* Timeout. */
tv.tv_sec = 2; tv.tv_sec = 10;
tv.tv_usec = 0; tv.tv_usec = 0;
r = select (capture->deviceHandle+1, &fds, NULL, NULL, &tv); r = select (capture->deviceHandle+1, &fds, NULL, NULL, &tv);

View File

@ -1229,7 +1229,7 @@ static void mainloop_v4l2(CvCaptureCAM_V4L* capture) {
FD_SET (capture->deviceHandle, &fds); FD_SET (capture->deviceHandle, &fds);
/* Timeout. */ /* Timeout. */
tv.tv_sec = 2; tv.tv_sec = 10;
tv.tv_usec = 0; tv.tv_usec = 0;
r = select (capture->deviceHandle+1, &fds, NULL, NULL, &tv); r = select (capture->deviceHandle+1, &fds, NULL, NULL, &tv);

View File

@ -187,6 +187,7 @@ private:
cv::FileStorage storageOut; cv::FileStorage storageOut;
cv::FileNode rootIn; cv::FileNode rootIn;
std::string currentTestNodeName; std::string currentTestNodeName;
std::string suiteName;
cv::FileStorage& write(); cv::FileStorage& write();

View File

@ -184,6 +184,8 @@ void Regression::init(const std::string& testSuitName, const std::string& ext)
storageOutPath = testSuitName; storageOutPath = testSuitName;
} }
suiteName = testSuitName;
try try
{ {
if (storageIn.open(storageInPath, cv::FileStorage::READ)) if (storageIn.open(storageInPath, cv::FileStorage::READ))
@ -562,6 +564,12 @@ Regression& Regression::operator() (const std::string& name, cv::InputArray arra
std::string nodename = getCurrentTestNodeName(); std::string nodename = getCurrentTestNodeName();
#ifdef HAVE_CUDA
static const std::string prefix = (param_run_cpu)? "CPU_" : "GPU_";
if(suiteName == "gpu")
nodename = prefix + nodename;
#endif
cv::FileNode n = rootIn[nodename]; cv::FileNode n = rootIn[nodename];
if(n.isNone()) if(n.isNone())
{ {