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 &&
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 matF = F, c_mask, *p_mask = 0;
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 );
if( n <= 0 )
F = Scalar(0);
if( n == 1 )
F = F.rowRange(0, 3);
return F;
}

View File

@ -28,7 +28,7 @@ PERF_TEST_P( Size_SrcDepth_DstChannels, merge,
mv.push_back( Mat(sz, CV_MAKETYPE(srcDepth, 1)) );
randu(mv[i], 0, 255);
}
Mat dst;
TEST_CYCLE() merge( (vector<Mat> &)mv, dst );

View File

@ -22,7 +22,7 @@ PERF_TEST_P( Size_Depth_Channels, split,
int depth = get<1>(GetParam());
int channels = get<2>(GetParam());
Mat m(sz, CV_MAKETYPE(depth, channels));
Mat m(sz, CV_MAKETYPE(depth, channels));
randu(m, 0, 255);
vector<Mat> mv;

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__); \
} while(0)
#define FAIL_NO_CPU() FAIL() << "No such CPU implementation analogy"
#endif // __OPENCV_PERF_GPU_UTILITY_HPP__

View File

@ -4,7 +4,7 @@ Reading and Writing Images and Video
.. highlight:: cpp
imdecode
------------
--------
Reads an image from a buffer in memory.
.. 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.
imencode
------------
--------
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>())
@ -56,7 +56,7 @@ See
.. note:: ``cvEncodeImage`` returns single-row matrix of type ``CV_8UC1`` that contains encoded image as array of bytes.
imread
----------
------
Loads an image from a file.
.. 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 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:

View File

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

View File

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

View File

@ -184,6 +184,8 @@ void Regression::init(const std::string& testSuitName, const std::string& ext)
storageOutPath = testSuitName;
}
suiteName = testSuitName;
try
{
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();
#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];
if(n.isNone())
{