build3Dmodel.cpp or alternatives?

asked 2018-05-17 12:41:42 -0500

Glaucous gravatar image

Greeting guys ! I have just started working with opencv, apologize if i am asking some silly question.

After done the camera calibration, I have obtained the distortion coefficient. Then I learnt this 2 formula from mathworks for corrected x and y.

xdistorted = x(1 + k1r2 + k2r4 + k3r6)
ydistorted = y(1 + k1
r2 + k2r4 + k3r6)

I then use the information to try to render the object in 3D space, by changing the original (x, y) coordinate obtained from detected edges in binary image to (corrected x, corrected y)
Given the z=0, my output is not satisfying.

My question is
1. am i doing it wrong, is this even works for rendering object in 3 dimensional?
2. How should I do to get 3D object?
3. Any other method or sample to learn other than ?

I went through,
but I am having problem with the installation feature2d, I don't think I am doing it right, because I got error in this 2 lines at 665 and 666. (i am referring document online now to solve it)

Ptr<featuredetector> detector = FeatureDetector::create(detectorName);
Ptr<descriptorextractor> descriptorExtractor = DescriptorExtractor::create(descriptorExtractorName);

Appreciate any replies.

edit retag flag offensive close merge delete


you're trying to use a opencv clone from 2012 -- terrible idea.

current code is here

berak gravatar imageberak ( 2018-05-17 12:52:57 -0500 )edit

Hi @berak, do you mean the method that i am using? may I know why is it a terrible idea?

Glaucous gravatar imageGlaucous ( 2018-05-17 12:56:02 -0500 )edit

the codebase you're trying with is 6 years old. whatever you're trying to write on top of that-it won'work with more modern versions. (FeatureDetector::create or DescriptorExtractor::create do no more exist in current 3.4.1)

berak gravatar imageberak ( 2018-05-17 12:58:18 -0500 )edit

@berak, oh I realized you were referring to the contrib i was using, but it is the only way to get feature2d and sift... i was desperate :(

Glaucous gravatar imageGlaucous ( 2018-05-17 12:59:03 -0500 )edit

yes, only way.

berak gravatar imageberak ( 2018-05-17 13:01:22 -0500 )edit

@berak, thank you for the information, guess I should totally drop that idea. Is that also means another sample or reference is down ? i cant use build3dmodel to see how things works?

Glaucous gravatar imageGlaucous ( 2018-05-17 13:03:02 -0500 )edit

687 lines of outdated code. who knows ?

berak gravatar imageberak ( 2018-05-17 13:32:39 -0500 )edit

did you read the code ?

Sigh: This program is not complete/will be replaced.

structure from motion is probably, what you wanted.

for small, indoor objects, maybe this is fun, too

berak gravatar imageberak ( 2018-05-18 09:51:06 -0500 )edit