Unrecognized function or variable 'overload'. Error in repmat (line 13) b = overload(mfilename, a, m, n);

After opening Matlab, I am getting following error.
Unrecognized function or variable 'overload'.
Error in repmat (line 13)
b = overload(mfilename, a, m, n);
Error in matlab.supportpackagemanagement.internal.util.getInstalledSpPkgProducts (line 34)
packages = repmat(struct('BaseCode', '', ...
Error in matlab.supportpackagemanagement.internal.getInstalledSupportPackagesInfo (line 12)
packages = matlab.supportpackagemanagement.internal.util.getInstalledSpPkgProducts();
After running following script, getting error:
% Read the input image
inputImage = imread('FLIR0003.jpg'); % Replace 'your_image.jpg' with the path to your image
% Convert the input image to double precision
inputImage = double(inputImage);
% Compute color channels (R, G, B)
R = inputImage(:,:,1);
G = inputImage(:,:,2);
B = inputImage(:,:,3);
% Compute intensity (luminance)
I = (R + G + B) / 3.0;
% Compute color and intensity contrast
RContrast = abs(R - I);
GContrast = abs(G - I);
BContrast = abs(B - I);
% Combine color and intensity contrast to get saliency map
saliencyMap = (RContrast + GContrast + BContrast) / 3.0;
% Normalize the saliency map to the range [0, 1]
saliencyMap = (saliencyMap - min(saliencyMap(:))) / (max(saliencyMap(:)) - min(saliencyMap(:)));
% Display the original image and the saliency map
% subplot(1, 2, 1);
figure
imshow(inputImage);
title('Original Image');
%subplot(1, 2, 2);
% figure
imshow(saliencyMap, []);
title('Saliency Map');
Error-
Unrecognized function or variable 'overload'.
Error in repmat (line 11)
b = overload(mfilename, a, m);
Error in gobjects (line 94)
array = repmat(matlab.graphics.GraphicsPlaceholder(),dims);
Error in title (line 40)
hSub = gobjects(size(targets));
Error in sal_test (line 30)
title('Original Image');

3 Kommentare

"After running following script, getting error:"
There's nothing in the script that would generate the errors you got.
I am running your script with a sample image and it works properly, see below.
Importantly - What did you name your script?
% Read the input image
in = imread('peppers.png'); % Replace 'your_image.jpg' with the path to your image
% Convert the input image to double precision
inputImage = double(in);
% Compute color channels (R, G, B)
R = inputImage(:,:,1);
G = inputImage(:,:,2);
B = inputImage(:,:,3);
% Compute intensity (luminance)
I = (R + G + B) / 3.0;
% Compute color and intensity contrast
RContrast = abs(R - I);
GContrast = abs(G - I);
BContrast = abs(B - I);
% Combine color and intensity contrast to get saliency map
saliencyMap = (RContrast + GContrast + BContrast) / 3.0;
% Normalize the saliency map to the range [0, 1]
saliencyMap = (saliencyMap - min(saliencyMap(:))) / (max(saliencyMap(:)) - min(saliencyMap(:)));
% Display the original image and the saliency map
% subplot(1, 2, 1);
figure
imshow(in);
title('Original Image');
%subplot(1, 2, 2);
% figure
imshow(saliencyMap, []);
title('Saliency Map');
Thanks.
name of file is 'ex11.m'.
Still getting same error with the image 'peppers.png'
Unrecognized function or variable 'overload'.
Error in repmat (line 11)
b = overload(mfilename, a, m);
Error in gobjects (line 94)
array = repmat(matlab.graphics.GraphicsPlaceholder(),dims);
Error in title (line 40)
hSub = gobjects(size(targets));
Error in ex11 (line 30)
title('Original Image');
Is the code you have posted above the whole code?
If not, then post the whole code.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte

Version

R2023a

Gefragt:

am 14 Sep. 2023

Kommentiert:

am 14 Sep. 2023

Community Treasure Hunt

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

Start Hunting!

Translated by