Prev: I do need your help
Next: GUI with coding
From: Steve on 12 May 2010 20:40 Hi, is it possible to crop a region out of an image that is not horizontal? For example, I have two points anywhere in my image and I would like to crop the part of the image which has the width w (= the distance between my two points) and the height h (should be defined, e.g. 10). As a result I need a rectangular image that is cropped under an angle out from the original image. I hope I could make my point... :-) Cheers
From: ImageAnalyst on 12 May 2010 21:05 Yes. You simple use maketform() and pass it your actual points, and your desired points which would warp your quadrilateral into a perfect rectangle aligned with the rows and columns. Then call tformfwd() to apply your transformation matrix to your image. Now your quadrilateral is aligned with the rows and columns. Then you simply use imcrop() to copy the desired rectangular portion into a new image array.
|
Pages: 1 Prev: I do need your help Next: GUI with coding |