I am looking something like attached image, How can I implement this in iPhoneSDK.
Can anybody suggest me some open source API or Algorithm
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