Hi, i am a python/django developer. i am looking for a solution to replace fabric in an image, So the solution should detect shirt and change color based on choice. Is it possible to do that using scikit? if yes, please give me any little idea to help straight to the point.
Do you have control over the photos? If so, here is a simple approach: have the model wear a green shirt, as this will make shirt detection and fabric replacement much easier. Then the basic idea is to (1) convert the image to a color space that separates color (hue) from intensity and saturation (skimage can do this), (2) create a mask that identifies "green" pixels in the image (this will be a range of values in the hue dimension), (3) replace the green pixels with your fabric pattern. I hope that helps! Neil On Saturday, 15 March 2014 11:42:59 UTC, Aswani Kumar wrote:
Hi,
i am a python/django developer.
i am looking for a solution to replace fabric in an image, So the solution should detect shirt and change color based on choice.
Is it possible to do that using scikit? if yes, please give me any little idea to help straight to the point.
Thank you neil, but i don't have control on the images, i need to do this apply for existing images in inventory of a apparel shopping site. Is there any way to do this? i can do prefer hard way too... On Sunday, March 16, 2014 5:35:45 AM UTC+5:30, Neil wrote:
Do you have control over the photos? If so, here is a simple approach: have the model wear a green shirt, as this will make shirt detection and fabric replacement much easier. Then the basic idea is to (1) convert the image to a color space that separates color (hue) from intensity and saturation (skimage can do this), (2) create a mask that identifies "green" pixels in the image (this will be a range of values in the hue dimension), (3) replace the green pixels with your fabric pattern.
I hope that helps!
Neil
On Saturday, 15 March 2014 11:42:59 UTC, Aswani Kumar wrote:
Hi,
i am a python/django developer.
i am looking for a solution to replace fabric in an image, So the solution should detect shirt and change color based on choice.
Is it possible to do that using scikit? if yes, please give me any little idea to help straight to the point.
OK, in that case here's another idea: - apply a face detection algorithm (not yet in skimage - there is a recent discussion on this. perhaps you can contribute? in the meantime, OpenCV has one). - based on the location of the face, you can take a guess about the location of the upper body. e.g. it is within a box below the head that is X times face width, and Y times face height (X & Y to be determined through experiments) - given the bounding box of the shirt, determine the dominant color and or texture (e.g. using a histogram). use this to create a "shirt mask" - replace shirt mask pixels with desired fabric As you can see, solving a general problem (no control over capture conditions) is harder, but if you make a few assumptions you can probably get a reasonable result. Neil On Wednesday, 19 March 2014 18:05:13 UTC, Aswani Kumar wrote:
Thank you neil,
but i don't have control on the images, i need to do this apply for existing images in inventory of a apparel shopping site. Is there any way to do this? i can do prefer hard way too...
On Sunday, March 16, 2014 5:35:45 AM UTC+5:30, Neil wrote:
Do you have control over the photos? If so, here is a simple approach: have the model wear a green shirt, as this will make shirt detection and fabric replacement much easier. Then the basic idea is to (1) convert the image to a color space that separates color (hue) from intensity and saturation (skimage can do this), (2) create a mask that identifies "green" pixels in the image (this will be a range of values in the hue dimension), (3) replace the green pixels with your fabric pattern.
I hope that helps!
Neil
On Saturday, 15 March 2014 11:42:59 UTC, Aswani Kumar wrote:
Hi,
i am a python/django developer.
i am looking for a solution to replace fabric in an image, So the solution should detect shirt and change color based on choice.
Is it possible to do that using scikit? if yes, please give me any little idea to help straight to the point.
participants (2)
-
Aswani Kumar
-
Neil