How to binarize an image by keeping the NaNs and using a threshold?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Lequette Kevin
el 28 de En. de 2019
Comentada: Walter Roberson
el 29 de En. de 2019
Hello,
I am a novice with Matlab. I have a 3D array with NaNs, corresponding to the outside of an porous object. I would like binarize this image (units 8) with a treshold equal to 15. To do it, I used:
Bimg = imgd3 >15;
The binarization works but when I do it, the NaNs become 0 value. I want to keep the NaNs because they correspond to the outside of my object.
Any idea ?
Thank :)
0 comentarios
Respuesta aceptada
Matt J
el 28 de En. de 2019
nanmap=isnan(imgd3);
Bimg = imgd3 >15;
Bimg(nanmap)=nan;
2 comentarios
Lequette Kevin
el 29 de En. de 2019
Editada: Lequette Kevin
el 29 de En. de 2019
Walter Roberson
el 29 de En. de 2019
By definition, binary only has 2 values, not three. Not 0, 1, or nan.
You should be storing your mask in a different array.
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!