Ask Your Question

João M. S. Silva's profile - activity

2020-10-28 05:05:42 -0600 received badge  Student (source)
2018-01-23 01:04:29 -0600 received badge  Famous Question (source)
2017-01-05 07:34:11 -0600 received badge  Notable Question (source)
2016-02-18 07:38:28 -0600 received badge  Popular Question (source)
2014-07-14 02:08:29 -0600 received badge  Teacher (source)
2014-07-11 11:22:12 -0600 received badge  Self-Learner (source)
2014-07-11 08:14:54 -0600 answered a question minAreaRect of vector of vector of points

I worked around it using C++ vector functions:

vector<Point> selected;
for (unsigned int i = 0; i < N; i++) {
  vector<Point> contour = ...
  selected.insert(selected.end(), contour.begin(), contour.end());
}
rotated_rect = minAreaRect(selected);
2014-07-09 09:48:07 -0600 commented question minAreaRect of vector of vector of points

As for contributing, sure, that wouldn't be a problem. It would be but a modest way of thanking this very good and useful library. However, I tried that before but the reason it didn't work out may be outside of the scope of this particular Q&A.

2014-07-09 09:40:11 -0600 commented question minAreaRect of vector of vector of points

I asked because I really didn't know. I was not trying to argue about T, which in fact I was not sure what it could mean (I interpreted it could be "anything" but not a vector).

What caused my doubt is the explicit mention to vectors of vectors: http://docs.opencv.org/modules/core/doc/basic_structures.html?highlight=inputarray#InputArray

Anyway I tried to create a vector or RotatedRect's in the first pass and then get the minAreaRect of that vector but I get a different assertion error: what(): /build/buildd/opencv-2.4.8+dfsg1/modules/imgproc/src/contours.cpp:1913: error: (-215) points.checkVector(2) >= 0 && (points.depth() == CV_32F || points.depth() == CV_32S) in function minAreaRect

Is it possible to compute the RotatedRect of the set of contours using API functions? Thanks.

2014-07-09 04:48:54 -0600 commented question minAreaRect of vector of vector of points

We can: you ran out of arguments so you used a fallacy. That's common.

2014-07-09 04:38:38 -0600 commented question minAreaRect of vector of vector of points

I guess it would make sense. You can take the minAreaRect of a contour as well as of a set of contours, why not? If not, why allow vector&lt;vector&lt;T&gt;&gt;?

2014-07-09 04:33:44 -0600 commented question minAreaRect of vector of vector of points

But the documentation explicitly says InputArray can either be a vector&lt;T&gt; or a vector&lt;vector&lt;T&gt;&gt;, among others.

2014-07-09 04:26:49 -0600 asked a question minAreaRect of vector of vector of points

From the documentation, minAreaRect takes an InputArray and an InputArray can be a std::vector<std::vector<T>>.

However I'm getting an assertion error when calling minAreaRect with vector<vector<Point>>:

  what():  /build/buildd/opencv-2.4.8+dfsg1/modules/core/src/matrix.cpp:977: error: (-215) 0 <= i && i < (int)vv.size() in function getMat

Isn't Point a "T"?

2014-06-19 06:10:23 -0600 received badge  Scholar (source)
2014-06-13 20:58:05 -0600 asked a question cannot build documentation

Hi,

I followed the steps in How to contribute but I'm not being able to build the documentation.

I tried:

sphinx-build opencv/doc/ tmp

but:

writing output... [ 0%] index
Exception occurred:
File "/usr/local/lib/python2.7/dist-packages/Sphinx-1.2.2-py2.7.egg/sphinx/environment.py", line 1093, in get_doctree
f = open(doctree_filename, 'rb')
IOError: [Errno 2] No such file or directory: u'/home/jmss/tmp/.doctrees/index.doctree'

I also tried cmake, make, make install but in the installation directory there are no HTML or PDF files.

How can I generate the HTML or PDF for testing the changes I made to modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst?

Thanks.

2014-04-17 13:52:10 -0600 commented question RGB vs. BGR

Anyone?

Any definitive references about the "eternal" RGB vs BGR?

2014-04-10 10:56:50 -0600 asked a question cvtColor vs. manual conversion time

Why is cvtColort ~10 times faster than:

float coeffs[3];
coeffs[0] = 0;
coeffs[1] = 1;
coeffs[2] = 0;

gray = Mat(color.rows, color.cols, CV_8UC1);

for (int i = 0; i < color.rows; i++) {
    for (int j = 0; j < color.cols; j++) {
        gray.at<uchar>(i, j) = 0;
        for (int k = 0; k < 3; k++) {
            gray.at<uchar>(i, j) += coeffs[k] * color.at<Vec3b>(i, j)[k];
        }
    }
}

I tried changing row/col for order but it does not change the time.

2014-04-08 22:09:28 -0600 received badge  Editor (source)
2014-04-08 21:38:35 -0600 asked a question RGB vs. BGR

If I capture a frame and then write it to JPG, like this:

VideoCapture capture = VideoCapture(0); capture.read(frame); imwrite("frame.jpg", frame);

ImageMagick's identify says frame.jpg is Colorspace: sRGB.

I made this experiment because I read that OpenCV's default is BGR, not RGB. But it seems to produce RGB JPG files.

Can I use CV_RGB2GRAY in cvtColor always and be safe? Is RGB OpenCV's default?

2014-01-19 20:25:11 -0600 received badge  Supporter (source)