Ask Your Question

Amin_Abouee's profile - activity

2015-04-29 17:22:33 -0600 commented answer Applying Normalised correlation on two vectors of points

Is it possible to upload one sample data image here!

2015-04-29 17:20:44 -0600 commented question Corresponding 2D points

See the below image:

2015-04-29 17:07:05 -0600 commented question Corresponding 2D points

![Just one hint that might be useful on this problem: connect the points and create a convex hull of your points. For this one, you can mark the points in the first convex hull by the number 1, 2, 3 and ... After that create the second convex hull in the next image and assign the numbers to the each points. So right now the point 1 in the first convex is correspond to the first point in the second image.

2015-04-29 17:00:00 -0600 commented question Corresponding 2D points

How do yo draw or move the points in the second image? generally there are several approaches to find the corresponding points such as the change of intensity, rotation and etc. But here, as can be seen, the all properties of both images are exactly the same except of the position of points. So I think you can not investigate on the approaches such as feature matching or feature tracking. I believe you can use of some geometric properties, for instance the distance between the points or the position of points relative to each other, to find the corresponding points and as I know, you can not find a relative function for this case in opencv.

2015-04-26 14:32:36 -0600 received badge  Teacher (source)
2015-04-26 13:27:11 -0600 commented question move a rect given a new center position to it..

If you are working on the one image or one frame, you can not do that at all. Because when you draw one shape such as line or rect on an image, you change the image data and you do not have a pointer to that shape or object to erase it later (such as QItem in Qt). For solve this problem, I think it's better to clone the frame in each time for drawing your rect in desire location and showing by cv::imshow.

2015-04-26 13:07:55 -0600 commented answer Applying Normalised correlation on two vectors of points

Of course you should obtain 0 as the answer (read the tutorial carefully). But why ? Because eventually in template matching, you wanna search for a small patch inside another image. In fact, the size of the second image should be much bigger than the size of first patch (rect0). But in your code, the size of rect0 and rec1 are exactly the same and consequently two patch matched in upper left corner or (0,0). Increase the size of second image (rect1) to the whole image or a bigger image patch.

2015-04-26 12:51:02 -0600 commented question Error compiling opencv, undefined reference

How did you build your ffmpeg library in your system ? I think this problem come up from one missing dependency library of your ffmpeg. It means you installed the ffmpeg from the source and by using some other dependence libraries, but after that, you changed or updated some dependence libraries such as faac, fdk-aac and x265 and so this problem is raised up. To overcome this problem, I suggest to reinstall the ffmpeg library again.

2015-04-26 12:38:06 -0600 commented question learning opencv

What does the distance between the camera mean? Are you looking for the rotation and translation between the cameras? Could you please explain a little bit more about the problem or situation that you have. For instance, how many camera or how many frames do you have? Do you have the calibration matrix (intrinsic matrix) or not?

2015-04-26 12:12:11 -0600 received badge  Editor (source)
2015-04-26 12:10:47 -0600 answered a question Applying Normalised correlation on two vectors of points

Based on the Template Matching tutorial in opencv doc, After template matching, you need to normalized the result mat between 0 and 1:

cv::normalize( res, res, 0, 1, cv::NORM_MINMAX, -1, cv::Mat() );

After normalization, you need to find the maximum value inside the res matrix. (Because cross correlation try to maximize the product (or cross-correlation) of the two aligned images and so the maximum value inside the res matrix is you answer). For this purpose you can apply cv::minMaxLoc function:

double minVal; double maxVal; Point minLoc; Point maxLoc;
Point matchLoc;
cv::minMaxLoc( res, &minVal, &maxVal, &minLoc, &maxLoc, cv::Mat() );

The maxLoc and maxVal represent the location and the value of best match in the second image (imgJ).

2015-04-26 09:45:55 -0600 answered a question IplImage convertion to Mat

As I know, The imageData is a pointer (char *) to the image raw data in the IplImage structure . You can access to the same location of memory by using these lines of codes:

unsigned char *imagePointer = (unsigned char*) (image.data);

or

char *imagePointer = (char*) (image.data);

where the image is cv::Mat

Consequently the imagePointer[0] is equivalent to IplImage.imagedata[0]