Is there a fix for truesize?

2 次查看(过去 30 天)
Lawrence
Lawrence 2015-4-21
回答: Lawrence 2015-4-22
truesize stopped working a couple weeks ago in 2014b the same day I did a Java Update. Upgrading to 2015a did not fix it. This on Mac OS 10.10.2, Java 8 update 45. Here is code:
>> a = randn(256);
>> imagesc(a)
>> truesize
Undefined variable "images" or class "images.internal.initSize".
Error in truesize (line 48)
images.internal.initSize(imHandle, 1, isBorderTight);
>>
Anyone know of a fix? Or should I try to downgrade Java?

回答(2 个)

Image Analyst
Image Analyst 2015-4-21
I never have gotten that to work. For example, in the following code, nothing at all happens to the displayed image when you call truesize.
grayImage = imread('concordorthophoto.png');
imshow(grayImage);
truesize
grayImage = imread('cameraman.tif');
imshow(grayImage);
truesize
I brought this up to the Mathworks team and they told me to use a scrollpanel if I wanted to show an image pixel-for-pixel. See attached demo.
  2 个评论
Lawrence
Lawrence 2015-4-22
Thank you. Unfortunately, seems like there are bigger problems with my installation. imshow is not found (despite verifying that IPT folders are on the path - and I moved them to the top of the path). And then there's this:
>> imtool(a) The class "images.internal" is undefined. Perhaps Java is not running.
Error in imtool (line 172) if ~images.internal.isFigureAvailable()
So it seems like the problem is that the Java "upgrade" does not have the images class. grr.
Image Analyst
Image Analyst 2015-4-22
I don't know about any of that. Since you have a version of MATLAB within a year old, you should still have tech support so call them. But before that, just try downloading R2015a. It now has imshow() built in to base MATLAB, though it should have worked with R2014b since you have the Image Processing Toolbox.

请先登录,再进行评论。


Lawrence
Lawrence 2015-4-22
Apparently it was a path issue, but I'm still not sure how the path got corrupted. Mathworks tech support had the fix though:
>> restoredefaultpath
>> rehash toolboxcache
All is well.

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by