Using OpenCV Python, How would you make all black pixels transparent, and then overlay it over original image -


i'm trying make colored mask, white. , idea to:

  • make black pixels transparent in mask
  • merge 2 images
  • crop images

so original masked area white. kind of opencv python code/methods need?

like so:

original

original

mask

mask

desired result (mocked - no green edges)

desired result (mocked - no green edges)

instead of

instead of

i suppose color threshold mask itself. result got in first quick , dirty attempt hue 43-81, saturation 39-197 , brightness 115-255 is: enter image description here

the next step whole fill algorithm fill inside of mask. note 1 small area right selected.

enter image description here

the next step substraction of 2 results (mask-filled_mask):

enter image description here

again fill wholes , rid of noisy pixels binary opening:

enter image description here

last mask image created mask.

enter image description here

every step can adjusted yield optimal results. idea try steps out (for example imagej) workflow set , script steps in python/opencv.

refer http://fiji.sc/segmentation.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -