Why intensity of the image has changed, after masking out image area (using binary mask)?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Ivan Shorokhov
el 22 de Sept. de 2015
Comentada: Walter Roberson
el 23 de Sept. de 2015
Hello,
I have used following code:
new_im=im; % Size (80x84) Bytes(13440) Class (uint16)
bw_mask; % Size (80x84) Bytes(53760) Class (double)
new_im(~bw_mask) = 0; %
After masking out I have following results (zoomed).
As you can see the intensity of the images are different, could anyone tell me please, what I have done wrong?
MATLAB version [2015b]
0 comentarios
Respuesta aceptada
Hamoon
el 22 de Sept. de 2015
Actually it is just about displaying the image, if you check the values of im(60,65) and new_im(60,65) for im and new_im matrices you will see these two values are equal, but when Matlab is displaying a double or uint16 image, it maps each range of values to a specific value probably by using the histogram of the image. So for different images, a specific value can map to different values when Matlab wants to display it. But it’s not the case with uin8 images.
6 comentarios
Ivan Shorokhov
el 23 de Sept. de 2015
Editada: Ivan Shorokhov
el 23 de Sept. de 2015
Walter Roberson
el 23 de Sept. de 2015
The images you have are already uint8. Note that my reply was about using image() and imagesc() not about imshow()
If you using your first possibility, where you show im_new according to the range of im, then that would use the same brightness for both, which is good. But it would also imply that two different original images might not use the same brightness for the same stored value, as you are adjusting each according to its brightness range.
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with Image Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!