I am using opencv to detect shapes, I have to detect a shape like this
this will be a hand drawn picture, and i am using kinect to detect the picture by checking on frames. Now I get 6 points for these kind of pictures, by removing noise, edge detection, finding contours and than approxDP, now I am not able to detect the shape is right faced, left face, down or up. As the points location change for each picture.
So I want to know given two points, how can I check if there is a line segment between the points or not. After getting there two points, I can calculate from remaining points position that where is the shape pointing.
If anyone has better solution, please share.
Assume you have two endpoints, and your line segment have pixel value greater than zero(in the above image you may need to use threshold binary inverted).
Create a mask image by drawing the line with thickness=1 pixel.
Copy the source image to new Mat using above Mask.
Now count non-zero pixel in the resultant Mat,
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.