Ask Your Question

ecrespin's profile - activity

2015-01-03 06:26:31 -0600 received badge  Editor (source)
2015-01-03 06:24:58 -0600 asked a question 3D Structure Reconstruction from video feed

Hello , I am working on an C++ OpenCV program to determine the height of the 24 relevant points P of a given structure through what it 'sees' through a camera or image stream. I would appreciate your help on what techniques and methods should I consider and also, what literature you think would be of most value to develop such a solution. Thank you very much for your time and input.

The P points have fxed X,Y coordinates. The height Z varies over time.

I will apply the same technique to other such structures that differ in shape, color, thickness, etc.

In this case the structure is composed of 6 wireframe cubes. The relevant points P are the top four corners of each cube as shown numbered in the following image. The cubes are 2 x 2 x 2 and the X,Y coordinates can be found here. Red is wall side, green is front.

Points P

Following you will find additional images showing the structure at different points in time.

Link to full size images

6 cubes - t1

6 cubes - t2

6 cubes - t3

6 cubes - t4

6 cubes - t5

6 cubes - t6

6 cubes - t7

6 cubes - t8

6 cubes - t9

In order to get a glimpse of how it could work, I modified the OpenCV sample camera_calibrate.cpp. I removed the findChessBoardCorners and process the input with Canny and HoughLinesP calls.

The code change to the camera_calibration.cpp sample instead of the findChessBoardCorners logic the following code is placed instead:

    Canny(view, dst, 34, 3*34);

    vector<Vec4i> lines;

    HoughLinesP(dst, lines, 1 , CV_PI/180 , 59 /*  threshold */ , 24 /* min line length */ , 
                                                4 /* max line gap */ );
    cvtColor(dst, cdst, CV_GRAY2BGR);

    for( size_t i = 0; i < lines.size(); i++ )
            Vec4i l = lines[i];
            line( cdst, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(0,0,255), 1, CV_AA);

    //------------------------------ Show image and check for input commands -------------------
    imshow( probabilistic_name, cdst);

The output looks like this: