0

So here is a question that is sure to stump some people.

Here is my scenario. I want a user to take a picture of something, in this case it will be just a black rectangle with white circles on it. I don't care about the size of the circles, but I want to know how many circles there are and where they are located in respect to the photo. Then a user will enter the width and height of the photo they just took and I will be able to tell the distance the circles are from each other.

Does anyone have any clue how I could do this?

1 Answers1

1

I don't think you will get a straight forward answer.But below is my approach.

  • Take the image, get its pixel data using CGBitmapContext (reference).
  • Now search in the array, where white pixels are located (white pixels - colorvalue >240/255).
  • Now try to find its white-circle-centre using some algorithm (reference).
  • Store those centers in an array,and later when user gives width ,return widths relatively.
Community
  • 1
  • 1
santhu
  • 4,796
  • 1
  • 21
  • 29