How to overlap multiple pictures
2 ビュー (過去 30 日間)
古いコメントを表示
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:
0 件のコメント
回答 (1 件)
Image Analyst
2020 年 12 月 29 日
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);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!