4
$\begingroup$

I'm trying to take an image of a pencil sketch (http://www.vangoghgallery.com/catalog/image/1442/Sower-with-Setting-Sun.jpg) and colorize the different segments based on the texture. So in this image, the sky and the man and the wheat in the background would all be a different color.

I've found I can sort of use texture-based segmentation with a gabor filter (https://reference.wolfram.com/legacy/v9/example/TextureBasedSegmentation.html) but it doesn't exactly get what I'm looking for. It isn't able to colorize the dots or the blank space in the sky.

Any other methods that are obvious that I should try?

$\endgroup$

1 Answer 1

1
$\begingroup$

This will get you fairly solid regions for the sky, the sun, and the path, with the small components produced by the field removed (black). Unfortunately the dude in the hat got deleted too. I played around a lot with the parameters but couldn't capture him in a contiguous segment.

DeleteSmallComponents[
  WatershedComponents[
   FillingTransform[GradientFilter[img, 2], 0.05, Padding -> 1], 
   Method -> "Basins"]
  , 4000, CornerNeighbors -> True] // Colorize

segmentation

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.