Ask Your Question

thevidyy's profile - activity

2017-09-05 08:33:50 -0600 received badge  Popular Question (source)
2017-06-01 09:01:23 -0600 received badge  Notable Question (source)
2016-08-01 05:33:59 -0600 received badge  Popular Question (source)
2013-11-05 16:47:27 -0600 asked a question cvFindStereoCorrespondenceGC(), disparityLeft / disparityRight

I'm using the graph-cuts cvFindStereoCorrespondenceGC() function:

void cvFindStereoCorrespondenceGC(const CvArr *left, const CvArr *right, CvArr *disparityLeft, CvArr *disparityRight, CvStereoGCState *state, int useDisparityGuess = 0).

My question is: what is the disparityLeft and disparityRight maps that I am supposed to get?

Shouldn't there only be one disparity map like what cvFindStereoCorrespondenceBM() gives you?

cvFindStereoCorrespondenceBM(const CvArr *left, const CvArr *right, CvArr *disparity, CvStereoBMState *state)

2013-11-02 20:29:30 -0600 commented question cvFindStereoCorrespondenceGC (graph cuts)

Ah, thanks. I don't know too much of the theory, but it's more accurate albeit slower.

2013-11-02 09:35:41 -0600 asked a question cvFindStereoCorrespondenceGC (graph cuts)

I'm trying to use the cvFindStereoCorrespondenceGC() function on opencv for the implementation of the graph cuts algorithm to find more accurate disparities than when using BM. I don't have this function for some reason; did they get rid of it in opencv 2.4.5? How else can I implement graph cuts? Thanks.

2013-10-07 13:40:02 -0600 asked a question Disparity maps with BMState

I have a pair of close to rectified images that I want to produce a disparity map out of. However, I am not getting good results (cvFindStereoCorrespondence matching very few points, black disparity map, etc.) Anyone know why this might be?

Does the cvFindStereoCorrespondence function strictly work only for 100% completely rectified images? (Because of noise in the images and the calibration process I have done, I am not able to get completely rectified images.)

What are the optimal parameters for CvStereoBMState that I can use to get the best results? (Speed isn't an issue.)

2013-09-17 20:27:49 -0600 commented answer Having trouble with stereoRectify

It might not be the poses that's the problem here... OpenCV is giving the error that "the formats of input arguments do not match in unknown function," which is weird because all of my matrices M, D, R, and T have the data type CV_32FC1. Do you know what's going on here? I'm not too familiar with the data types on opencv.

Also, it's calling stereoRectify an unknown function. Is it possible that I'm just missing the function?

2013-09-17 18:46:20 -0600 commented answer Having trouble with stereoRectify

How did you figure that the rotations were too large by just looking at it? Just to clarify, the inputs R and T are the rotations and translations between the two stereo camera reference frames, right? The rotations and translations outputted by Bouguet's toolbox were with respect to the camera reference frame, I assumed, so using these parameters, I derived R and T between the two stereo camera frames (which might be the source of error).

Here is what I derived:

R = (Rc_2)(Rc_1^T)

T = Tc_1 - (R^T)(Tc_2),

where Rc, Tc are the rotations and translations of the camera with respect to the scene.

The rectification function in the toolbox could not run - it kept running out of memory since my images were too large, hence the reason I'm trying to do the rectification on opencv.

2013-09-17 06:55:30 -0600 received badge  Student (source)
2013-09-16 18:46:37 -0600 asked a question Having trouble with stereoRectify

I ran Bouguet's calibration toolbox (http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/example.html) on Matlab and have the parameters from the calibration (intrinsic [focal lengths and principal point offsets] and extrinsic [rotation and translations of the checkerboard with respect to the camera]). Feature coordinate points of the checkerboard on my images are also known. I want to obtain rectified images so that I can make a disparity map (for which I have the code for) from each pair of rectified images.

Here is my code that keeps breaking off at the stereoRectify function, saying that there was an "unhandled exception": https://gist.github.com/anonymous/6586653

It might be worthy to note that I did not use stereo cameras. It was just one camera, and images were taken with the camera moving relative to the scene. Is stereoRectify still applicable here?

2013-09-04 18:32:20 -0600 asked a question cout'ing a Mat

I'm going through the opencv documentation and the example code:

Mat M(2,2, CV_8UC3, Scalar(0,0,255));

cout << "M = " << endl << " " << M << endl << endl;

fails to run because of cout. How can I use cout on a Mat so that I can output the entire matrix?

2013-07-30 12:34:58 -0600 commented answer cout'ing a CvPoint2D32f variable

If I use Mat, I won't be able to set the values of the elements in the matrix, i.e. cvSetReal2D(CvArr* arr, int idx0, int idx1, double value). Is there any other way I can set the values of the matrix using the Mat operator?

2013-07-30 11:06:12 -0600 commented answer cout'ing a CvPoint2D32f variable

How can I do the same with a matrix (say, ouputting the identity matrix [1 0 0; 0 1 0; 0 0 1] on the screen.) Using the method above doesn't work:

CvMat* test = cvCreateMat(3,3,CV_32FC1); //empty matrix

cv::Mat2f testx(*test);

cout << testx << endl;

And regarding the C-style API, are you saying I'm better off doing something like: using namespace cv; waitKey(0);

rather than cvWaitKey(0);?

2013-07-30 09:38:32 -0600 commented answer cout'ing a CvPoint2D32f variable

Exactly which part of my code is "C-style'? Sorry, I'm a little new to this.

2013-07-30 02:07:52 -0600 asked a question cvFindChessboardCorners getting all corner locations

I am using cvFindChessboardCorners(...), and the 'CvPoint2D32f* corners' variable is spitting out a point, which is what it's supposed to do. I am trying to store, in a matrix, all of the points that the function extracts. Thanks.

2013-07-30 01:17:37 -0600 received badge  Editor (source)
2013-07-30 01:14:39 -0600 asked a question cout'ing a CvPoint2D32f variable
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
    CvPoint2D32f test = cvPoint2D32f(12,12);
    cout << test << endl;
    system("pause");
}

Anyone know why I can't cout test in my code above? And what's the difference between defining test as above and defining it like CvPoint2D32f test = new CvPoint2D32f[144]? Thanks.