Ask Your Question

szecsit's profile - activity

2019-10-14 04:23:32 -0600 received badge  Popular Question (source)
2017-04-04 09:47:26 -0600 commented answer Freeman chain code in OpenCV 3

It is true that since 3.2.0 findContours() does not modify the source image, but it could still return Freeman chain code as opposed to point lists. Not sure why they have removed the Freeman chain code, perhaps its usage is now limited.

2017-03-30 03:23:19 -0600 commented question Freeman chain code in OpenCV 3

CHAIN_APPROX_SIMPLE does not give directional codes; it gives you characteristic points sufficient to describe elements in the contour. The Freeman code gives directional codes from one point to the next, including all points in the contour. I still use the Freeman code; based on it I have developed a differential chain code and the two together are a good description of the general shape of the contour, that is why I am still using it.

2017-03-30 03:19:16 -0600 commented answer Freeman chain code in OpenCV 3

Yes, the old C API is still working, I was just wondering why it disappeared from version 3. Thanks anyway.

2017-03-29 11:05:42 -0600 asked a question Freeman chain code in OpenCV 3

In OpenCV 1 there used to be an option of cvFindContours (using CV_CHAIN_CODE) to obtain a contour from an image in Freeman chain code. However, I cannot find it in OpenCV 3. Has it been removed as option? I know I could develop my own function to generate Freeman chain code from a contour given as a sequence of points, but I thought there was a ready-made function already available.

2017-03-21 11:54:14 -0600 commented answer calcHist() using vectors

Yes, I had thought you could change any of the parameters to vector format but you have to change ALL of them and use a differrent parameter list (with reduced number of parameters). Anyway, it is sorted now.

2017-03-21 05:17:36 -0600 commented question calcHist() using vectors

I figured it out in the meantime. The vector format does exist and does work, but the parameter list is different. With the vector format I must not provide the number of images (parameter 2 in the 'old' style.

2017-03-20 06:59:55 -0600 asked a question calcHist() using vectors

I am calculating a histogram from a greyscale image using the above code; it is working fine.

cv::Mat imgSrc = cv::imread("Image.jpg", cv::IMREAD_UNCHANGED); cv::Mat histogram; //Array for the histogram int channels[] = {0}; int binNumArray[] = {256}; float intensityRanges[] = { 0, 256 }; const float* ranges[] = { intensityRanges }; cv::calcHist( &imgSrc, 1, channels, cv::noArray(), histogram, 1, binNumArray, ranges, true, false) ;

In the book of Kaehler & Bradski they refer to this as the "old-fashioned C-style arrays" and they say the new style would use STL vector templates, and the arrays of images from which to calculate the histogram are to be given using cv::InputArrayOfArrays. However, if I try to replace for example the channel array by:

std::vector<int> channels {0};

Gives compilation error.So my questions are these: 1. How can I define the arrays of the 'channels', 'binNumArray', 'intensityRanges' using vectors? 2. How can I define the array of input images using cv::InputArrayOfArrays?