How to resize image size (use opencv resize function) -


enter image description here

this original image.

for example, original image size 1280x720. red rectangle size 30x5. if know rectangle vertex coordinates.

i want resize rectangle area 5x1 using opencv resize function. so, how it?

you said know coordinates of red rectangle. so, create (region of interest) roi using rect(). and, resize size using resize() of opencv.

mat original_image; ---- ---- ---- rect region_of_interest(x, y, w, h); mat image_roi = image(region_of_interest);  size size(5,1);   //the dst image size,e.g.5 x 1 mat dst;          //dstimage resize(image_roi ,dst,size);  //resize image 

Comments