Hi there,


On Mon, Feb 6, 2017, at 11:02, wine lover wrote:

> I am not sure how to perform the crop operation with an angle (the
> cropped one marked with blue) in skimage? In specific, I do not want
> the cropped one go beyond the scope of original image.


How about rotating the image, and then doing a square crop?



Alternatively, you can do it all in one step with an image
transformation.  Something like this (untested, read it as pseudocode):




in_coords = np.array(...)  # coordinates of rotated square

out_coords = np.array(...)  # coordinates of output image



tf = skimage.transform.estimate_transform('euclidian', in_coords,
out_coords)


cropped_image = skimage.transform.warp(image, tf.inverse)





Best regards

Stéfan


_______________________________________________
scikit-image mailing list
scikit-image@python.org
https://mail.python.org/mailman/listinfo/scikit-image

Reply via email to