Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to simulate clothes changes in 2D image?

I'm working on small project which requires: Change clothes (shirt/pants etc.) of a person in any 2D image he chooses to upload. So somehow edges needs to be detected and relevant areas are supposed to be filled with new patterns. I do see a lot of other complications, but let's assume simple patterns have to be filled only.

  1. For a web application, is it possible to do it in HTML5? Any other alternatives?

  2. For a standalone application, what kind of technology would be preferred, C++/Java?

Update

Based on Bart's comment:

  1. Any useful pointer like Bart's would be really useful
  2. Assumption: Clear traceable 'standing' human figure in 2d image
  3. Since it's an image, there is no real-time scenario
like image 560
understack Avatar asked Nov 27 '11 12:11

understack


1 Answers

Assumption: Clear traceable 'standing' human figure in 2d image

A way to do this is to require the user to take two pictures. One picture is the one with the user in it, the other picture must be taken in the same camera position and orientation, but the user steps out of the frame for that one.

Since both pictures will have the same background you can compare pixel by pixel between the two images and flag those pixels that have a difference over some threshold. Of course the threshold must be selected so that camera noise isn't detected as a difference. Once you have the collection of pixels that are different you can filter them and calculate an approximate silhouette for the user from the pixels on the edge.

A simplification of the above method can be done if you have control over the background. You could use a bluescreen to avoid having to have a second picture with the background.

like image 173
Miguel Avatar answered Sep 28 '22 23:09

Miguel