Ask Your Question
0

Access one part of the image

asked 2014-09-23 05:46:04 -0600

Ardui gravatar image

Hi, I'm working on Optical flow LK method and balance strategy using Optical flow. For now I found out the vector length using

float fVmag = sqrt((float)((points[0][i].x-points[1][i].x)*(points[0][i].x-points[1][i].x)+(points[0][i].y-points[1][i].y)*(points[0][i].y-points[0][i].y)));

now I want to access only the vector length that are presented on the left side of the image. I was thinking to use image.cols/2 to split it into two equal parts. But I dont know how to access the data inside that region.

Any help or suggestion will be grateful. Thanks guys.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-09-23 08:15:10 -0600

To copy on half of the image, you could do it like that:

  img.cols(0,img.cols/2).copyTo(anotherImage)
edit flag offensive delete link more

Comments

Thanks for your reply. I'll try it now. so do you suggest copy the left section of image and calculate the vector length present in that region separately??

Ardui gravatar imageArdui ( 2014-09-23 08:40:13 -0600 )edit

Question Tools

Stats

Asked: 2014-09-23 05:46:04 -0600

Seen: 148 times

Last updated: Sep 23 '14