0

I'm new to image processing and hope someone can help/guide me in the right direction.

So I have a picture in black/white and I want to find the corner coordinates of the inner black part of the preprocessed picture. My question is what kind of method/s will yield the most accurate result?

I want something like this (red dots shows the inner corners)

Sagar Patel
  • 864
  • 1
  • 11
  • 22
hfalk
  • 13
  • 1
  • 6
  • which of the many results google throws at you for "opencv corner detection" have you tried and why does it not fulfill your needs? – Piglet Sep 27 '17 at 11:07
  • Mention what you have tried. – Sagar Patel Sep 27 '17 at 11:09
  • 1
    Try the [`cornerHarris()`](http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_features_harris/py_features_harris.html) corner detector. – alkasm Sep 27 '17 at 11:18

3 Answers3

2

go with cv::goodFeaturesToTrack() and play with params until you get your result.

you can refer to this on why choose this and not cornerHarris: goodFeaturesToTrack vs cornerHarris

and also to this SO answer for an example: opencv-using-cvgoodfeaturestotrack-with-c-mat-variable

of course I assume you are using C++, if you are using python it won't change much...

have luck and try to do a search before asking next time

valleymanbs
  • 487
  • 3
  • 14
  • Thanks for a good answer, this worked perfectly! I will try to do a better search next time – hfalk Sep 29 '17 at 10:05
0

I don't know what language you're using which makes it harder to answer this question but the way I did it my last time was by applying openCV's canny edge detection algorithm. This allows you to see the edges on the image. Next find the contours. With those two functions and a little help from your friend Google, you will be able to figure this out. Good luck!

l0ckky
  • 1
  • 1
0

One of the aproaches would be to use just sobel independently in X and Y (in original image). Since you have binary already just find inner edge, which will be easy.

Those edges can be then sampled - take a few points of the edge. And with the help of OpenCV library function cv::fitLine find the line of the edge. Do the same with all the inner edges and compute the intersections. This approach should be fairly accurate since from the fitLine function on you basically compute the corners in sub-pixel accuracy.

Croolman
  • 1,103
  • 13
  • 40