Ask Your Question

mark_vision's profile - activity

2014-02-12 04:48:44 -0500 commented question Fastest conversion from TriclopsImage to cv::Mat

This is interesting. The blue channel thing is just because of my copy/paste haste, the original code was correct. Now i try with your solution. What do you mean with "horribly broken", anyway?

2014-02-11 09:10:40 -0500 asked a question Fastest conversion from TriclopsImage to cv::Mat

Hi there, I'm forced to use the Bumblebee stereo algorithm that use the TriclopsImage and TriclopsImage16 data structures defined by Triclops. I want to convert those structures into a cv::Mat in the fastest way. I've tried with memcpy but it does not work:

Mat srcright(HEIGHT, WIDTH, CV_8UC3);    
for (int i = 0; i < HEIGHT; i++) {
                    memcpy(&srcleft.ptr(i)[0], &[i * rectified_left_color_image.rowinc], WIDTH * sizeof (uchar));
                    memcpy(&srcleft.ptr(i)[1], &[i * rectified_left_color_image.rowinc], WIDTH * sizeof (uchar));
                    memcpy(&srcleft.ptr(i)[2], &[i * rectified_left_color_image.rowinc], WIDTH * sizeof (uchar));

it produces kind of a shrinked image. With the nested for and the point to point assignement with at() is ok but I would prefer a fastest way to do it.

EDIT Now it works, here there's the code:

vector<Mat> channels;

channels.push_back(Mat(HEIGHT, WIDTH, CV_8UC1,;
channels.push_back(Mat(HEIGHT, WIDTH, CV_8UC1,;
channels.push_back(Mat(HEIGHT, WIDTH, CV_8UC1,;

merge(channels, srcleft);
2014-02-05 03:14:47 -0500 received badge  Teacher (source)
2014-02-04 11:22:06 -0500 answered a question Opencv How to find the highest Intensity?

if I understand what are you asking, try the minMaxLoc function

2014-02-04 06:09:36 -0500 received badge  Editor (source)
2014-02-04 06:08:36 -0500 asked a question Oriented Gaussian Kernel

Hi, I have three Mat of the same size: one is my image and the other two are the (u,v) components of a vector field. I would like to apply a Gaussian filter along each vector (e.g. If the gradient for a pixel is (1,0) the Gaussian kernel is computed only horizontally). How can I do that?

Can I compute something like: p = u*Gx + v*Gy, where Gx is the gaussian blur on the x-axis and Gy the gaussian on the y-axis?

The idea is that I have some contours and I want to compute the gaussian blur on the normal of the contour instead of blindly using a circular or elliptical surrounding of pixels for the computation.