Ask Your Question

_dit's profile - activity

2012-11-09 03:39:12 -0600 commented answer cv::undistort returns corrupt image

hi thx for your reply! image_RGB is just a struct with "uchar * data" R-channel (640x480) then G-channel (640x480) and then B-channel (640x480).

2012-11-07 11:57:08 -0600 asked a question cv::undistort returns corrupt image

Hi

original image:

image description

image after undistort: image description

my code:

double * matrix_rgb = new double[9];
matrix_rgb[0] = fx_rgb;     matrix_rgb[1] = 0;          matrix_rgb[2] = cx_rgb;
matrix_rgb[3] = 0;          matrix_rgb[4] = fy_rgb;     matrix_rgb[5] = cy_rgb;
matrix_rgb[6] = 0;          matrix_rgb[7] = 0;          matrix_rgb[8] = 1;

double * vector_distorsion_rgb = new double[5];
vector_distorsion_rgb[0] = k1_rgb;
vector_distorsion_rgb[1] = k2_rgb;
vector_distorsion_rgb[2] = p1_rgb;
vector_distorsion_rgb[3] = p2_rgb;
vector_distorsion_rgb[4] = k3_rgb;

mCameraMatrixRGB     = new cv::Mat(3, 3, CV_64FC1, matrix_rgb);
mDistortionCoeffsRGB = new cv::Mat(1, 5, CV_64FC1, vector_distorsion_rgb);
cv::Mat srcMat_rgb(cv::Size(image_RGB->dimX, image_RGB->dimY), CV_8UC3, image_RGB->data, cv::Mat::AUTO_STEP);
cv::Mat undistorted;

cv::undistort(srcMat_rgb, undistorted, *mCameraMatrixRGB, *mDistortionCoeffsRGB);

for(int i = 0; i <image_RGB->dimX*image_RGB->dimY*image_RGB->planes; i++){
    ((uchar*)image_RGB->data)[i] = undistorted.data[i];
}

i hope some one can tell me what im doing wrong :(

2012-10-24 11:06:11 -0600 asked a question 6-Channel image and 3D Reconstruction and visualization

Hi!

how can i visualize an 6-Channel Image [X Y Z R G B] (as double *). Is there any openCV function to do it?

I would like to get it like this Kinect color-depth cameras calibration

2012-10-16 10:18:43 -0600 received badge  Scholar (source)
2012-10-16 03:52:58 -0600 received badge  Supporter (source)
2012-10-12 05:27:45 -0600 received badge  Student (source)
2012-10-12 05:24:10 -0600 asked a question Calculate Translation-Rotation Matrix for RGBD-Kinect data

Hi i captured with Kinect a box on the table. I colored the edge so i can project a binarized rgb image into a depth image. (see images below) As you can see there rgb and depth image are not equal.

Question: i want to select 4 corners on rgb image and 4 corners on depth image. is there any opencv function to calculate Translation/Rotation Matrix by using these informations?

thx

Kinect-RGB

image description

Kinect-Depth

image description