Removing overlapping pixels in black and white images

4 Ansichten (letzte 30 Tage)
AMIRA
AMIRA am 21 Mär. 2019
Beantwortet: KSSV am 21 Mär. 2019
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.

Antworten (1)

KSSV
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.

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by