Ask Your Question

wl2776's profile - activity

2017-04-26 20:36:28 -0600 received badge  Notable Question (source)
2017-02-22 09:43:41 -0600 received badge  Famous Question (source)
2016-09-18 11:33:52 -0600 received badge  Good Question (source)
2016-06-23 08:12:53 -0600 received badge  Notable Question (source)
2016-02-11 05:10:32 -0600 received badge  Popular Question (source)
2016-01-06 19:32:45 -0600 received badge  Nice Question (source)
2015-12-01 00:44:11 -0600 received badge  Popular Question (source)
2015-04-25 04:43:52 -0600 received badge  Nice Question (source)
2015-04-23 03:43:20 -0600 received badge  Enthusiast
2015-04-21 10:44:26 -0600 commented answer How to find different areas of the two images

I've never used Hu moments in my practice, however, Wikipedia says that they are weighted averages of image pixels. So, for each moment, you supply an image to a function and it returns you a single value, depending on all image pixels. Therefore, probably, they can detect that pictures differ, while you seem to be interested in locations of those differences. Answering this your question - unlikely.

2015-04-21 07:39:20 -0600 answered a question How to find different areas of the two images

I'd suggest warping images to the common coordinate system and then subtract warped results. You could detect 2D feature points with any 2D feature detector, for example, Harris corners, or BRISK, or SIFT, then calculate a homography matrix and then use it to transform one of images to the coordinate system of another.

Also, it would be useful to apply some filtering and morphology to make robust comparisons.

2015-03-06 05:37:03 -0600 received badge  Necromancer (source)
2015-03-06 05:10:37 -0600 answered a question How can solvePnPRansac be used with double values?

Upgrade OpenCV? Version 2.4.10 contains another check in solvePnPRansac

CV_Assert(opoints.depth() == CV_32F || opoints.depth() == CV_64F);

So does the latest git snapshot: https://github.com/Itseez/opencv/blob...

2015-03-06 04:52:33 -0600 answered a question How to build opencv so it statically link to ffmpeg?

You can download FFmpeg binaries from here.

Agree with @StevenPuttemans about licensing.

2014-02-27 03:47:53 -0600 answered a question Do I need to use cmake to configure VS c++

No.

Cmake is to generate build system and compile OpenCV from sources

2014-02-27 03:46:31 -0600 asked a question ocl module in OpenCV 3.0.0 (master)

There is a commit in the master branch, disposing the whole ocl module to trash.

Am I correct in thinking that version 3.0 will have embedded automatically activating support of OpenCL?

2014-02-25 08:38:39 -0600 asked a question stereoSGBM on OpenCL in OpenCV 3.0.0

Hi all! Is it possible to run StereoSGBM disparity estimation on the trunk OpenCV (3.0.0) with OpenCL? I am trying to recover depth from the stereocamera.

I am using OpenCV 3.0.0 from the trunk. Currently my application, running StereoSGBM algorithm, processes one video frame 640x480 for about 1-2 seconds.

Version 2.4.8 of the OpenCV has the separate module OCL, which includes this. It could be concluded that the version 3.0 can automatically turn on OpenCL support. Is it the case?

Here is the relevant part of the buildInformation string:

Version control:               721d014-dirty
Platform:
    Host:                        Windows 6.1 AMD64
    CMake:                       2.8.12.2
    CMake generator:             Visual Studio 12
    CMake build tool:            C:/PROGRA~2/MSBuild/12.0/Bin/MSBuild.exe
    MSVC:                        1800 
Other third-party libraries:
    Use IPP:                     NO
    Use Eigen:                   YES (ver 3.2.0)
    Use TBB:                     YES (ver 4.2 interface 7002)
    Use OpenMP:                  NO
    Use GCD                      NO
    Use Concurrency              NO
    Use C=:                      NO
    Use Cuda:                    NO
    Use OpenCL:                  YES

OpenCL:
    Version:                     dynamic
    Include path:                C:/opencv/master/3rdparty/include/opencl/1.2
    Use AMDFFT:                  NO
    Use AMDBLAS:                 NO
2014-02-24 05:47:03 -0600 commented answer Weird memory leak detected using opencv 2.4.8

Wrong usage of VLD. Include it into your cpp or header file,after stdafx or any other precompiled headers. http://vld.codeplex.com/wikipage?title=Using%20Visual%20Leak%20Detector&referringTitle=Documentation

2014-02-11 06:43:05 -0600 answered a question Weird memory leak detected using opencv 2.4.8

Your includes look strange to me. Try to remove all C includes (starting with opencv/ ).

Also, try using Visual Leak Detector (http://vld.codeplex.com/) to get more sensible information about memory leaks.

2013-07-12 17:11:46 -0600 marked best answer Do prebuilt binaries of the version 2.4.3 for windows use TBB and Eigen?

Hi all. Do prebuilt binaries of the version 2.4.3 for windows use TBB and Eigen?

I've searched for TBB and parallel_for through files. Search for "parallel_for" has revealed several entries.

Search for TBB has brought to me files C:\opencv\build\x64\vc10\bin\opencv_core243.dll and C:\opencv\build\x64\vc10\bin\opencv_core243d.dll

These binary files contain the following text:

....
Use TBB:            NO
Use Eigen:          NO
....

Overall, this part of the hexdump looks like a compiled in CMake configuration. However, I didn't find a function which would print it.

So, 2 questions.

  1. Is the TBB and Eigen support switched on by default?

  2. Is there any function, which can print building parameters?

Thanks

2013-04-30 05:17:38 -0600 asked a question How to reorder matrix columns according to sortIdx() result?

Hi all.

I have two matrices of the same size (1 x ncols, vectors actually) and I need

  • one of them sorted in descending order
  • another one reordered according to the first one.

What is the most optimal method to do that?

cv::sortIdx() function gives me correct ordering, but I cannot figure out, how to use it for this task.

2013-04-12 12:17:50 -0600 received badge  Self-Learner (source)
2013-04-12 02:04:12 -0600 commented answer How to save/load matrix and parameters of several algorithms to a file?

After some experiments, I've found that C++ API can also do this. I've corrected my answer

2013-04-11 07:46:59 -0600 answered a question How to save/load matrix and parameters of several algorithms to a file?

I've found the solution. Old C functions cvStartWriteStruct and cvEndWriteStruct can do the job.

#include <opencv2/core/core_c.h>
...
Mat matrix;
FeatureDetector detector;
DescriptorExtractor extractor;

/* fill matrix, detector and extractor*/

FileStorage fs(file_name, FileStorage::WRITE);
cvStartWriteStruct(*fs, "detector", CV_NODE_MAP);
detector.write(fs);
cvEndWriteStruct(*fs);
fs << "matrix" << matrix;

This produces the following.

<opencv_storage>
<detector>
<name>Feature2D.ORB</name>
<WTA_K>2</WTA_K>
....
<scoreType>0</scoreType></detector>
<matrix type_id="opencv-matrix">
<rows>500</rows>
<cols>64</cols>
<dt>u</dt>
<data>
  1 96 0 0 140 191 127 60 28 0 0 0 72 240 249 79 55 8 32 128 99 28 199
  ...

The reading code then would become

FileNode fn = fs["detector"];
if (!fn.empty()) {
    string name = fn["name"];
    ORB det;
    det.read(fn);
}

UPDATE. C++ API can also do this. Same result can be achieved with

fs << "detector" << "{";
detector.write(fs);
fs << "}";
2013-04-10 10:35:37 -0600 asked a question How to save/load matrix and parameters of several algorithms to a file?

Hi all. I've got a matrix cv::Mat, keypoint detector and descriptor extractor objects. And I want to save all of them to the single file using cv::FileStorage. Is it possible?

I tried

Mat matrix;
FeatureDetector detector;
DescriptorExtractor extractor;

/* fill matrix, detector and extractor*/

FileStorage fs(file_name, FileStorage::WRITE);
fs << "matrix" << matrix;
detector.write(fs);
extractor.write(fs);

This code writes everything to the file.

But the resulting file is invalid, since it contains two pairs of <name> </name> tags, and the code, reading data from disk, throws the exception "Duplicated key".

Here is the example of what I've got

<opencv_storage>
<name>Feature2D.ORB</name>
<WTA_K>2</WTA_K>
....  (other saved ORB parameters are skipped for brevity)
<name>Feature2D.BRISK</name>
<octaves>3</octaves>
<thres>30</thres>
<matrix type_id="opencv-matrix">
   <rows>500</rows>
   <cols>64</cols>
   <dt>u</dt>
   <data>
1 96 0 0 140 191 127 60 28 0 0 0 72 240 249 79 55 8 32 128 99 28 199
48 28 31 12 24 192 128 0 102 24 115 254 255 255 157 113 134 25 34 0
0 0 24 134 96 182 255 255 255 163 64 254 255 219 4 2 0 0 0 96 196 3
...

One possible solution could be wrapping the detector and extractor with custom tags, like

<opencv_storage>
<detector>
<name>Feature2D.ORB</name>
<WTA_K>2</WTA_K>
....
</detector>
<extractor>
<name>Feature2D.BRISK</name>
<octaves>3</octaves>
<thres>30</thres>
</extractor>
... (the rest of file)

Is it possible with FileStorage? I tried

fs << "detector";
detector.write(fs);

However, this code throws the exception "no element was given".

2012-12-13 02:02:39 -0600 commented question problem with reading image to Mat

I don't have OpenCV libraries in PATH. Instead I add needed path in the project settings (Debugging -> Environment), and have menu items in Far Manager, which add needed path to the current session.

What for your case, the DLL name immediately suggests that we have DLL hell curse. Numbers 90 in the name define MSVC version (9.0 is Visual Studio 2008, 10.0 is VS 2010). I recommend you to carefully inspect your PATH variable and clean everything unneeded.

That's a pity that there is no such thing as modules (http://modules.sourceforge.net) in windows.

2012-11-30 05:23:02 -0600 answered a question Strange Assert in setTo

Looks like a bug. Report, of course.

According to reference manual (opencv2refman.pdf, page 35), values like CV_8U or CV_8S, or CV_16U, etc, are returned from Mat::depth().

Mat::type() returns a constant, having number of channels, like CV_8UC3

2012-11-30 00:43:18 -0600 marked best answer EM algorithm, change nclusters property doesn't cause isTrained() to return false.

Suppose I create EM object, train it and then change its "nclusters" property. In my understanding, this should reset it to the untrained state, since the sizes of means and covs do not longer correspond to the number of clusters.

However, isTrained() returns true.

Is is a bug or feature?

2012-11-30 00:43:18 -0600 received badge  Self-Learner (source)
2012-11-30 00:37:34 -0600 received badge  Organizer (source)
2012-11-30 00:29:39 -0600 answered a question EM algorithm, change nclusters property doesn't cause isTrained() to return false.

Yes, this looks like a bug. isTrained is implemented as

return !means.empty();

So, the application should itself keep track on what is trained and what is not.

Also, cv::Algorithm's implementation of property storage lists and getters/setters doesn't have any means for object invalidation. The AlgorithmInfo::set() methods simply change values, but do not track the object logical consistency.