¡@

Home 

2014/10/15 ¤U¤È 10:12:28

iphone Programming Glossary: paperheight

adjust corners and crop the image openCV

http://stackoverflow.com/questions/13098073/adjust-corners-and-crop-the-image-opencv

want to extract. In my example I assume you're extracting a DIN A4 paper 210x297mm . Feel free to edit paperWidth and paperHeight inside my code. Combining everything looks like this Helper cv Point getCenter std vector cv Point points cv Point center.. std vector cv Point square declare used vars int paperWidth 210 in mm because scale factor is taken into account int paperHeight 297 in mm because scale factor is taken into account cv Point2f imageVertices 4 float distanceP1P2 float distanceP1P3 BOOL.. paper paperVertices take orientation into account if distanceP1P2 distanceP1P3 scaleFactor ceil lroundf distanceP1P2 paperHeight we always want to scale the image down to maintain the best quality possible paperImage cv Mat paperWidth scaleFactor paperHeight..