1 | initial version |
I want to point out that what you are trying is not that straightforward as you might think. But hey, this are the steps to follow.
http://docs.opencv.org/doc/user_guide/ug_traincascade.html?highlight=train%20cascade
This is problem 1, how will you segment the boundaries. You could try it with stuff like gradient detection (Sobel operators, Scharr operators) or the canny edge detector. Again this is all provided in OpenCV.
Next you would need to define a binary image based on the edge with what is background and what is the object itself.
Extracting the object won't be to difficult, thats just cutting out the returning bounding box.
About the perspective transform, nothing I have done so far, so can't help you there. But this is probably enough to get you started.