How can I solve that imshow don't show image ?

18 views (last 30 days)
I just find out that imshow shows nothing in my Matlab. I used imwrite to save the same data as .jpg, then check it by opening it in the folder, the result is correct. What happened to imshow and how to fix it?
  6 Comments
Cody Chan
Cody Chan on 9 Feb 2018
Sorry for confusing, "imshow" worked well last time. After few days when I started the other project, "imshow" shows nothing. No matter what picture for imread.
I understand what shadowing means, but I didn't have the same function named "imshow".
Jan
Jan on 9 Feb 2018
@Cody: It need not be imshow directly, but it can matter all other functions, which are called from imshow.

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 9 Feb 2018
Like Jan said, you're probably overwriting a function in one of your scripts. I believe imshow() calls image() internally, and lots of beginners call their image variable "image" which might prevent imshow from working because it will try to use your variable rather than the function.
Like Geoff said, attach your if you need more help.
  6 Comments
Arusha cse
Arusha cse on 6 Jun 2020
Hi, have you found a solution to this? I am facing the same issue and my functions are not shadowed.
Image Analyst
Image Analyst on 6 Jun 2020
Arusha, start your own question but only after you read this link so we don't waste time going back and forth to get all the info we need to solve your situation. For example, here you dodn't show any error messages or screenshots of what your call to imshow() actually shows. Maybe you have a floating point image outside the range of 0-1 and it's just all black or white because you forgot to use [] when you called imshow.
imshow(doubleImage, []);
I have no idea because you didn't give us enough information to help you. You only asked Cody who hasn't been seen here in over 2 years.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!