How to find the corners of a Rect object in openCV?

后端 未结 2 2009
萌比男神i
萌比男神i 2020-12-14 11:43

I am using openCV library on the android platform. I have successfully detected the largest rectangle from the image but since my application will be used for the scanning p

2条回答
  •  [愿得一人]
    2020-12-14 12:16

    1. find the coordinate of left ,right, top,bottom point of the rect
    2. min_x = min(left.x right.x,top.x,bottom.x)
       min_y = min(left.y right.y,top.y,bottom.y)
       max_x = max(left.x right.x,top.x,bottom.x)
       max_y = max(left.y right.y,top.y,bottom.y)
    3. the corners's coordinate is the point with the min_x, min_y ,max_x, max_y
    

提交回复
热议问题