Ask Your Question

JayneDoe's profile - activity

2017-03-16 05:43:30 -0500 received badge  Scholar (source)
2017-03-16 04:52:13 -0500 commented answer upload GpuMat from memory pointer

Will do, thank you! After the upload, the content of M does not matter anymore?

2017-03-16 04:27:22 -0500 asked a question upload GpuMat from memory pointer

I want to upload a camera image to a GpuMat without unnecessary copy operations.

I get the image as a naked char* from the camera API and at the moment convert it to a GpuMat approximately like this:

is_GetImageMem(hCam, (void*)pLast);
tmpI = cvCreateImageHeader(cvSize(iWidth, iHeight), IPL_DEPTH_8U, 1);
tmpI->imageData = pLast;
Mat M = cv::cvarrToMat(tmpI);
GpuMat gM.upload(M);

Is this the "optimal" way to do it without copying data around? The CPU memory gets overwritten by the camera next time around, is this OK after I uploaded it to the GPU?


2016-11-29 08:33:06 -0500 answered a question non-aligned optical axis & effect on Stereo Calibration

Bit late with my answer, but anyway:

StereoCalibrate calculates the transforms necessary to create horizontally or vertically aligned images. If your horizontal setup has a (slight) vertical misalignment, you get rectified images which do not completely overlap vertically: from one image a bit from the top is cut of, from the other a bit from the bottom.

As long as you have enough overlap for your application, the resulting stereo reconstruction should work fine, only with a reduced working volume.

I am actually working with a ZED camera right now, which has a vertical difference of about 10 pixels of 720, and it works OK when calibrated.

2016-09-15 09:13:05 -0500 asked a question Error in stereo_match.cpp example

When I start the stereo match example in 3.1.0, I get an exception:

"OpenCV Error: Bad argument (undeclared position 0 requested) in getByIndex, file /home/usera/opencv-3.1.0/modules/core/src/command_line_parser.cpp line 169"

in my opinion, the reason is the missing definition of the filenames in the CommandLineParser key string. In "stereo_match.cpp", instead of:

cv::CommandLineParser parser(argc, argv,
    "{{help h||}{algorithm||}{max-disparity|0|}{blocksize|0|}{no-display||}{scale|1|}{i||}{e||}{o||}{p||}");

it should read:

cv::CommandLineParser parser(argc, argv,
    "{@image1||} {@image2||} {help h||}{algorithm||}{max-disparity|0|}{blocksize|0|}{no-display||}{scale|1|}{i||}{e||}{o||}{p||}");

Is this correct? Or am I missing something?