Writing processed image into new image not working as expected

1 visualización (últimos 30 días)
Marie-Sophie Pichler
Marie-Sophie Pichler el 15 de En. de 2020
Respondida: Jyothis Gireesh el 20 de En. de 2020
i am trying this:
I(1, 1, :) = [26, 45, 34];
the pixel is white even though the right colors are printed if i check I(1, 1)...

Respuestas (2)

Jyothis Gireesh
Jyothis Gireesh el 20 de En. de 2020
I am assuming here that the matrix “I” is of datatype double and “imshow()” function is used to display the image. Since the expected range of values for a double image is in between 0 & 1, the values assigned to the pixel at (1,1) are rounded off to the maximum value (1) which using “imshow()”. Hence the particular pixel appears to be white.

Image Analyst
Image Analyst el 20 de En. de 2020
You can try
imshow(I, []);
though if your image is double, and all the other pixels are in the range 0-1, all the other pixels will display as very dark. You might try dividing by 255:
I(1, 1, :) = [26, 45, 34] / 255;

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by