Subtract background image from foreground
Posted: 2016-10-24T12:20:32-07:00
I want to subtract background details from a picture.
The command I'm using on Linux is:
/usr/bin/convert /home/pi/chromaCam/actualimage.png \( backplain.png -channel A -threshold 99% \) -compose dst_out -composite /home/pi/chromaCam/Destination.png
Note: backslashes includes as being run on the command line
I based the command on the command here (viewtopic.php?t=17478) that worked for someone else.
Image with object in it - actualimage.png
https://drive.google.com/file/d/0B23BvT ... sp=sharing
Background - backplain.png
https://drive.google.com/file/d/0B23BvT ... sp=sharing
Subtract backplain from actualimage - Destination.png
https://drive.google.com/file/d/0B23BvT ... sp=sharing
The output is a completely transparent image.
Any thoughts, tips appreciated.
convert -version
Version: ImageMagick 6.8.9-9 Q16 arm 2016-09-23 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
The command I'm using on Linux is:
/usr/bin/convert /home/pi/chromaCam/actualimage.png \( backplain.png -channel A -threshold 99% \) -compose dst_out -composite /home/pi/chromaCam/Destination.png
Note: backslashes includes as being run on the command line
I based the command on the command here (viewtopic.php?t=17478) that worked for someone else.
Image with object in it - actualimage.png
https://drive.google.com/file/d/0B23BvT ... sp=sharing
Background - backplain.png
https://drive.google.com/file/d/0B23BvT ... sp=sharing
Subtract backplain from actualimage - Destination.png
https://drive.google.com/file/d/0B23BvT ... sp=sharing
The output is a completely transparent image.
Any thoughts, tips appreciated.
convert -version
Version: ImageMagick 6.8.9-9 Q16 arm 2016-09-23 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib