iphone - Cropping UIImage like camscanner -


i stuck in application feature. want cropping feature similar cam scanner cropping. screens of cam-scanner are: have created similar crop view.

enter image description here

enter image description here

i have obtained cgpoint of 4 corners. how can obtained cropped image in slant.

please provide me suggestions if possible.

this perspective transform problem. in case plotting 3d projection in 2d plane.

as, first image has selection corners in quadrilateral shape , when transform in rectangular shape, either need add more pixel information(interpolation) or remove pixels.

so actual problem add additional pixel information cropped image , project generate second image. can implemented in various ways:

<> can implement own applying perspective tranformation matrix interpolation.

<> can use opengl .

<> can use opencv. .. , there many more ways implement it.

i had solved problem using opencv. following functions in opencv achieve this.

  1. cvperspectivetransform

  2. cvwarpperspective

first function calculate transformation matrix using source , destination projection coordinates. in case src array have values cgpoint corners. , dest have rectangular projection points example {(0,0)(200,0)(200,150)(0,150)}.

once transformation matrix need pass second function. can visit thread.

there may few other alternatives opencv library, has collection of image processing algorithms.

ios application opencv library available @ eosgarden.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -