Hi,
This is my first post on here, i hope ive put it in the right area.
Basically, i dont seem able to use im2double, when ever i try and use it, i get the error message Undefined function or variable 'im2double. Ive checked to see if i have the Image Processing Toolbox installed and i do but the function does not seem to be there. Im trying to convert a uint8 image to double precision .
Im very new to MatLab and most probably making a newbi mistake but you help would be appreciated.
Thanks

4 Commenti

  1. Check if you have license for the image toolbox (via your account on this website).
  2. Tell us what the output of this comand is:
which im2double -all
madhan ravi
madhan ravi il 24 Nov 2018
upload the code that your trying with all the necessary details without a need to ask datas for the second time
Robert Featherstone
Robert Featherstone il 24 Nov 2018
Thanks for the reply Stephen. Using your command i get the below reply
D:\MATLAB\R2018b\toolbox\matlab\bigdata\@tall\im2double.m % tall method D:\MATLAB\R2018b\toolbox\distcomp\parallel\@codistributed\im2double.m % codistributed method D:\MATLAB\R2018b\toolbox\distcomp\gpu\@gpuArray\im2double.m % gpuArray method
Robert Featherstone
Robert Featherstone il 24 Nov 2018
Thanks for your reply Madhan. The code im using im2double in is below
I = rgb2gray(I); J = 255*im2double(I); mi = min(min(J)); ma = max(max(J)); for row = 1 :size(J,1) for col = 1:size(J,2) J1(row,col) = [0 2 3 6 6 6 7 7]; end end J1 = im2uint8(J1/255);

Accedi per commentare.

 Risposta accettata

Image Analyst
Image Analyst il 24 Nov 2018
Try this:
% Check that user has the specified Toolbox installed and licensed.
hasLicenseForToolbox = license('test', 'image_toolbox') % Check for Image Processing Toolbox.
ver
which -all im2double
What do you see? Take your license number out when you post the results back here.
It's possible you have it installed but don't have a license for it. For example if you are in a shared license pool and all the licenses are checked out to other users who are currently using it.

12 Commenti

Stephan
Stephan il 24 Nov 2018
Modificato: Stephan il 24 Nov 2018
The release tag setted by the OP says he works on R2018b. Documentation of 2018b says this is a basic Matlab function. The function is no more part of Image Processing Toolbox starting from R2014b.
Robert Featherstone
Robert Featherstone il 24 Nov 2018
This is what i get image Analyst
MATLAB Version: 9.5.0.944444 (R2018b) MATLAB License Number: ****** Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 17134) Java Version: Java 1.8.0_152-b16 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode MATLAB Version 9.5 (R2018b) Simulink Version 9.2 (R2018b) Computer Vision System Toolbox Version 8.2 (R2018b) Control System Toolbox Version 10.5 (R2018b) DSP System Toolbox Version 9.7 (R2018b) Data Acquisition Toolbox Version 3.14 (R2018b) Deep Learning Toolbox Version 12.0 (R2018b) GPU Coder Version 1.2 (R2018b) Image Acquisition Toolbox Version 5.5 (R2018b) Image Processing Toolbox Version 10.3 (R2018b) Instrument Control Toolbox Version 3.14 (R2018b) MATLAB Coder Version 4.1 (R2018b) Mapping Toolbox Version 4.7 (R2018b) Optimization Toolbox Version 8.2 (R2018b) Parallel Computing Toolbox Version 6.13 (R2018b) Signal Processing Toolbox Version 8.1 (R2018b) Simulink Control Design Version 5.2 (R2018b) Statistics and Machine Learning Toolbox Version 11.4 (R2018b) Symbolic Math Toolbox Version 8.2 (R2018b) D:\MATLAB\R2018b\toolbox\matlab\bigdata\@tall\im2double.m % tall method D:\MATLAB\R2018b\toolbox\distcomp\parallel\@codistributed\im2double.m % codistributed method D:\MATLAB\R2018b\toolbox\distcomp\gpu\@gpuArray\im2double.m % gpuArray method
Walter Roberson
Walter Roberson il 24 Nov 2018
looks like an installation issue . Reinstall matlab
Robert Featherstone
Robert Featherstone il 24 Nov 2018
I'll give it a go Walter. Thanks
How did it go? It looks like you have it so your script should see it, unless it's no longer on the path for some reason. If you haven't reinstalled yet, try this:
>> restoredefaultpath
>> savepath
Robert Featherstone
Robert Featherstone il 25 Nov 2018
Sorry for the late reply. I uninstalled the Image processing toolbox and reinstalled, still no im2double.
@Robert Featherstone: have you changed the MATLAB Search Path? Have you installed any third-party toolboxes or functions or classes that might have changed the Search Path?
Please show us the complete output of this command:
which im2double -all
Robert Featherstone
Robert Featherstone il 25 Nov 2018
Steven, i havent installed any third party toolboxes, classes or functions, as for the file path, anything is possible with me lol.
This is the results from which im2double -all
D:\MATLAB\R2018b\toolbox\matlab\bigdata\@tall\im2double.m % tall method D:\MATLAB\R2018b\toolbox\distcomp\parallel\@codistributed\im2double.m % codistributed method D:\MATLAB\R2018b\toolbox\distcomp\gpu\@gpuArray\im2double.m % gpuArray method
For some reason I can't format your code above as code because it's all on one line. I'm wondering if there is some unprintable character there. Can you attach your m-file with the paper clip icon instead?
Also, are you on Windows or Max or Ubuntu?
And what does this do
>> d = im2double(uint8(8));
Any error message? If so, please copy and paste all the red text back here and format it as code.
Robert Featherstone
Robert Featherstone il 25 Nov 2018
Again, sorry for the late reply. Please try and resisit the temptaion to mentally slap me. I have MatLab installed on my laptop, i simply emailed myself the im2double function and stored it in my working directory. Im still unsure of how the function disappeared in the first place, but thanks for all your help. As mentioned, im very new to MatLab and struggling with it. Im in my third year of a Computer Science degree studying as a (very) mature student.
To answer your question Image Analyst, im running Windows 10 pro.
Not sure if i can ask this here or need to start a new thread but, if you guys could point me to any information regarding interpolation, Object Recognition, or Shape Description, I would be eternally grateful. I would prefer information that thats erm, dumbed down for us old folk if possible.
Thanks for all your help guys.
Image Analyst
Image Analyst il 25 Nov 2018
I don't see how emailing the file to you and then saving it over the original file you emailed to yourself would fix it, but whatever...
See attached shape recognition demo.
Also see my My File Exchange, particularly the Image Segmentation Tutorial.
Feel free to ask different questions in new threads.
Robert Featherstone
Robert Featherstone il 25 Nov 2018
Sorry Image Analyst, in my haste to reply, i forgot to mention im2double was not working on my desktop MatLab. I emailed the function to myself from my laptop, then saved it in my working directory on the desktop.

Accedi per commentare.

Più risposte (0)

Prodotti

Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by