Trying out possibilities with skills learned in Activity 12 :)
After color segmentation, we now have a binary image where the colored region of interest is now a white region and the background is black. Being binary, this image can then be used as a mask. Suppose we want to isolate the green gummy bear from the image by keeping the color of the green gummy bear while blacking out the rest of the image. We can multiply the mask to the RGB channels of the original image. In each channel, only the region of interest would maintain the channel values because it will be multiplied to 1, and the rest will be 0. So the resulting image will have a black background and a colored region of interest.
Digital cameras now have a feature where the user can select a color from the scene and the camera will take a picture such that the only colored regions are the regions which have the selected color and the rest is grayscale. Below is a sample image where the feature was used.

Personally, I think this effect is cool, especially if the emphasized region would add drama to the image, as in wedding pictures or other celebration pictures, which is why I played around with this technique.
Now we want to do this for the green gummy bear. This effect can be achieved in post-processing by applying the masking technique discussed in Activity 11. First we need an isolated colored green gummy bear on a black background. Check. Next we need a grayscale image of the original gummy bear image with the green gummy bear blacked out. To do this, we multiply the inverted mask to the grayscale image.

Now we have an image such that the region where the green gummy bear used to be is now black while the rest of the image remain grayscale. This is where we will place the isolated green gummy bear with color.
The final step is to superimpose the two. However, the grayscale image must be converted to RGB such that it will have three channels but the resulting image is still grayscale. This was done in Gimp by changing the image mode to RGB from grayscale (I do not know if there is a command in Scilab that converts grayscale to RGB). Adding the corresponding channels of both images then gives us the desired effect.


Even if I don't have a digital camera, I can now achieve this effect through post-processing. :)
Thanks to Master (Mark Jayson Villangca) for the idea that the segmented image can be used as a mask.
0 comments:
Post a Comment