Ask Your Question

bpp's profile - activity

2017-10-31 06:03:47 -0500 received badge  Notable Question (source)
2016-09-22 05:05:04 -0500 received badge  Popular Question (source)
2013-12-14 10:27:05 -0500 commented answer how to detect middle circle in IOS OpenCV

If I understood correctly your question, you extract contours from an image and the contours correspond to a warped octagon, and you want to unwarp it. To unwrap you could see this tutorial:

http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/warp_affine/warp_affine.html#warp-affine

I don't know if there is a specific function to fit octagon with a square, maybe you could try to see convex hull:

http://docs.opencv.org/trunk/doc/tutorials/imgproc/shapedescriptors/hull/hull.html

however I think that if you have the sorted vertexes of the octagon you can use three of them to unwrap it.

2013-12-14 09:52:15 -0500 commented answer Stereo calibration baseline in meters

Ok, thank you jensenb.

2013-12-11 18:50:21 -0500 received badge  Nice Answer (source)
2013-12-11 11:45:36 -0500 received badge  Teacher (source)
2013-12-11 11:16:19 -0500 commented answer how to draw rectangles from find countours

Thanks berak, it was wrong. Yes with ^ I meant pow not bitwise xor.

2013-12-11 11:05:55 -0500 commented answer how to detect middle circle in IOS OpenCV

If the square has sides parallel to the borders of the image you could extract a region of interest of the original image, using for example: using namespace cv;

Mat img_orginal; Rect region = rect(x,y,w,h); Mat sub_img(region);

and then use hough_circle to find the circles inside that region. x,y : Coordinates of the top-left corner w,h : Rectangle width and height

2013-12-11 10:46:08 -0500 received badge  Critic (source)
2013-12-11 10:36:22 -0500 answered a question Stereo calibration baseline in meters

Is the focal length in the camera matrix in pixels? Since I have 2 camera matrices obviously with different intrinsic parameters what camera matrix can I use as reference the first one or the second one?

2013-12-11 08:52:23 -0500 commented answer Stereo calibration baseline in meters

My next step will be to synchronize in hardware the two cameras so the stereo system will works with non static scene.

2013-12-11 08:44:53 -0500 commented answer Stereo calibration baseline in meters

Perfect, now I understand that I should multiply that value for 2.4 cm, that is the size of the chessboard elements. Infact -3.5152250398995970 cm * 2.4 cm= 8.4365401 cm, that seems to be coherent with the ruler's measurement of about 8.5 cm. For clarity this is the code where I specify the object coordinate points:

int numBoards = 30;
int board_w = 9;
int board_h = 6;
Size board_sz = Size(board_w, board_h);
int board_n = board_w*board_h;
vector<vector<Point3f> > object_points;
vector<vector<Point2f> > imagePoints1, imagePoints2;
vector<Point2f> corners1, corners2;
vector<Point3f> obj;
for (int j=0; j<board_n; j++)
{
    obj.push_back(Point3f(j/board_w, j%board_w, 0.0f));
}

Thank you so much for your useful and complete answer.

2013-12-11 08:16:17 -0500 received badge  Scholar (source)
2013-12-11 08:16:07 -0500 received badge  Supporter (source)
2013-12-08 11:54:33 -0500 received badge  Student (source)
2013-12-05 08:16:11 -0500 answered a question Human height estimation using a calibrated camera

If the person to be measured has for example in hand or on the t-shirt a marker of known size it is possible to obtain approximately the height. An other option if you don't move the camera could be to put same marker on the floor at a known distance and say to the people to go with their shoes on those marker. Remember that if you don't know the distance between the camera and the object to be measured there's is an ambiguity problem, passing from 3d world to 2d coordinates you lose distances.

2013-12-05 07:05:12 -0500 asked a question Stereo calibration baseline in meters

Hi, I calibrated my stereo webcam with a chessboard and:

stereoCalibrate(object_points, imagePoints1, imagePoints2, CM1, D1, CM2, D2, img1.size(), R, T, E, F, cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 100, 1e-5), CV_CALIB_SAME_FOCAL_LENGTH | CV_CALIB_ZERO_TANGENT_DIST);

I need to know the baseline of the stereo camera in meters, so I look inside the T matrix. The first element of the T matrix is -1.6952669833501108e+00, the problem is that when I measure physically the distance between sensors with a ruler is approximately 4 cm, that is 0.04 m, what is the metrics of the elements in the T matrix? Therefore, I don't know the physical size of the pixels, because I don't know the sensor used.

%YAML:1.0
CM1: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 6.7035296112450442e+02, 0., 3.0366775716427702e+02, 0.,
       6.7334702239218382e+02, 2.3446212435423504e+02, 0., 0., 1. ]
CM2: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 6.7035296112450442e+02, 0., 3.0235229497623436e+02, 0.,
       6.7334702239218382e+02, 2.3428252297251004e+02, 0., 0., 1. ]
D1: !!opencv-matrix
   rows: 1
   cols: 5
   dt: d
   data: [ -2.7243204402554655e-01, 6.7461566940160000e-01, 0., 0.,
       -1.1338340048806972e+00 ]
D2: !!opencv-matrix
   rows: 1
   cols: 5
   dt: d
   data: [ -2.9489669516506523e-01, 8.7704813783022018e-01, 0., 0.,
       -1.7809117056153765e+00 ]
R: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 9.9994998218891662e-01, 1.8032584564876427e-03,
       -9.8377527578461001e-03, -1.7978260373390045e-03,
       9.9999822653927839e-01, 5.6101678905229378e-04,
       9.8387469692470843e-03, -5.4330216016358439e-04,
       9.9995145076190473e-01 ]
T: !!opencv-matrix
   rows: 3
   cols: 1
   dt: d
   data: [ -1.6952669833501108e+00, -8.3183862355057793e-04,
       1.6553031717676806e-02 ]
E: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 2.1575221682576832e-05, -1.6552550421804146e-02,
       -8.4108476712251815e-04, 3.3231506665764049e-02,
       -8.9119281968270958e-04, 1.6950218347962700e+00,
       3.8795921397114311e-03, -1.6952624768406708e+00,
       -9.5925666229836515e-04 ]
F: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 6.5486525518936608e-08, -5.0017984753281888e-05,
       9.9960823121244876e-03, 1.0041793870914565e-04,
       -2.6810044647830857e-06, 3.4036589992213000e+00,
       -1.5652165011118380e-02, -3.4182603874751876e+00,
       9.9999999999999989e-01 ]
R1: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 9.9980525157248468e-01, 2.2991356175347437e-03,
       -1.9600329167972070e-02, -2.2937864080306968e-03,
       9.9999732564029009e-01, 2.9539157402834107e-04,
       1.9600955894930411e-02, -2.5037507834536546e-04,
       9.9980785145963180e-01 ]
R2: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 9.9995221263036305e-01, 4.9065951283155365e-04,
       -9.7637958235422401e-03, -4.9332403320461707e-04,
       9.9999984173287226e-01, -2.7049145825487527e-04,
       9.7636615590471869e-03, 2.7529524731464261e-04,
       9.9995229642492811e-01 ]
P1: !!opencv-matrix
   rows: 3
   cols: 4
   dt: d
   data: [ 6.0327398477959753e+02, 0., 3.0294886016845703e+02, 0., 0.,
       6.0327398477959753e+02, 2.3173668479919434e+02, 0., 0., 0., 1.,
       0. ]
P2: !!opencv-matrix
   rows: 3
   cols: 4
   dt: d
   data: [ 6.0327398477959753e+02, 0., 3.0294886016845703e+02,
       -1.0227593432896966e+03, 0., 6.0327398477959753e+02,
       2.3173668479919434e+02, 0., 0., 0., 1., 0. ]
Q: !!opencv-matrix
   rows: 4
   cols: 4
   dt: d
   data: [ 1., 0., 0., -3.0294886016845703e+02, 0., 1., 0.,
       -2.3173668479919434e+02, 0., 0., 0., 6.0327398477959753e+02, 0.,
       0., 5.8984939980032047e-01, 0. ]

I tried to calibrate another stereo rig with baseline of about 8.5 cm:

image description

in this case the baseline computed is -3.5152250398995970e+00:

T: !!opencv-matrix rows: 3 cols: 1 dt: d data: [ -3.5152250398995970e+00, -3.3355285984050492e-02, -1.1137642414481164e-01 ] how is it possible?

2013-12-05 06:48:33 -0500 received badge  Editor (source)
2013-12-05 06:47:51 -0500 answered a question how to draw rectangles from find countours

Using the coordinates you could compute the area of each rectangle and then threshold on it.

area = (abs(x1-x0) * abs(y1-y0));

if(area>threshold) draw

You should check the index used to compute the width and the height of the rectangle because I'm not sure of the order returned by the function that find rectangles.

2013-12-05 05:07:01 -0500 answered a question Number of pixels changed per frame compared to frame before?

You could use absdiff to find differences between images:

Mat img1, img2, img3; img3 = absdiff(img1,img2);

http://docs.opencv.org/modules/core/doc/operations_on_arrays.html#absdiff

2013-12-05 05:01:57 -0500 answered a question Can't unpack opencv-2.4.7. exe | Win 7 32 x
2013-12-05 04:58:59 -0500 answered a question how to detect middle circle in IOS OpenCV