Why is imshow() not showing my image correctly?

I'm using glxa64 Matlab R 2014a on Ubuntu 14.04. Often, the following code:
>> im = imread('test/1_crop.png');
>> figure; imshow(im)
Will produce this:
Whereas the original image is:
imagesc() always shows the correct image. Also, I've observed that resizing the imshow() window produces unpredictable changes - some resizes make it look correct, some resizes make it go wrong again.
Does anybody have any ideas about why this happens?
Thanks!

5 comentarios

Image Analyst
Image Analyst el 3 de Oct. de 2014
You forgot to attach your image. So what can we say?
Samarth Manoj Brahmbhatt
Samarth Manoj Brahmbhatt el 3 de Oct. de 2014
Editada: Samarth Manoj Brahmbhatt el 3 de Oct. de 2014
No. I inserted them in the question. Aren't they visible to you when you see the question on Matlab Answers? They are to me. Sorry for saying 'attached' when I meant 'inserted'. If you use something else than Matlab Answers website to access the questions, I've attached them with this comment.
Image Analyst
Image Analyst el 3 de Oct. de 2014
No. You inserted screenshots of figures of the image displayed in an axes - you did not attach the actual "test/1_crop.png" itself. I can't test your image with screenshots.
Issue does not depend on the image itself; I'm sure you can understand that much.
Image Analyst
Image Analyst el 4 de Oct. de 2014
No I could not understand that much, because it doesn't happen with me or anyone else that I've heard of, for images in general. That's why I thought it might be something specific to that particular image . But now you say that imshow() never, ever works for you, for any image whatsoever. So in that case you need to call tech support.

Iniciar sesión para comentar.

 Respuesta aceptada

Anand
Anand el 3 de Oct. de 2014

1 voto

You should contact Tech Support about this question. I have a feeling it may have to do with the graphics driver, but that's just a guess.

3 comentarios

I use the proprietary fglrx driver for ATI graphics cards. But the fact that imagesc() works nicely and imshow() does not, tells me it is something Matlab specific.
I contacted Tech support. After a bit of troubleshooting they determined that the problem was with the 'painters' rendering engine, which behaves weirdly when you have 'axis off'. They suggested that upgrading to R2014b might solve this problem, since it has a new rendering engine.
Marco
Marco el 10 de Oct. de 2014
Editada: Marco el 10 de Oct. de 2014
Hopefully. Because I have the identical problem using 2014a! Zooming (with the magnifier button of the figure window) is a kind of lottery, sometimes it works, sometimes it looks just wrong until I zoom forth or back to another magnification value, sometimes the figure (the presentation, not the buttons or window itself) even freezes and I have to make a new figure to be able to continue with inspection of my image.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 3 de Oct. de 2014

Editada:

el 10 de Oct. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by