Reputation: 2841
Scans/photocopies often miss the corner which comes out black. How can these black corners be made white using python with numpy, pillow or skimage?
Upvotes: 1
Views: 98
Reputation: 7263
mask = image < threshold
)new_mask = segmentation.clear_border(mask)
)objs = (new_mask != mask)
image[objs] = 1
(or 255, if dtype int).If you need to make sure that the objects replaced by white are triangles, you can use skimage.measure.regionprops
to further examine each one.
Upvotes: 3