Why am I getting the error "Cannot find builtin function '_grayto16'"?

8 Ansichten (letzte 30 Tage)
I am trying to run the code:
% Convert the stack of RAW images to int16 for export
images2 = im2uint16(images(:,:,:)/(2^16-1));
Images is a stack of RAW images and each individual image matrix has already been converted to type double.
However, when I run it I get this error message:
Error using builtin
Cannot find builtin function '_grayto16'
Error in im2uint16 (line 65)
u = builtin("_grayto16", img);
Error in RawExtractRGB (line 43)
images2 = im2uint16(images(:,:,:)/(2^16-1));
What do I need to do to get the builtin function '_grayto16' working?

Akzeptierte Antwort

dpb
dpb am 14 Aug. 2020
Verschoben: DGM am 15 Mai 2023
Try clear and then try again -- if you've inadvertentedly created a variable of same name this will get rid of it...
If that doesn't work, try rehash tollboxcache if something has munged the path/cached files in toolbox.
Failing that, if a restart of MATLAB doesn't resolve the problem may need to reinstall the Image Processing Toolbox.
  2 Kommentare
Mia Giallorenzi
Mia Giallorenzi am 14 Aug. 2020
Verschoben: DGM am 15 Mai 2023
Thank you! I reinstalled the Toolbox and now it is working!
dpb
dpb am 14 Aug. 2020
Verschoben: DGM am 15 Mai 2023
Glad to hear...be careful to not make names of things in the Toolbox and to also be sure to not be writing into MATLABPATH directories...
It's possible to inadvertentedly open supplied m-files in the editor by clicking on an error message or the debugger may stop internally and open a file -- if then do something unwittingly in one of those files, that can cause problems. That's one bad thing that comes along with the nice things about having m-files that can see.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by