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

조회 수: 8 (최근 30일)
Mia Giallorenzi
Mia Giallorenzi 2020년 8월 14일
이동: DGM 2023년 5월 15일
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