1

I need to create HarrCascade XML file to use it with OpenCV for tracking my Square or Rectangle object, and I have researched and I fond many way to create HaarCascade but none of this explain with iPhoneSDK.

Sample Link : Haar Classifiers

Also, I have checked for other XML files which are for eyes, nose & other body parts which works very well.So, I hope just generating a new HarrCascade XML file & training the classfiers will solve ma problem.

So, how to create Haar Cascade (xml) for using with OpenCV for iOS ?

Ajay Sharma
  • 4,509
  • 3
  • 29
  • 59
  • What about using squares.cpp that come with opencv samples to detect squares? – Abid Rahman K Jan 23 '12 at 06:41
  • I am not sure how to use it within my app ? But I tried to change my XML file & it worked.So, just looking for generating new HarrCascade XML & train ma classifiers of ma own.Alternatively, can you help me with squares.cpp. Thanks – Ajay Sharma Jan 23 '12 at 07:34
  • Well, i am not familier with iphone-sdk. But [squares.cpp](https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/cpp/squares.cpp)(Its C implementation [here](https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/c/squares.c?rev=27)) works fine to detect square. I used to detect it each and every square of sudoku and several other things. – Abid Rahman K Jan 23 '12 at 07:50

1 Answers1

1

Give this a shot if you want to detect squares: OpenCV C++/Obj-C: Detecting a sheet of paper / Square Detection

Works fine for me and if you scale down the input image it's fast enough for iOS-devices

Community
  • 1
  • 1
dom
  • 11,454
  • 9
  • 46
  • 71
  • Did you implemented this code with iOS ? If yes, Can you share the code with some working sample ? – Ajay Sharma Jan 24 '12 at 05:20
  • Yes, I got it working. karlphillips answer is easy to convert to Objective-C code if you want. You can even use just the code he answered. After that you just need to use the biggest square for further processing. – dom Jan 24 '12 at 10:37
  • @AjaySharma Would you may accept may answer, if it was helpfull? – dom Feb 23 '12 at 12:49
  • yes that is.I got the idea.But the thing is still I am not able to make in practice.Can you help me with some demo please. – Ajay Sharma Feb 23 '12 at 15:59