Ask Your Question

pheips's profile - activity

2020-11-03 10:52:01 -0600 received badge  Nice Question (source)
2015-04-14 07:25:01 -0600 commented question Visual Vocabulary Tree

Thanks for your response! DBow looks very interesting.

Anyway, if I find some free time, I am going to build it and will then file a PR.

2015-04-14 05:00:12 -0600 asked a question Visual Vocabulary Tree

Hi,

I know, that there is a Bag of Word Mechanism implemented in OpenCV wich can be used with various Matcher to do Image Categorization, but I coudn't find an implementation of the very popular Visual Vocabulary Tree proposed by Nister and Stewenius: http://www-inst.eecs.berkeley.edu/~cs...

It serves as a faster method to build visual vocabularies as well as a faster approach to find matches. It's a combination of hierarchical clustering, bag of words and a scoring mechanism also used for text retrieval.

I wonder, if OpenCV already has implemented it, and I am simply missing it?

Otherwise I think, it would be a great addition to the OpenCV library.

best regards

2014-11-02 08:23:38 -0600 commented question gpu::histEven delivers incorrect number of Pixels

I just checked on my other PC with a GTX280 and it works correctly there. So I guess it has somethind to do with the Graphics card. So I gues something goes wrong on the GPU and I get an incomplete result? Any other suggestion?

2014-11-02 08:10:40 -0600 asked a question gpu::histEven delivers incorrect number of Pixels

Hi,

I am currently exploring the gpu OpenCV algorithms and recognized, that gpu::histEven might be buggy. gpu::histEven delivers the incorrect number of pixels when all bins are summed up, at least for certain images.

The following code delivers 1.536.000 pxls instead of 2.000.000 for an image of size 2000x1000. However if I change the image dimension to 1000x2000 I get the correct number of pixels.

gpu::calcHist works fine by the way. Am I doing something wrong, or is this a bug? I use OpenCV 2.4.9 and Visual Studio 2012 and my graphics card is a NVidia NVS 4200M.

Thanks in advance!

cv::gpu::GpuMat hist;
cv::gpu::GpuMat srcImg(2000,1000,CV_8U,cv::Scalar(127));
cv::gpu::GpuMat srcImg2(1000,2000,CV_8U,cv::Scalar(127));

cv::gpu::histEven(srcImg,hist,256,0,256);
cv::Mat tmp;
hist.download(tmp);
int sum=0;
for(int i=0; i<256;++i)
    sum +=tmp.at<int>(0,i);
std::cout << "Num Pxls GPU histEven 2000x1000: " << sum << std::endl;

cv::gpu::histEven(srcImg2,hist,256,0,256);
hist.download(tmp);
sum=0;
for(int i=0; i<256;++i)
    sum +=tmp.at<int>(0,i);
std::cout << "Num Pxls GPU histEven 1000x2000: " << sum << std::endl;
2014-09-10 06:15:06 -0600 received badge  Famous Question (source)
2014-04-28 00:23:00 -0600 commented answer Codebook algorithm

I just had a quick look at the paper on background substraction and it seems to me their codebooks are defined and built just as for a bag of words but just used in another context. Background substraction can be seen as a classification task on pixels. Deciding for each pixel if it is of class background or foreground. Their features are simply the pixels color values and they build codebooks for each pixel position seperately. They don't use KMeans but some other clustering mechanism, but the idea is the same as for any codebook generation.

2014-04-27 14:42:42 -0600 answered a question Codebook algorithm

First of all, there are several names for codebooks, so maybe you've heard from them in another context: visual vocabularies, bag of visual words, textons... The Wiki site on the bag of words principle is pretty informative I would say. You should check it out: http://en.wikipedia.org/wiki/Bag-of-words_model_in_computer_vision

But the basic idea is rather simple and inspired by text classification tasks. Consider a text classification problem. Typically one would count the number of occurences of certain words to classify a text. E.g. if a text consists of a various number of words like 'price', 'credit card' and so on, one might guess this Mail is some sort of financial text. So depending on the task, some words are counted and some are not, e.g. 'and', 'he' and so on are not helpful to recognize some sort of financial text, while 'price' and 'credit-card' are. Thus the latter words would be part of the Codebook (or vocabulary). Such a codebook is then used to describe an entire text by counting the occurences of every codebook-word in the text, resulting in a so called word frequency histogram.

For an image/object classification task (or even segmentation) this principle is also used, but instead of words we need to obtain so called 'visual words'. This is typcĂ­cally achieved by collecting a lot of feature descriptors from images and clustering them. The resulting cluster centers are then your codebook.

How is a codeword defined? - typically as a cluster center of feature descriptors

How are codebooks computed? - typically with some sort of clustering algorithm (e.g. KMeans)

2014-02-20 22:53:33 -0600 received badge  Good Question (source)
2014-02-08 15:57:01 -0600 commented answer how to derive from algorithm

Nevermind, I didn't mention which version I use anyway.

2014-02-08 14:49:43 -0600 commented answer how to derive from algorithm

I got it to work. Though I had to remove the create ptr part of the macro. Otherwise the compiler would complain that makePtr is not a member of namespace cv.

Is there a way to get this to work too and is it important that this method is defined for an opencv algorithm? I had a look at the macro in the original opencv code (version 2.4.8) and this part is missing there too. So maybe this works only in an older version or the trunk?

Would be interesting to know, if I could encounter sideeffects, when this part is missing. Anyway, thanks a lot!

2014-02-08 10:39:10 -0600 commented answer how to derive from algorithm

Thank you very much. That definitely makes it clearer. I will try it out soon. I have to say I'm not that familiar with Macros, so I might come back for further help ;)

EDIT: And I guess this macro is defined in in precomp.hpp. Am I right? Then the example finally makes sense to me.

2014-02-08 06:06:28 -0600 asked a question how to derive from algorithm

Hi,

I'd like to implement a variety of segmentation algorithms using opencv. Therefore I'd like to use the Algorithm class as a base class to be able to set and get parameters to the segmentation algorithms.

Unfortunately i have a hard time understanding what's necessary to do so and the opencv documentation in that regard is not detailed enough for me to comprehend which steps are necessary.

The documentation I tried to follow is this one http://docs.opencv.org/modules/core/doc/basic_structures.html?highlight=algorithm#Algorithm in the section "Creating Own Algorithm"

Off course I declared Alogirhtm as a BaseClass of MyAlgorithm

class MyAlgorithm: public cv::Algorithm{

private:
    double aMem = 100.0;

public:
    MyAlgorithm() {}
    virtual ~MyAlgorithm() {}
    virtual cv::AlgorithmInfo* info() {}

};

The above code is a summary from step 1-3. But I now have no idea how info() has to be implemented. And there is also mentioned that I schould add an instance of AlgorithmInfo to my class. But there exists no AlgorithmInfo default constructor and i don't know how the existing constructor is meant to be handled. I also had a look at the recommended piece of code frome here:

https://github.com/Itseez/opencv/blob/master/modules/ml/src/ml_init.cpp

but I don't understand how that relates to to the info method. In that piece of code the info method is called from an obj, but there isn't mentioned what the method should look like.

I would really appreciate someone giving me a simple example on how to setup my own algorithm.

Thx in advance!

2013-10-25 18:14:53 -0600 received badge  Notable Question (source)
2013-09-10 00:35:00 -0600 received badge  Popular Question (source)
2013-08-06 05:46:43 -0600 received badge  Nice Question (source)
2013-07-21 01:48:10 -0600 answered a question A question about image size concerning inverted image rows and colums

They aren't inverted. If you have a look at the image size in e.g. the Explorer, they show you the size in width(cols) x height(rows) instead of rows x cols. Have a look at your image. It should be twice as wide as high.

2013-07-13 03:46:43 -0600 commented answer Is stitching module able to stitch images taken from a parallel motion camera ?

I'm not familiar with the OpenCV Stitching method, but slightly different results make sense depending on the implementation. Usually at some point RANSAC may be used to estimate the transformation between two images. In that case the random selection of keypoints lead to different transformations.

2013-07-09 16:16:18 -0600 received badge  Scholar (source)
2013-07-09 13:05:07 -0600 received badge  Supporter (source)
2013-07-08 12:30:51 -0600 commented answer couldnt get first program working...

It seems to me like you added the wrong include directory to your project. Search your OpenCV folder for the necessary hpp files to find the correct path.

2013-07-08 12:16:08 -0600 commented answer WebCam won't open since 2.4.6

My original problem ist different. The cam doesn't block at cv>>frame, but can't even be opened. Nevertheless I tried to rebuild Opencv 2.4.6 yesterday with different options. None of them did fix my problem, but at one point I also got a connection to my camera (the light of my webcam was green), but I then experienced the same problem as you did: grabbing simply blocked anything alse.

I found out, that in my case the reason for a blocking camera was, that I built the OpenCV 2.4.6 with UNICAP. Once I built it without Unicap I got my initial problem again.

So maybe your cam will work fine, if you rebuild your opencv without Unicap (and maybe without TBB, as I heard that this may cause blockings too).

2013-07-07 14:15:29 -0600 received badge  Teacher (source)
2013-07-07 12:02:45 -0600 received badge  Editor (source)
2013-07-07 12:01:05 -0600 answered a question couldnt get first program working...

Your opencv includes are wrong. If you set up VS correctly, they should look like this:

#include <opencv2/core/core.hpp>       
#include <opencv2/highgui/highgui.hpp>

I suggest you have a look at the tutorial on how to set up an opencv application with VisualStudio: http://docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html#windows-visual-studio-how-to

2013-07-07 07:25:15 -0600 asked a question WebCam won't open since 2.4.6

Hi,

I'm using VideoCapture to connect to my webcam in the following manner since OpenCV2.4.4:

cv::VideoCapture vcap;
cv::Mat image;
...
vcap.open(CV_CAP_ANY);
if(vcap.isOpened()){
    while(m_runGrabber){
      vcap >> image;
  }
}
...

and never had any problems. Since version 2.4.6 though, opening my cam fails and isOpened() always returns false. When I downgrade to 2.4.5 it works again. Also loading a video with 2.4.6 works, so the reason seems to be the combination of 2.4.6 and my webcam. I also tried to open the cam with the constructor. cv::VideoCapture vcap(CV_CAP_ANY); There is also no other camera connected, so CV_CAP_ANY should work as it did with version 2.4.5

I'm using Kubuntu 12.04 and Logitech C270 USB HD Webcam. The camera worked by plug & play, so i guess some standard drivers are used. If someone can explain me how, I would check which driver is used ;)

I'm gratefull for any tipps or suggestions.

2013-07-07 07:10:52 -0600 received badge  Necromancer (source)
2013-07-07 07:00:40 -0600 answered a question FeatureDetector with mask input (third parameter)

It was a bug in the OpenCV, that according to the issue tracker should be fixed in 2.4.6. The check if keypoints are in the mask area has wrongly be done with Scale-Space Coordinates of the keypoints.

2013-01-19 16:34:08 -0600 received badge  Student (source)
2013-01-19 12:57:25 -0600 asked a question Question regarding the license

Hi,

I'm sorry for probably asking a rather stupid question, but I'd like be sure if I understand the BSD license correctly and I'm not very familiar with law and licenses. So i would appreciate some information.

When I use OpenCV in my company to program software, am I allowed to sell this piece of software (not the source) to a customer, or am I just allowed to use this software in my company internally?

Thanks in advance