iphone - Marking face and eyes on image -


i working on app detects face , marks eyes , mouth on image.i have detected face ,eyes , mouth using cidetector position of eyes , face returns respect original image not according view of imageview on have mark faces , eyes i.e example have image of 720 *720 position of face , eyes retuns respect size of 720 *720.but problem ..i have show eyes , face annotated on image view of size 320 * 320. please advice me how can map postion of face returned cidetector position of face on image view.

you can solve considering imageview size image size ratio.
following simple , used solve problem.

//'returnedpoint' position of eye returned cidetector  cgfloat ratio = 320/ 720.0; //it like, cgfloat ratio = yourimageview.frame.size.width/ yourimage.size.width; cgpoint pointonimageview = cgpointmake((ratio * returnedpoint.x), (ratio * returnedpoint.y)); 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -