6

I am looking something like attached image, How can I implement this in iPhoneSDK.

Can anybody suggest me some open source API or Algorithm Code to detect the corners of captured image of a document.

Some How, I got an open source API called OpenCV which recognize the Human Face very well. I want to use the same API if possible.Now the problem Is how can I make the changes in those static libraries according to my requirement to Scan the Document edges. Alternatively,

how to detect for the square/rectangle object in the captured image ?

enter image description here

Ajay Sharma
  • 4,509
  • 3
  • 29
  • 59
  • 1
    If you go the opencv route, you should look at [this](http://stackoverflow.com/questions/8667818/opencv-c-obj-c-detecting-a-sheet-of-paper-square-detection) question – Hammer Sep 28 '12 at 16:25
  • I'm facing same problem. share resolve steps and guide me to achieve. – Senthilkumar Jul 25 '17 at 13:40

1 Answers1

7

When you are already using openCV you might know the Reference Manual:

http://www.sciweavers.org/books/opencv-open-source-computer-vision-reference-manual

On page 10-6 there is a reference to the set of contour detection functions:

CvContourScanner cvStartFindContours(IplImage* img, 
                                     CvMemStorage* storage, 
                                     int headerSize, 
                                     CvContourRetrievalMode mode, 
                                     CvChainApproxMethod method );

int cvFindContours( IplImage* img, 
                    CvMemStorage* storage,
                    CvSeq** firstContour, 
                    int headerSize=sizeof(CvContour),
                    CvContourRetrievalMode mode=CV_RETR_LIST,
                    CvChainApproxMethod method=CV_CHAIN_APPROX_SIMPLE );

I hope that helps.

When the target of your question was, how to use OpenCV on ios/iPhone then you can have a look at the following Sites. Ready made XCode project files for use in an iOS project:

http://www.eosgarden.com/en/opensource/opencv-ios/overview/

Another StackOverflow post with very valuable information can be found here:

iPhone and OpenCV

Community
  • 1
  • 1
Marcus Gründler
  • 885
  • 13
  • 16
  • It's the same link from where I donwload the framework.BTW let me check out with the book, if I can get something workout.Thanks for your answer. – Ajay Sharma Jan 19 '12 at 10:49
  • I got these methods, but it's quite difficult to trace down for it, as based on which paramters framework is Recognizing the Face ? – Ajay Sharma Jan 19 '12 at 12:07
  • Hmm I'm not sure what you really want to know. Maybe the online Wiki of OpenCV for face detection helps you: http://opencv.willowgarage.com/wiki/FaceDetection – Marcus Gründler Jan 19 '12 at 13:12