Image is not displayed using imshow (Digital Image Processing)

Hello All,
I am new to the Digital Image processing using MATLAB. I tried one simple example given in the tutorials but I am not getting any output. So can somebody please tell me where am I going wrong? Code is as follows:
I = imread('COMSOL Model.jpg');
imshow(I);
The file which is supposed to display is also attached. I am getting empty plot/figure after running this code. So can somebody tell me what is going wrong here?

4 件のコメント

CS Researcher
CS Researcher 2016 年 5 月 2 日
Cannot replicate the problem here. It works for me. Do you get any errors? Try restarting MATLAB.
Nikhil
Nikhil 2016 年 5 月 2 日
Hey, Thanks for reply, I am using MATLAB R2014b. I am getting following messages in command window when I run this code.
Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Profile GL_DEFAULT is not available on WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]], but: []
at javax.media.opengl.GLProfile.get(GLProfile.java:901)
at javax.media.opengl.GLProfile.getDefault(GLProfile.java:632)
at javax.media.opengl.GLCapabilities.<init>(GLCapabilities.java:84)
at com.mathworks.hg.peer.JavaSceneServerPeer.getCaps(JavaSceneServerPeer.java:147)
at com.mathworks.hg.peer.JavaSceneServerPeer.doCreateCanvas(JavaSceneServerPeer.java:676)
at com.mathworks.hg.peer.JavaSceneServerPeer.access$200(JavaSceneServerPeer.java:50)
at com.mathworks.hg.peer.JavaSceneServerPeer$2.run(JavaSceneServerPeer.java:650)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Profile GL_DEFAULT is not available on WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]], but: []
at javax.media.opengl.GLProfile.get(GLProfile.java:901)
at javax.media.opengl.GLProfile.getDefault(GLProfile.java:632)
at javax.media.opengl.GLCapabilities.<init>(GLCapabilities.java:84)
at com.mathworks.hg.peer.JavaSceneServerPeer.getCaps(JavaSceneServerPeer.java:147)
at com.mathworks.hg.peer.JavaSceneServerPeer.doCreateCanvas(JavaSceneServerPeer.java:676)
at com.mathworks.hg.peer.JavaSceneServerPeer.access$200(JavaSceneServerPeer.java:50)
at com.mathworks.hg.peer.JavaSceneServerPeer$2.run(JavaSceneServerPeer.java:650)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Image Analyst
Image Analyst 2016 年 5 月 2 日
I'd call the Mathworks on that one. Of course, why don't you just try upgrading to R2016a?
CS Researcher
CS Researcher 2016 年 5 月 2 日
It seems the OpenGL drivers of your system are outdated. Restart MATLAB and try to plot again. If you still get the same error, try plotting a basic plot. if it does not work, you might have to upgrade your drivers.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

質問済み:

2016 年 5 月 2 日

コメント済み:

2016 年 5 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by