Remove Background of a picture

14 views
Skip to first unread message

Dilan

unread,
Jun 7, 2011, 6:06:01 PM6/7/11
to sonic-gesture
Hi Gijs,

I want to remove background of a picture and I've done up to the
cvThreshold function and got a black&white picture (without skin
pixels). I don't no how to replace that cvThreshold picture with skin
pixels. I found your research document and it's not described how to
replace with skin pixels. Which functions should execute to replace
skin pixels and get the binary image (or tell me procedure) ???
Could you please help me I'm stuck in a middle of a project and have
done so many things to remove background they all are unsuccessful and
waste many days.

Dilan

Gijs Molenaar

unread,
Jun 8, 2011, 6:06:07 AM6/8/11
to sonic-...@googlegroups.com
Hi Dilan,

I think a copy with the binary image as the mask should do it. Maybe
make the target image black first.

- Gijs

signature.asc

Dilan Madushanka

unread,
Jun 8, 2011, 11:18:55 AM6/8/11
to sonic-...@googlegroups.com
Thanks for spent your valuable time for me.
What do you mean by make the target image black first ? 
I've a problem with RGB2HSV conversion, it's not returning the black&white picture like backprojection in your research doc. But if I use RGB2GRAY it will fine. Why RGB2HSV conversion not returning black&white picture ?
Could you please reply to dila...@gmail.com (or give your e-mail) then I can send my code and returned pictures to you. 
--
Thanks & Best Regards,

Dilan Madushanka Saparamadu.

"In dreams, we enter a world that's entirely our own."



Gijs Molenaar

unread,
Jun 10, 2011, 7:19:03 AM6/10/11
to sonic-...@googlegroups.com
On 06/08/2011 05:18 PM, Dilan Madushanka wrote:
> Thanks for spent your valuable time for me.
> What do you mean by make the target image black first ?

create a black image.


> I've a problem with RGB2HSV conversion, it's not returning the black&white
> picture like backprojection in your research doc. But if I use RGB2GRAY it
> will fine. Why RGB2HSV conversion not returning black&white picture ?
> Could you please reply to dila...@gmail.com (or give your e-mail) then I
> can send my code and returned pictures to you.

rgb to HSV will convert the 3 channel RGB (Red Green Blue) image to the
3 channel HSV (Hue Saturation Value) image space. Displaying this image
as a RGB image gives no meaningful result. You should take one channel,
hue for example, and do your stuff with that image. When you display one
channel of a HSV image you get a grey scale image. Note that probably
the values will be between 0 and 1, so you need to multiply it with 255
for correct visualization.


- Gijs

signature.asc

Dilan Madushanka

unread,
Jun 10, 2011, 9:21:30 AM6/10/11
to sonic-...@googlegroups.com
I have used black image in cvAbsDiff() function to get clear image after HSV conversion. Is that the responsibility of black image you are referring ?

and thanks for the HSV conversion information. :) 

--

Dilan.




Gijs Molenaar

unread,
Jun 10, 2011, 9:58:43 AM6/10/11
to sonic-...@googlegroups.com, Dilan Madushanka

Hi Dilan,

It seems you are abusing functions, but it may work.

- gijs

Reply all
Reply to author
Forward
0 new messages