Borrar filtros
Borrar filtros

Why does Matlab display different pixel values than other programs?

4 visualizaciones (últimos 30 días)
I have a labview program which opens an image and displays the values of a pixel at a coordinate. If I open the same image with imread and display the value of that same coordinate, it is different.
If I plot intensity along a straight line in both programs, the relative intensity to other pixels remains constant; i.e. the coordinate of the brightest/darkest pixel is the same in both programs.
Finally, if I open that same image in any image editor (paint.net, GIMP, etc.), the pixel values agree with the results I get from Labview.
This problem persists regardless of the image type (.jpg, .bmp, etc.), whether it is greyscale or RGB, etc. I can't figure out why Matlab's pixel values don't agree with any other program's results. The ratio of Matlab's result to the other result is totally nonlinear; there is no scaling factor. The effect appears to exacerbate itself with very bright pixels.
I am using Matlab 7, though Matlab 6 has the same problem too.

Respuesta aceptada

Evan
Evan el 17 de Jul. de 2013
Editada: Evan el 17 de Jul. de 2013
Shot in the dark here, but could it have anything to do with those programs using 0 indexing while matlab uses 1 indexing? Paint.NET definitely displays image coordinates as ranging from [0,0] to [m-1,n-1].
  2 comentarios
Shan
Shan el 18 de Jul. de 2013
Yup, (x,y) in other programs is equivalent to (x+1,y+1) in Matlab. This has been driving me insane; thanks a bunch!
Evan
Evan el 18 de Jul. de 2013
No problem! Glad you got it resolved. :)

Iniciar sesión para comentar.

Más respuestas (2)

Image Analyst
Image Analyst el 17 de Jul. de 2013
I don't observe that problem. Never have. The value it displays (through a variety of means) is the value I see in Photoshop, or wherever. Why don't you make up a step wedge of, say 16 gray steps and post it? Tell us what the step values are, what you observe in MATLAB, and other programs for the 16 steps.

Jan
Jan el 18 de Jul. de 2013
Editada: Jan el 18 de Jul. de 2013
If I open the same image with imread and display the value of that same coordinate, it is different.
This is too vague to be reconsidered. I guess, the reason is found in the Matlab code, so please show us the corresponding code and provide a test image. Perhaps an interpolation happens in between to downsample the image to the screen resolution. Or the image is read in indexed colors, while LabView creates the colormap image implicitly.

Categorías

Más información sobre Startup and Shutdown 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!

Translated by