Which method for detecting edges of white object on white background?

I would like to segment picture of cloths in order to remove the background. The pictures come from online retailers, they usually have an homogeneous white background.

Using Canny edge detector works in most of the cases, but sometimes the cloths are nearly as white as the background making the edges hard to detect.

I tried to play with the min and max parameters in opencv (python), but I can't recover the clean edge, either I do not get the surrounding of the cloths (holes in the reigion) or the the edge is noisy around the cloth.

Here's one of the tricky example:

Simple growing region for background detection also doesn't work well enough.

So how do you detect the contour of an object if it has nearly the same color as the background?

• the object is a texture with opacity? if so, just use Shobel with opacity as source value – Nadir Feb 25 at 19:23
• Are many of these images the same? (Same camera angle) If the topology is roughly consistent it would be pretty easy to simply fill in the details on the latter image with some template. Wouldn't help much with the graphics on the tshirts though. – Andrew Wilson Feb 26 at 4:15

The block size is 8x8 pixels for JPEG (and hence also in this image), so every vertical or horizontal edge which falls directly onto position 8*n or 8n+1 X or Y is most likely just a compression artifact and can be ignored.