Skip to content

Commit bd4d24f

Browse files
Andrey PavlenkoOpenCV Buildbot
authored andcommitted
Merge pull request opencv#1122 from SpecLad:merge-2.4
2 parents cd103e4 + feaa12a commit bd4d24f

32 files changed

+2343
-89
lines changed

modules/core/doc/xml_yaml_persistence.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can store and then restore various OpenCV data structures to/from XML (http:
1111

1212
Use the following procedure to write something to XML or YAML:
1313
#. Create new :ocv:class:`FileStorage` and open it for writing. It can be done with a single call to :ocv:func:`FileStorage::FileStorage` constructor that takes a filename, or you can use the default constructor and then call :ocv:func:`FileStorage::open`. Format of the file (XML or YAML) is determined from the filename extension (".xml" and ".yml"/".yaml", respectively)
14-
#. Write all the data you want using the streaming operator ``>>``, just like in the case of STL streams.
14+
#. Write all the data you want using the streaming operator ``<<``, just like in the case of STL streams.
1515
#. Close the file using :ocv:func:`FileStorage::release`. ``FileStorage`` destructor also closes the file.
1616

1717
Here is an example: ::

modules/features2d/src/brisk.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,11 @@ BRISK::operator()( InputArray _image, InputArray _mask, std::vector<KeyPoint>& k
525525
bool doOrientation=true;
526526
if (useProvidedKeypoints)
527527
doOrientation = false;
528-
computeDescriptorsAndOrOrientation(_image, _mask, keypoints, _descriptors, true, doOrientation,
528+
529+
// If the user specified cv::noArray(), this will yield false. Otherwise it will return true.
530+
bool doDescriptors = _descriptors.needed();
531+
532+
computeDescriptorsAndOrOrientation(_image, _mask, keypoints, _descriptors, doDescriptors, doOrientation,
529533
useProvidedKeypoints);
530534
}
531535

modules/highgui/src/cap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
220220
return capture;
221221
break;
222222
#endif
223-
#ifdef HAVE_VFW
224223
case CV_CAP_VFW:
224+
#ifdef HAVE_VFW
225225
capture = cvCreateCameraCapture_VFW (index);
226226
if (capture)
227227
return capture;

modules/imgproc/src/templmatch.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ void cv::matchTemplate( InputArray _img, InputArray _templ, OutputArray _result,
248248
CV_Assert( (img.depth() == CV_8U || img.depth() == CV_32F) &&
249249
img.type() == templ.type() );
250250

251+
CV_Assert( img.rows >= templ.rows && img.cols >= templ.cols);
252+
251253
Size corrSize(img.cols - templ.cols + 1, img.rows - templ.rows + 1);
252254
_result.create(corrSize, CV_32F);
253255
Mat result = _result.getMat();

modules/ocl/include/opencv2/ocl.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,19 @@ namespace cv
853853
CV_EXPORTS void cornerMinEigenVal_dxdy(const oclMat &src, oclMat &dst, oclMat &Dx, oclMat &Dy,
854854
int blockSize, int ksize, int bordertype = cv::BORDER_DEFAULT);
855855

856+
857+
/////////////////////////////////// ML ///////////////////////////////////////////
858+
859+
//! Compute closest centers for each lines in source and lable it after center's index
860+
// supports CV_32FC1/CV_32FC2/CV_32FC4 data type
861+
CV_EXPORTS void distanceToCenters(oclMat &dists, oclMat &labels, const oclMat &src, const oclMat &centers);
862+
863+
//!Does k-means procedure on GPU
864+
// supports CV_32FC1/CV_32FC2/CV_32FC4 data type
865+
CV_EXPORTS double kmeans(const oclMat &src, int K, oclMat &bestLabels,
866+
TermCriteria criteria, int attemps, int flags, oclMat &centers);
867+
868+
856869
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
857870
///////////////////////////////////////////CascadeClassifier//////////////////////////////////////////////////////////////////
858871
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

modules/ocl/src/gfft.cpp renamed to modules/ocl/src/gftt.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace cv
5555
namespace ocl
5656
{
5757
///////////////////////////OpenCL kernel strings///////////////////////////
58-
extern const char *imgproc_gfft;
58+
extern const char *imgproc_gftt;
5959
}
6060
}
6161

@@ -133,7 +133,7 @@ struct Sorter<BITONIC>
133133
for(int passOfStage = 0; passOfStage < stage + 1; ++passOfStage)
134134
{
135135
args[4] = std::make_pair(sizeof(cl_int), (void *)&passOfStage);
136-
openCLExecuteKernel(cxt, &imgproc_gfft, kernelname, globalThreads, localThreads, args, -1, -1);
136+
openCLExecuteKernel(cxt, &imgproc_gftt, kernelname, globalThreads, localThreads, args, -1, -1);
137137
}
138138
}
139139
}
@@ -160,12 +160,12 @@ struct Sorter<SELECTION>
160160
args.push_back( std::make_pair( sizeof(cl_int), (void*)&count) );
161161
args.push_back( std::make_pair( lds_size, (void*)NULL) );
162162

163-
openCLExecuteKernel(cxt, &imgproc_gfft, kernelname, globalThreads, localThreads, args, -1, -1);
163+
openCLExecuteKernel(cxt, &imgproc_gftt, kernelname, globalThreads, localThreads, args, -1, -1);
164164

165165
//final
166166
kernelname = "sortCorners_selectionSortFinal";
167167
args.pop_back();
168-
openCLExecuteKernel(cxt, &imgproc_gfft, kernelname, globalThreads, localThreads, args, -1, -1);
168+
openCLExecuteKernel(cxt, &imgproc_gftt, kernelname, globalThreads, localThreads, args, -1, -1);
169169
}
170170
};
171171

@@ -201,7 +201,7 @@ int findCorners_caller(
201201
size_t localThreads[3] = {16, 16, 1};
202202

203203
const char * opt = mask.empty() ? "" : "-D WITH_MASK";
204-
openCLExecuteKernel(cxt, &imgproc_gfft, kernelname, globalThreads, localThreads, args, -1, -1, opt);
204+
openCLExecuteKernel(cxt, &imgproc_gftt, kernelname, globalThreads, localThreads, args, -1, -1, opt);
205205
return std::min(Mat(g_counter).at<int>(0), max_count);
206206
}
207207
}//unnamed namespace

modules/ocl/src/initialization.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,7 @@ namespace cv
319319
char clVersion[256];
320320
for (unsigned i = 0; i < numPlatforms; ++i)
321321
{
322-
323-
cl_uint numsdev;
322+
cl_uint numsdev = 0;
324323
cl_int status = clGetDeviceIDs(platforms[i], devicetype, 0, NULL, &numsdev);
325324
if(status != CL_DEVICE_NOT_FOUND)
326325
openCLVerifyCall(status);

0 commit comments

Comments
 (0)