Removing overlapping pixels in black and white images
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have two black and white images, let say A and B, I would like to remove overlapped pixel between image A and B and maintain the pixels from image A only after removing the overlapped pixels? How can I do this?
As shown in the following image, I would like to remove the green and black part and keep the pink part of the image.
0 Kommentare
Antworten (1)
KSSV
am 21 Mär. 2019
I = imread('image.jpeg') ;
R = I(:,:,1) ;
G = I(:,:,2) ;
B = I(:,:,3) ;
% Get black region
I1 = rgb2gray(I) ;
idx = I1 < 50 ;
R(idx) = 255 ;
G(idx) = 255 ;
B(idx) = 255 ;
% remove green part
idx = G<=255 ;
R(idx) = 255 ;
B(idx) = 255 ;
% Remove Black
I2 = cat(3,R,G,B) ;
imshow(I2)
There could be more elegant solution.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!