Ask Your Question

ferretnt's profile - activity

2021-02-12 11:18:03 -0600 received badge  Popular Question (source)
2019-11-07 03:58:10 -0600 received badge  Famous Question (source)
2019-10-15 12:46:19 -0600 edited question 3D object detection and tracking

3D object detection and tracking Hi, Assuming that I have previously implemented a robust natural feature tracker for p

2018-05-31 17:41:22 -0600 received badge  Notable Question (source)
2017-10-22 06:57:03 -0600 received badge  Popular Question (source)
2017-10-16 12:49:20 -0600 received badge  Famous Question (source)
2016-04-08 12:08:11 -0600 commented answer 3D object detection and tracking

Honestly, days were spent googling without hitting that. Sorry.

2016-04-08 12:07:34 -0600 received badge  Scholar (source)
2016-04-05 12:02:38 -0600 asked a question 3D object detection and tracking

Hi,

Assuming that I have previously implemented a robust natural feature tracker for planar objects (i.e. pictures) using keypoint extraction, matching and pose estimation, how do I logically extend this to track 3D obects?

Assume that:

  • Hardware is monocular camera (smartphone, but more likely desktop with attached camera during dev.)
  • I control the lighting environment of the objects (so can limit specular, etc)
  • The object is rigid
  • The object has distinctive texture, and is against a distinctive background.
  • I have digitized 3D models of the objects if required.

Both object detection and pose estimation is required.

There appear to be many tutorials on 2D NFT tracking on the internet, but none explains how to then extend this to matching keypoints against a 3D model.

To be clear, I'm not looking for a prebuilt solution (sure, Vuforia does this.) I'm looking for source-code or algorithmic-level information.

2016-02-19 23:29:15 -0600 received badge  Nice Question (source)
2015-05-07 23:45:18 -0600 asked a question Chamfer Matching Example

I see the chamfer matching example and chamfer class (in samples/cpp/chamfer.cpp) seems to have been removed in opencv 3.0. A quick search shows no modification to chamfer.cpp since June 2011.

Previous versions of this sample had a double-free of memory.

Is there a modern, recommended chamfer matching example, or do I just have to roll my own out of the distance transform (which is not difficult)

2015-03-24 13:25:02 -0600 received badge  Nice Question (source)
2015-01-20 07:38:14 -0600 received badge  Taxonomist
2014-04-07 14:10:43 -0600 asked a question In-place (Scale/rot/trans-penalizing) curve matching score

I'm new to computer vision, although experienced in graphics development in general.

I have a simple application, which I wish to present a stroke (an arbitrary, but probably quite simple 2D curved path) on the screen to the user, and ask the user to replicate it, again with a single stroke. I would like to measure the accuracy with which the user replicates the stroke.

My first attempt at replicating this functionality using cv::matchShapes to compare a vector of the source curve points with a vector of the drawn curve correctly scores shape similarity well, but is actually too robust. I want users to copy the stroke in place, not draw it at an arbitrary position/scale on screen.

To be clear,

  1. Drawing the stroke in either direction should be supported (although presumably this can be added even if the underlying algorithm does not support by testing twice.)
  2. The metric should NOT be invariant to translation, rotation, scale, that is the user must draw the shape in place.
  3. The stroke may or may not be closed. We know in advance whether the template is closed. If the tempate is closed (such as an ellipse) then we would _prefer_ the user to be able to start and end their stroke at any point on the ellipse, but this is not an absolute requirement.

I realize this is the opposite of most computer vision, when you're trying to robustly match arbitrary input. In this case, I want to score correctness of input to a very precise target. Can anybody please suggest a better approach?

Thanks for your time.

2012-11-05 14:19:48 -0600 asked a question Simple colour enhancement for images

A feature of an application I am working on is being able to take pictures of children's artwork (paintings, colourings, etc, typically in relatively bright colours because that's what children use) and display them on the screen.

In normal lighting, the image returned form the camera is almost always dull and lacks colour - this is exacerbated by a combination of the terrible camera in most tablets, and the fact that rooms are often dimly lit. I would like to be able to do some simple colour enhancement on the image to bring it back into about the right level.

To do this, I thought I could just convert the image to HSV space, then run a histogram equalization on each channel seperately, but this doesn't seem to produce good results and makes any near-white areas of the image bloom into colour as their ranges get stretched (presumably, this is because doing so is wrong and I don't know what I'm talking about.)

So I'm currently just converting the image to HSV space, and multiplying S and V by an arbitrary constant of 1.6. This actually produces decent results, but isn't very scientific. Presumably, there must be a basic introduction to the subject of image brightness/colour correction somewhere, but I haven't found a concise one that covers this case. Could somebody please explain?

Thanks, Alex

2012-07-16 11:42:40 -0600 received badge  Notable Question (source)
2012-07-12 17:53:34 -0600 received badge  Supporter (source)
2012-07-12 14:59:14 -0600 received badge  Student (source)
2012-07-12 07:02:42 -0600 received badge  Popular Question (source)
2012-07-11 18:28:57 -0600 received badge  Editor (source)
2012-07-11 15:44:59 -0600 received badge  Autobiographer
2012-07-11 13:30:11 -0600 asked a question Is anyone using P3P or EPNP in solvePnP?

Is anyone using solvePnP with the new solvers (P3P or EPNP?) I would like to explore doing so, primarily as a performance boost, but I get unusable results when doing so.

Specifically, EPNP seems to randomly return orientations that are 90 degrees off (i.e. the x-axis points along where the y-axis should be.) P3P seems to be extremely unstable to inaccuracies in the points (even though I'm passing it heavily refined corners of a known flat square) and returns garbage as a result.

Is anyone else using these algorithms in production code? I saw in the P3P code comments saying that several edge cases were not yet implemented. Are there plans to make these implementations efficient and/or robust, or should I just assume the ITERATIVE method is the only viable solution now.

As a follow-up, assuming that I am interested in performance optimization, is there anything I can do to speed up solving with CV_ITERATIVE? In particular, has anyone replaced OpenCV's LevMarq solver with a solver from a different package (is it possible to use Apple's accelerate framework for example?)

Thanks, Alex

--- Repro case:

Hi Alexander,

What would you like to help solve the problem? I can print out some vectors of coefficients from frames that fail and post them here, or I can describe how to make code to reproduce the issues, which is likely more helpful for you.

My test case for P3P is very easy - download the Aruco library (I just tested using 1.2.4 from here http://www.uco.es/investiga/grupos/ava/node/26), and run the aruco_test sample with a generated fiducial marker. At runtime when the marker is visible on the camera, this will pass 4 points that are refined with reasonable confidence to solvePnP in marker.cpp.

Passing Mat parameters didn't work for me with OpenCV 2.4.1, so I copied them in to std::vectors and pass those instead. i.e, in marker.cpp, so immediately above the call to solvePnP, paste in this

vector<Point2f> imgPointsVector;
vector<Point3f> objPointsVector;
for (int c = 0; c < 4; c++)
{
    Point2f p = Point2f(ImagePoints.at<float>(c,0), ImagePoints.at<float>(c,1));
    imgPointsVector.push_back(p);

    Point3f pObj = Point3f(ObjPoints.at<float>(c, 0), ObjPoints.at<float>(c, 1),ObjPoints.at<float>(c, 2));
    objPointsVector.push_back(pObj);
}

and then update the call to solvePnP as

cv::solvePnP(objPointsVector, imgPointsVector, camMatrix, distCoeff,raux,taux, false, CV_P3P);

I've just tested again, and P3P seems to be significantly less stable than CV_ITERATIVE as the marker is moved around.

Additionally, I generated an aruco board (i.e. many markers on a sheet of paper), and made the same change to the call to solvePnP in boardDetector.cpp. This time, since there are likely many available points, I was hoping to use EPNP, but the results from doing so are disappointing compared to CV_ITERATIVE. (In fact, they appear worse than just using a single maker with P3P.)

If you'd ... (more)