Borrar filtros
Borrar filtros

How to overlap multiple pictures

2 visualizaciones (últimos 30 días)
Markus Kokot
Markus Kokot el 29 de Dic. de 2020
Respondida: Image Analyst el 29 de Dic. de 2020
Hallo,
I created multiple pictures with the same size like: White (background), colored lines (foreground)
How do I read all of them in and than - How can I overlap all pictures that I red in forming one image in the end?
Images like:

Respuestas (1)

Image Analyst
Image Analyst el 29 de Dic. de 2020
I think you're best off creating then from the images you got from bwperim(). Use those images with ind2rgb() to create an RGB image, and just assign the color for the latest image to a running total image. If you want the black to then become white you can get a mask of all pure black areas and set them all to 255. But if you really want to start with these existing white and colored images, you can do (as a start)
masterImage = zeros(rows, columns, 3, 'uint8');
[rMaster, gMaster, bMaster] = imsplit(masterImage);
for k = 1 : numImages]
filename = fullfile(folder, whatever-------------)
thisImage = imread(filename);
% Find pixels that are pure white (255,255,255)
whiteMask = all(thisImage == 255, [], 3);
% Get mask of other pixels that are the
linesMask = ~whiteMask;
[r, g, b] = imsplit(thisImage);
rMaster(linesMask) = r(linesMask);
gMaster(linesMask) = g(linesMask);
bMaster(linesMask) = b(linesMask);
end
masterImage = cat(3, rMaster, gMaster, bMaster);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by