'Paste' a binary image onto a background image? (image blending)
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Project is to take a picture of myself, make it into a binary image (background around me all white, my body is completely black), then I have to pretty much paste that image onto a background. My goal is to create a function (x-y coordinates) that returns the first picture (me) on top of the second picture (the background). I have to choose a spot to place the picture of me also.
Can someone just give me pseudo code or something just so i have an idea of where to start/how to do it? I'm so lost :(
0 comentarios
Respuestas (1)
Image Analyst
el 27 de Abr. de 2015
I don't understand. If the original picture is on top of the background, how can the background even be seen? Some part of your original picture must be transparent. If it's where the binary image is all white, then for a gray scale image, do
grayImage(binaryImage) = 255;
If you have a color image, then do it for every color channel.
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Multiply the mask by each color channel individually.
redChannel(mask) = 255;
greenChannel(mask) = 255;
blueChannel(mask) = 255;
% Recombine separate masked color channels into a single, true color RGB image.
maskedRgbImage = cat(3, redChannel, greenChannel, blueChannel);
0 comentarios
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!