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

7 次查看(过去 30 天)
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?

采纳的回答

dpb
dpb 2020-8-14
移动:DGM 2023-5-15
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 个评论
Mia Giallorenzi
Mia Giallorenzi 2020-8-14
移动:DGM 2023-5-15
Thank you! I reinstalled the Toolbox and now it is working!
dpb
dpb 2020-8-14
移动:DGM 2023-5-15
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by