1

Possible Duplicate:
Recognize Black patterns appearing on the four corners of the image ios using opencv or some other technique

After surfing long on the net and founding no appropriate answer I am asking question.

There is a image that is captured from the camera, the image is a image of a book page.

Its background is pure white, having text in black and black rectangles on the four side corners of the paper.

I have to detect whether the black rectangles are present in the image or not and if present, I need to process the image in the manner that the image fills the iphone screen as the showing four corners displaying fitted the screen, all other extra portion of the image is cut off.

for making more clear, below is the image which contains the patterns(not rectangle) but actually they will be rectangle.

enter image description here

For more understanding of the question you can refer shotnote app.I need to achieve the same camera feature of theta app. http://itunes.apple.com/us/app/shot-note/id411332997?mt=8 refer first two screenshots.

It might be possible duplicate of some questions but that question does not have any relavent answer.

Please help me in how to use open cv or is there any other technique to achieve this functionality.

I am stuck here.

Thanks in advance!

Community
  • 1
  • 1
Gypsa
  • 11,230
  • 6
  • 44
  • 82
  • honestly think opencv is an overkill for this. You already know what you are looking for. the area and the color. Even a simple color histogram will tell you if there is something there. Depending if the markers will always be or not in the same place is how you will crop the image. or you can make it variable by checking when the continuos mark ends (or starts at the bottom) on both sides to know where to crop. (OpenCV in iOS is NOT optimized at all, so most of the things u can do right now will not be optimal) – Pochi Aug 13 '12 at 08:22
  • @LuisOscar thanks for your answer.OPencv is really killing me. Can you please guide me a little more on color histogram what to do and how to achieve this.Plz – Gypsa Aug 13 '12 at 09:56
  • The concept is very simple but it depends on how you handle your images. you can extract pieces of them to see what they have like sectors for example. But i have never tried it in ios. something like this: http://stackoverflow.com/questions/6990901/histogram-of-image-in-iphone Just think about your images as map of colors and "look" for your keypoints. You can actually do this in opencv using more simple functions but if i recall correctly even the opencv setup for ios was a hassle – Pochi Aug 13 '12 at 10:12
  • If by any chance you can guarantee that those corners are thicker than any objects that would appear as text you can just erode the image and they would be all that is left. – Hammer Aug 13 '12 at 14:57

0 Answers0