Ask Your Question

german_iris's profile - activity

2018-10-09 01:43:09 -0500 asked a question Why the optical center stay unchanged when do stereRectify

Why the optical center stay unchanged when do stereRectify I find that the stereo rectify algorithm always keep the opti

2018-09-29 19:27:27 -0500 received badge  Student (source)
2018-07-02 10:01:28 -0500 edited question why the scale factor is fixed in BinaryDescriptor

why the scale factor is fixed in BinaryDescriptor I find that the scale factor in BinaryDescriptor::detect() is fixed to

2018-07-02 10:00:37 -0500 asked a question why the scale factor is fixed in BinaryDescriptor

why the scale factor is fixed in BinaryDescriptor I find that the scale factor in BinaryDescriptor::detect() is fixed to

2017-04-01 08:27:10 -0500 commented question how can I find some information related to contributing opencv_contrib

Actually, I try to implement a face alignment algorithm published on CVPR. I added a CMakeLists.txt under opencv_contrib/modules/<my_module>. I don't know, honestly, how to write CMakeListes.txt for opencv_contrib. I refered to the CMakeLists.txt of other modules. There only have two lines in my CMakeList.txt. The first line is setting of module description and the second line is ocv_define_module(). I don't know what ocv_define_module mean. I didn't find any information about it on the internet. All the search results are about CMake Error.

2017-04-01 01:30:45 -0500 asked a question how can I find some information related to contributing opencv_contrib

Well, I want to implement a new algorithm for opencv_contrib. It is my first time to do such thing and I haven't any idea about this. Neither can't I find any information on such topic on the internet. I just find coding style guide about opencv not opencv_contrib. I try to add my module after existing modules, but I can't find the build result of my module using the following Cmake command:

$ cd <opencv_build_directory>
$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory> 
$ make -j5

So is anyone can help me? Thank you.

2017-03-25 10:41:54 -0500 asked a question OpenCV Code Style

I am reading the source code of OpenCV under the guidance from The OpenCV Coding Style Guide. It says that the implementation is put to opencv/modules/<module_name>/src and interface is added to the header files in opencv/modules/<module_name>/include/opencv2/<module_name>. But I find some .hpp file under the opencv/modules/<module_name>/src folder, such as opencv/modules/imgproc/src/filterengine.hpp. So what kind of .hpp file should be put to this folder?

2017-02-27 06:48:26 -0500 commented answer analysis of the vertical and horizontal histogram

how can that show the intensity differences between successive rows by performing histogram calculation on rows or colums?

2016-06-05 08:09:17 -0500 commented question unable to read image using opencv-2.4.13

Do you get the right filename? plz check it.

2016-06-05 08:04:44 -0500 received badge  Critic (source)
2016-05-27 06:31:38 -0500 commented question Assertion failed i < 0, in calibrateCamera()

how did you solve this problem?

2016-05-17 09:07:39 -0500 received badge  Supporter (source)
2016-05-17 08:58:22 -0500 asked a question how can I find the mathematical principal of the opencv function stereoRectify()

I know how to use the function stereoRectify(), but I also want know that how it works. I know, of course, that I can learn about this by reading the code, beacuse opencv is opensource. but I am not a good code-reader, ok, I admit that I am a poor code-reader. I tried to search this on the internet, but I didn't get any useful infromation. I also can't find any introduction about this in the opencv online documents. so is there anyone could give some information about the mathematical principal of this function? whatever it is, any form is ok( e.g. paper ,blog). thx:)

2016-04-22 03:11:28 -0500 commented question something weird about `findChessboardCorners()`

I changed the variables type to size_t,but still get a very ridiculous result. which p = 4287838401

2016-04-22 03:03:23 -0500 commented question something weird about `findChessboardCorners()`

I initialize boardSize as follow,

int w = 7, h = 9;
boardSize.width = w; boardSize.height = h;

and I set the stop point at the line imagePoints.push_back(pointBuf); which after initializing p

2016-04-21 23:13:20 -0500 asked a question something weird about `findChessboardCorners()`

these days I was re-writing my opencv code on qt framework. the code runs well on the virtual studio 2013, but when I run it on the qt, something weird happened. the code is as follow

cv::Mat view, viewGray;
for(int i = 0; i < nImages; i++)
{
    vector<cv::Point2f> pointBuf;
    int q = pointBuf.size();
    view = cv::imread(fileList.at(i).toStdString(), 1);
    cv::cvtColor(view, viewGray, cv::COLOR_BGR2GRAY);
    bool found = cv::findChessboardCorners(view, boardSize, pointBuf, \
                                           CV_CALIB_CB_ADAPTIVE_THRESH | \
                                           CV_CALIB_CB_FAST_CHECK | \
                                           CV_CALIB_CB_NORMALIZE_IMAGE);
    int p =  pointBuf.size();

    if(found)
    {
        cv::cornerSubPix(viewGray, pointBuf, cv::Size(11, 11), cv::Size(-1, -1), \
                         cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
        imagePoints.push_back(pointBuf);
    }
}

I set two variables p and q to see the size change of pointBuf. which I get q = 0, p = -10728254, but with the findChessboardCorners() return value is true.

my debegger infomation is as follow,

image description

and the image for calibration is as follow,

image description

update: I set the debugger point at imagePoints.push_back(pointBuf); , as you can see in the following picture.

image description

2016-03-31 22:33:48 -0500 commented question can't modify the pixel value

what's kind of your image? I think you should try img.at<uchar>(i,j) not img.at<float>(i,j).

2016-03-31 07:17:55 -0500 commented question can't modify the pixel value

I dont think so. He added another code if ((i >= 0 && i < img.size().width) && (j >= 0 && j < img.size().height)) to keep the pairs(i,j) in the bounds. Can you sure that the img's type is float?

2016-03-29 21:16:39 -0500 commented question can't modify the pixel value

I am very curious about what you say. could you show us your code more.

2016-03-28 23:27:41 -0500 commented question accuracy of *stereoCalibrate()*

I am so sorry I didn't give out some useful informations, now I have updated some codes and images.

2016-03-28 22:32:50 -0500 asked a question accuracy of *stereoCalibrate()*

Hi , I wanna get some advices here to improve the accuracy of stereocalibrate(). I calibrate my cameras very succesfuly , with rms <0.3 , but when I use the same images to do stereocalibrate, I get a very large rms. my result of my experiment is as follow.

image description

so is there someone can give me some tips to improve my stereo calibration's result.

thx ->..<-

Updata: I run stereoCalibrate() using those parameters,

stereoCalibrate(ObjectPoints, imagePointsFirst, imagePointsSec,
    intrMatFirst, distCoeffsFirst, intrMatSec, distCoffesSec,
    imageSize, R, T, E, F, CV_CALIB_FIX_INTRINSIC,
    TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, 1e-6));

and calibrate each camera like this,

calibrateCamera(ObjectPoints, imagePoints, imageSize, intrMat, distCoeffs,
    rvecs, tvecs);

and those are parts of my images used for calibrating.

image description image description

update 2:

I grab the images for calibrating the two cameras at the same time. So dose the images used for stereo calibrations.

2016-03-18 09:49:31 -0500 commented answer what's the coordinate relations between disparity image and the rectified images(the left or right view).

thx. I campared the two images. it seems that you are right.

2016-03-18 09:47:46 -0500 commented answer Camera calibration distorted output

I am so sorry, I don't know any other better solutions yet.

2016-03-17 04:06:54 -0500 answered a question Camera calibration distorted output

this is because your cameras have strong radial distortion.look at this question Undistortion at far edges of image

good luck.

2016-03-16 08:54:23 -0500 asked a question what's the coordinate relations between disparity image and the rectified images(the left or right view).

what's the coordinate relations between disparity image and the rectified images(the left or right view)?

I use the following block-matching functions,and the parametes are as follow.

//computer stereo correspondence using the semi-global 
//block matching algorithm
Ptr<StereoSGBM> sgbm = StereoSGBM::create(0, 16, 3);
int numberOfDisparities = ((imageSize.width / 8) + 15) & -16;
sgbm->setPreFilterCap(63);
int sgbmWinSize = 9;
sgbm->setBlockSize(sgbmWinSize);
int cn = gviewLeft.channels();
sgbm->setP1(8 * cn*sgbmWinSize*sgbmWinSize);
sgbm->setP2(32 * cn*sgbmWinSize*sgbmWinSize);
sgbm->setMinDisparity(0);
sgbm->setNumDisparities(numberOfDisparities);
sgbm->setUniquenessRatio(10);
sgbm->setSpeckleWindowSize(100);
sgbm->setSpeckleRange(32);
sgbm->setDisp12MaxDiff(1);
sgbm->setMode(1);

And I get a diaparity image successfuly image description

And the stereo rectification result is as follow image description

I want to re-construction the 3d surface. But which pixel in the original images corresponds to the disparity values whose coordinates are (x,y)?

to express my question clearly, let me say something more about it. if I get a disparity value whose corrdinates are(x,y)(I uploaded a simple illustration to express this intuitively), how can I find the corresponding pixel in the stereo rectified images(the left or the right).

image description

2016-03-15 23:42:54 -0500 asked a question what's the theoretical foundation of the function stereoRectify()

I ran the function stereoRectify() successfully. Using the parameters obtained from stereoRectify()I obtained following results. image description

and the original left image is as follows image description

It seems that the image was scaled comparing to the original one. I want to know why and how. But I cant find any information on the internet. I have a Chinese book translated from Learning OpenCV, but it dont have detailed explanation on this section.

So what I want know is where there is a detailed explanation?

2016-01-31 12:51:20 -0500 received badge  Teacher (source)
2016-01-31 02:42:25 -0500 received badge  Necromancer (source)
2016-01-30 10:02:13 -0500 received badge  Editor (source)
2016-01-30 09:42:07 -0500 answered a question How to verify the correctness of calibration of a webcam

Well,well,well. I am also a totally new to camera calibration techniques.But I still hope my words can help you.

  1. Learning OpenCV is an older edition ,based on OpenCV 1.0. If you want to use the new OpenCV functions, I think you should follow the online documentions. And you also can find it in ../build/doc/.(but I dont know why, I cant find it in the OpenCV 3.0);
  2. The function calirateCamera() returns a value , called rms(reprojection error) which can tell you your calibration precision. The rms should be between 0.1~1,with best something <0.5.
  3. And there are some calibration samples in ../opencv/sources/samples/cpp,you can try it first when you write your own code.
  4. There are some tips @StevenPuttemans gave me, and I think it may be useful to you.
    • Make sure the dimensions of your calibration pattern are uneven.
    • Make sure you have enough calibration images, using 2 images will never yield a good camera calibration.
    • Be sure to calibrate every single region of your camera range, if not, you will have large deformations towards the non calibrated areas.
2016-01-29 03:38:10 -0500 commented question Kinect one stereo calibration and overlay rgb with depth map

So ,can you sure that the very large stereoRectify() rms was due to the blurry pictures?? I have the same problem. what's more, my problem is even worse. my rms of stereoRectify() is never below 30!!

2016-01-29 01:47:24 -0500 received badge  Enthusiast
2016-01-27 03:09:31 -0500 marked best answer what kind of reason will lead to this kind of stereorectify result

After calibrate my webcams successfully, I want to stereo rectify views from the two webcams captured at the same time.But the result seems not to be very successful. This is the views before stereo rectify:

image description

And this is undistorted result of the left view(without stereo rectify)

image description

And then ,this is my stereo rectify result:

image description

And this is part of my code:

//estimate position and orientation
cout << "estimate position and orientation of the second camera" << endl
    << "relative to the first camera..." << endl;
stereoCalibrate(ObjectPoints, imagePointsFirst, imagePointsSec, intrMatFirst, distCoeffsFirst,
    intrMatSec, distCoffesSec, imageSize, R, T, E, F,  CV_CALIB_FIX_INTRINSIC ,
    TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, 1e-6));

//stereo rectify
cout << "stereo rectify..." << endl;
stereoRectify(intrMatFirst, distCoeffsFirst, intrMatSec, distCoffesSec, imageSize, R, T, RFirst,
    RSec, PFirst, PSec, Q, 0, 1, imageSize, &validRoi[0], &validRoi[1]);

//cature pictures for 3d-reconstruction
cout << "catch the picture for 3d-reconstruction..." << endl;
VideoCapture captureFirst(cameraIdFirst);
VideoCapture captureSec(cameraIdSec);

if ((!captureFirst.isOpened()) || (!captureSec.isOpened()))
{
    cout << "can't open the camera..." << endl;
    return -1;
}

Mat canvas(imageSize.height, imageSize.width * 2, CV_8UC3);
Mat canLeft = canvas(Rect(0, 0, imageSize.width, imageSize.height));
Mat canRight = canvas(Rect(imageSize.width, 0, imageSize.width, imageSize.height));
Mat viewFirst, viewSec;

cout << "push 'c' to catch pictures for 3d-reconstruction" << endl;
namedWindow("canvas", 1);
while (1)
{
    int key = 0;
    captureFirst >> viewFirst;
    captureSec >> viewSec;
    viewFirst.copyTo(canLeft);
    viewSec.copyTo(canRight);
    imshow("canvas", canvas);

    key = 0xff & waitKey(50);

    if (key=='c')
    {
        cout << "catch pictures done..." << endl;
        break;
    }
}

//rectify the catched pictures
Mat rmapFirst[2], rmapSec[2], rviewFirst, rviewSec;
initUndistortRectifyMap(intrMatFirst, distCoeffsFirst, RFirst, PFirst,
    imageSize, CV_16SC2, rmapFirst[0], rmapFirst[1]);
initUndistortRectifyMap(intrMatSec, distCoffesSec, RSec, PSec,
    imageSize, CV_16SC2, rmapSec[0], rmapSec[1]);
remap(viewFirst, rviewFirst, rmapFirst[0], rmapFirst[1], INTER_LINEAR);
remap(viewSec, rviewSec, rmapSec[0], rmapSec[1], INTER_LINEAR);

so what's reason???