Skip to content Skip to sidebar Skip to footer

Crop Image Using Mask And Python Scikit-image

I'm working in image proceesing and I have the following code to obtain the convex hull of a image: from skimage import io from skimage.color import rgb2gray from skimage.morpholog

Solution 1:

You can use min and max to find the border of the convex hull image.

import numpy as np
[rows, columns] = np.where(chull)
row1 = min(rows)
row2 = max(rows)
col1 = min(columns)
col2 = max(columns)
newImage = original[row1:row2, col1:col2]

Post a Comment for "Crop Image Using Mask And Python Scikit-image"