img=Import["https://i.stack.imgur.com/NjyIK.jpg"]
The dress is closely similar with the color of the background stair rail.
How can I binarize the image to get the dress mask or human mask?
Any methods of Binarize is acceptable, like
RegionBinarize
, training an semantic segment model
I've tried several Binarize*
functions, and EdgeDetect
functions, and confirmed that there are some challenges in the right-down part of the dress.
Background explaination: Why to segment? For example, consider there are many dress model pictures, we can cluster them by dress, and remove background we could get better features, for example textures and shapes.
upadte:
Maybe someone knows more about traditional segment methods and has various experiences. Thanks for @rhermans 's comment.
RemoveBackground[Import["https://i.stack.imgur.com/NjyIK.jpg"], {"Foreground", {RGBColor[ 0.9157048167754652, 0.8904987221508752, 0.8709273742640429], 0.062}}]
ImagePartition is a good idea with better region effect in Watershed.
WatershedComponents[,mask]//Colorize
Mask
manually (related How to retouch (smart fill) photo image?). Or you can try splitting your image into segments for better contrastimg = Import["https://i.stack.imgur.com/NjyIK.jpg"];Grid[Partition[EdgeDetect[#] & /@ (ImagePartition[img, 50]~Flatten~1), 4], Spacings -> {0, 0}]
$\endgroup$