Ask Your Question

aledalgrande's profile - activity

2017-05-11 02:16:17 -0600 received badge  Teacher (source)
2015-02-10 10:21:29 -0600 commented question How to detect people contours

PS: don't have access to ResearchGate, but by a quick look at the abstract I was wondering if it was something to spend my time on. You guys confirmed it's not.

2015-02-10 10:18:37 -0600 commented question How to detect people contours

Thanks for the comments. It seemed too easy to be truly usable in a real case...

2015-02-10 02:20:40 -0600 asked a question How to detect people contours

The guys here detected the contour of people. They say they used OpenCV, but the link to the source code is broken.

image description

I think it could be an intersection of HOG people detection and Canny. Do you have any other idea on how they could make this with OpenCV?

2014-11-10 02:30:31 -0600 asked a question How to use UPNP

I downloaded the 3.0 alpha, but I had a lot of link errors (e.g. couldn't find cv::rectangle) and I also couldn't find how to use UPNP, which I can see on master in Github.

Is there any guide for the transition?

2014-10-22 21:46:01 -0600 commented answer Mat per-element operation: vector-matrix multiplication

That is called the Kronecker product and it's not supported by OpenCV, so you have to write your own.

2014-08-14 01:11:28 -0600 received badge  Citizen Patrol (source)
2014-07-20 20:51:24 -0600 asked a question High triangulation error

I have implemented a 2D->3D point triangulation method, which uses 2 poses P1 and P2 and 2 points back-projected to z=1 point1 and point2 to recover depth:

Matx14d A1 = point1(0) * P1.row(2) - P1.row(0),
        A2 = point1(1) * P1.row(2) - P1.row(1),
        A3 = point2(0) * P2.row(2) - P2.row(0),
        A4 = point2(1) * P2.row(2) - P2.row(1);
double normA1 = norm(A1), normA2 = norm(A2), normA3 = norm(A3), normA4 = norm(A4);
Matx44d A(A1(0)/normA1, A1(1)/normA1, A1(2)/normA1, A1(3)/normA1,
          A2(0)/normA2, A2(1)/normA2, A2(2)/normA2, A2(3)/normA2,
          A3(0)/normA3, A3(1)/normA3, A3(2)/normA3, A3(3)/normA3,
          A4(0)/normA4, A4(1)/normA4, A4(2)/normA4, A4(3)/normA4);

SVD svd(A, SVD::MODIFY_A);
Mat_<double> svdVT = svd.vt;
Mat smallest = svdVT.row(3);
double scale = smallest.at<double>(0,3);

if (scale == 0.0)
    scale = 0.00001;

Point3d point3D(smallest.at<double>(0,0)/scale, smallest.at<double>(0,1)/scale, smallest.at<double>(0,2)/scale);

This is based on the book Multiple View Geometry in Computer Vision. However, this doesn't seem to provide the right results visually and in fact, when I calculate the difference between the projected 3D point and the original image point coordinates, there is an error of >100px.

What is the problem? Even with synthetic values and transformations I can't get a good enough triangulation.

2014-07-17 16:31:15 -0600 received badge  Scholar (source)
2014-07-17 16:30:26 -0600 answered a question Why is this triggering EXC_BAD_ACCESS?

The error was in how I passed the value to position, which is a Point2f type. In this case it was a memory leak, but in XCode it would show as a Point2f variable with empty values for x and y, not as a null value. That's what was confusing.

Always check for a valid value, in this case when a Point2f variable is initialized, it is set to Point2f(0,0) by the constructor.

2014-07-17 15:59:27 -0600 commented question Why is this triggering EXC_BAD_ACCESS?

I solved it, had a stupid variable shadowing in an upper for loop that was passing a null reference for the position in this method, so it would "seem" valid to the compiler, but at runtime it would crash. No worries, everybody has a bad day, but keep contributing to the OpenCV community!

2014-07-17 15:45:27 -0600 commented question Why is this triggering EXC_BAD_ACCESS?

PS: I was using the hashtags because they come up first in the auto-complete

2014-07-17 15:45:01 -0600 received badge  Organizer (source)
2014-07-17 15:36:45 -0600 commented question Why is this triggering EXC_BAD_ACCESS?

Added the beginning of the method as well.

2014-07-17 15:34:42 -0600 commented question Why is this triggering EXC_BAD_ACCESS?

Ah that is Objective C. It's just a check to see if position is inside the image.

2014-07-17 15:17:28 -0600 asked a question Why is this triggering EXC_BAD_ACCESS?

Sometimes this code triggers a critical error. I tried to put every condition I could think of to prevent bad input, but it's still not working sometimes.

- (Vec3f)extractColorWithKeyframe:(Keyframe*)keyframe WithPosition:(Point2f)position
{
    Mat image = keyframe.originalImage;
    if (image.rows < 1 || image.cols < 1 || ![keyframe.camera isInFrame:position withBoundary:0] || image.channels() < 4)
        return Vec3f(0,0,0);

    Vec4b bgra;
    bgra = image.at<Vec4b>(position.x, position.y);

Any clue?

2014-07-14 06:16:19 -0600 received badge  Necromancer (source)
2014-07-14 04:32:06 -0600 received badge  Student (source)
2014-07-11 22:49:10 -0600 received badge  Critic (source)
2014-07-11 22:48:59 -0600 answered a question How to get sensor physical size (openCV)?

You cannot get the physical sensor size, you have to look it up on the manufacturer's website.

2014-07-11 15:53:19 -0600 asked a question Is there any "nightly" build of the iOS framework?

I would love to use some functionalities of 3.0.0 on iOS, but it's not out yet, so is there any compiled version of the iOS framework I can use? Last time I tried to build it I threw away days of work, unsuccessfully.

Thanks

2014-05-18 18:15:32 -0600 commented answer How to enable findEssentialMat in opencv 2.4.9?

You also have to use OpenCV >= 3.0.0

2014-04-26 20:33:43 -0600 commented answer [URGENT]Is there any deblurring function in OPENCV-ANDROID?

You can actually deblur if it comes from video, search for "blind deconvolution". There are some Matlab implementations around.

2014-03-12 17:07:36 -0600 asked a question OpenCV Error: Assertion failed when trying to find fundamental matrix from two loaded images

I'm trying to write some code to estimate the fundamental matrix:

img1 = cv2.imread('glassL.jpg')
img2 = cv2.imread('glassR.jpg')
K = calibration['cameraMatrix']
F = cv2.findFundamentalMat(img1, img2, cv2.FM_RANSAC, 0.1, 0.99)

Getting the error:

OpenCV Error: Assertion failed (npoints >= 0 && points2.checkVector(2) == npoints && points1.type() == points2.type()) in findFundamentalMat, file /tmp/opencv-XbIS/opencv-2.4.8.2/modules/calib3d/src/fundam.cpp, line 1103
Traceback (most recent call last):
  File "sfm.py", line 27, in <module>
    F = cv2.findFundamentalMat(img1, img2, cv2.FM_RANSAC, 0.1, 0.99)
cv2.error: /tmp/opencv-XbIS/opencv-2.4.8.2/modules/calib3d/src/fundam.cpp:1103: error: (-215) npoints >= 0 && points2.checkVector(2) == npoints && points1.type() == points2.type() in function findFundamentalMat

Any clue?

2014-03-12 02:26:52 -0600 asked a question How to use stereoRectify in Python

If I have cameraMatrix and distCoeffs from plain calibration (1 camera) how can I use stereoRectify to prepare some images for reprojectImageTo3D? It seems rotation and translation matrices are needed, but I don't have those in my calibration output...

2014-03-11 02:36:05 -0600 received badge  Editor (source)
2014-03-11 02:35:42 -0600 asked a question Ruby binding not loading

Whenever I try to run OpenCV code in Ruby bindings I get this error:

/usr/local/var/rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/usr/local/var/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/ruby-opencv-0.0.12/opencv.bundle, 9): Library not loaded: /usr/local/opt/opencv/lib/libopencv_nonfree.2.4.8.dylib (LoadError)
  Referenced from: /usr/local/var/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/ruby-opencv-0.0.12/opencv.bundle
  Reason: image not found - /usr/local/var/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/ruby-opencv-0.0.12/opencv.bundle

I installed OpenCV today from Homebrew (2.4.8.2), and the gem is ruby-opencv "0.0.12".

Do you have any clue? My C++ skills are very rusty ;)

2013-12-28 03:08:11 -0600 asked a question Stereo matching with one camera

I'm looking into stereo matching to build a point cloud from two photos.

Will it work correctly if the images come from the same camera, that has just been moved/rotated? Will I pass the same calibration parameters to stereoRectify (will I need to use that function)?

Thanks

2013-12-22 15:03:26 -0600 received badge  Supporter (source)