# How do i binarize these two images to produce an as equal result as possible?

1 visualización (últimos 30 días)
Holmbrero el 22 de En. de 2021
Comentada: Holmbrero el 25 de En. de 2021
Hi!
The two attached images of a porous material are aquired at the same area but as with all aquired images there is a slight difference.
When i binarize the images and compare the area of each pore between the two images, the mean difference in measured area is about 5 %, due to that it does not define the pore edges at the exact same place.
How do i binarize these two images to make them as equal as possible after binarization? This could ofcourse include pre-processing as well.
Any suggestions would be greatly appreciated!
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Respuestas (1)

Rohit Pappu el 25 de En. de 2021
Since Image 2 is a horizontally shifted version of Image 1, a possible workaround could be as follows
% Load the images to workspace
% Convert images to grayscale
I1bw = rgb2gray(I1)
I2bw = rgb2gray(I2)
% Pick a reference point in the first image
pixel = I1bw(1,1);
% Find the first occurence of similar pixel in first row of second image
pixelshift = find(pixel == I2bw(1,:),1,"first")
% Shift the second image left by 'pixelshift' amount of pixels
I2shift = imtranslate(I2bw,[-pixelshift,0],"linear")
% Crop the pixelshift number of colums on the right of both images
% to get rid of the interpolated values
I1bw = I1bw(:,1:end-pixelshift);
I2shift = I2shift(:,1:end-pixelshift);
% View both the images simultaneously with false color overlay
imshowpair(I1bw,I2shift)
##### 1 comentarioMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos
Holmbrero el 25 de En. de 2021
I will give it a go and get back with the result.

Iniciar sesión para comentar.

### Categorías

Más información sobre Image Thresholding en Help Center y File Exchange.

R2018b

### Community Treasure Hunt

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

Start Hunting!

Translated by