Hello,
I'm trying to process the following image in order to remove the green screen background and replacing it with any another image:
http://img576.imageshack.us/img576/747/ ... sample.jpg
I have no influence on the quality of the green screen or the capture itself.
As I'm new to Imagick I ended up trying the command example from the docs, such as
- http://www.imagemagick.org/Usage/masking/#difference
- http://www.imagemagick.org/Usage/photos/#green_screen
- http://www.imagemagick.org/Usage/photos/#chroma_key
Also the usual -fx algorithms for green screening didn't work out for me:
http://www.multipole.org/discourse-serv ... 8b7#p74744
The results are far away from a usable mask which I would need in order to make an almost perfect cut-out.
Expected result (via Photoshop): http://img818.imageshack.us/img818/3960 ... result.jpg
Example background image: http://upload.wikimedia.org/wikipedia/c ... t_time.jpg
The processing will have to be done on multiple images with a similar green screen.
Any help or hint is appreciated.
Green screen / chroma key
Re: Green screen / chroma key
Woops - nothing to add
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Green screen / chroma key
Can you tell us how PS does it? Not everyone has or uses PS! Is there some PS tutorial on the topic?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Green screen / chroma key
try this. Adjust the fuzz value as desired.
convert greenscreensample.jpg -channel r -separate +channel -fuzz 1% -fill black -opaque black -fill white +opaque black greenscreensample_mask_1.gif
Then use
convert backgroundimage foregroundimage maskimage -compose over -composite resultimage
convert greenscreensample.jpg -channel r -separate +channel -fuzz 1% -fill black -opaque black -fill white +opaque black greenscreensample_mask_1.gif
Then use
convert backgroundimage foregroundimage maskimage -compose over -composite resultimage
Re: Green screen / chroma key
I use the technique used shown here http://www.youtube.com/watch?v=CpJ8E4sq ... re=related.
So Photoshop uses a mask as well, which is able to reduce noise of unclean green screen in the background.
So Photoshop uses a mask as well, which is able to reduce noise of unclean green screen in the background.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Green screen / chroma key
Once you have the mask, you can clean it up often times using -morphology open or close depending up white on black or black on white
see
http://www.imagemagick.org/Usage/morphology/
You can also feather the edges.
see
http://www.imagemagick.org/Usage/masking/#difference
http://www.fmwconcepts.com/imagemagick/ ... /index.php
see
http://www.imagemagick.org/Usage/morphology/
You can also feather the edges.
see
http://www.imagemagick.org/Usage/masking/#difference
http://www.fmwconcepts.com/imagemagick/ ... /index.php