I have an image with a equilateral triangle and a rectangle:
And I want to detect 3 corner of the triangle only. I follow the OpenCV Harris corner detector tutorial I see that all the corner-point of the triangle have the threshold = 80 (when all the 4 corner-point of the rectangle threshold = 255). But I did not find the link between threshold and degree.
How can I find the corner that in the range of [55,65] degree, for example?
Here is the output Mat http://pastebin.com/raw.php?i=qNidEAG0
P/s: I very new to CV, hope you can give some more detail!
Moravec corner detection algorithmThe similarity is measured by taking the sum of squared differences (SSD) between the corresponding pixels of two patches. A lower number indicates more similarity. If the pixel is in a region of uniform intensity, then the nearby patches will look similar.
The Harris corner detector works by taking horizontal and vertical derivatives of the image and looking for areas where both are high, this is quantified by the Harris corner descriptor which is defined in our case as the matrix �and the descriptor is .
Compared to the previous one, Harris' corner detector takes the differential of the corner score into account with reference to direction directly, instead of using shifting patches for every 45 degree angles, and has been proved to be more accurate in distinguishing between edges and corners.
detection method that achieves robust detection for digital objects containing wide angles and various curves using curvature. The boundary of an object is first represented into curvature measured by K-cosine.
It seems that I found possible solution. I've implemented it on Mathematica and able to explain basic steps.
Find contours (cv::FindContours).
For each corner in each contour draw a circle and find point of intersection between circle and contour. There is no ready function for it in OpenCV and you should implement it yourself.
Now for each corner you have coordinates of three points: corner, and two points on sides of contour. It is enough to evaluate angles using dot product:
Result:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With