Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detection of sharp corners in design patterns #42

Open
mawc2019 opened this issue Feb 14, 2023 · 0 comments
Open

Detection of sharp corners in design patterns #42

mawc2019 opened this issue Feb 14, 2023 · 0 comments

Comments

@mawc2019
Copy link
Collaborator

If a design pattern contains a sharp corner that is not on the boundary, the minimum length scale should be zero or the size of one pixel.
However, as we know, our algorithm for estimating minimum length scales often gives results that are much larger than the size of one pixel. This issue can be partially resolved through the Harris corner detector. In the function cornerHarris in OpenCV, let us set the arguments as blockSize = 3, ksize = 3, and k=0.04. The maxima of cornerHarris for a series of wedges are as follows.

Resolution = 100:
image

Resolution = 10:
image

The relation between the maximum and the angle is as follows. If the threshold is 1e-11, above which indicates a sharp corner, more than half of the cases here would be correctly indicated.
image

The maxima of cornerHarris for a series of rounded squares are as follows.

Resolution = 100:
image

Resolution = 10:
image

The relation between the maximum and the angle is as follows. If the threshold is 1e-11, above which indicates a sharp corner, most of the cases here would be correctly indicated.
image

In summary, given the arguments blockSize = 3, ksize = 3, and k=0.04, when the function cornerHarris is applied to a binary design pattern and its maximum is higher than the threshold 1e-11, at least one sharp corners probably exists and the corresponding minimum length scale should be zero or the size of one pixel (which is more proper?). We could add this function to our code and maybe let users decide whether to invoke it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant