Replace white background of image with transparent using C++ / OpenCV or Matlab -


using c++ / opencv or matlab i'm trying find method replace white background of image file transparent background , save image further use elsewhere. (the image similar this: http://www.psdgraphics.com/file/monitor-on-white-background.jpg)

i understand task can completed simple image editing software need large batch of images. i've tried methods such make white background transparent png matlab bunch of others no luck.

thanks!

  1. load image. loading images in opencv
  2. convert 4 channel image. opencv: transforming 3 channel image 4 channel
  3. determine background adjust alpha channel of pixels accordingly. don't know images like, if there no other white in images, it's simple task. (if pixel white, should transparent.) otherwise, if there other white in images, need contiguous region(s) of white make background. see flood fill algorithm
  4. save image (see link 1.)

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -