Not enough input arguments.

1 Ansicht (letzte 30 Tage)
oumi k
oumi k am 23 Mär. 2022
Kommentiert: oumi k am 24 Mär. 2022
THIS ERROR APPEARS : Error using Quant_gray (line 3) --> if I(i,j)~= fmax; %I(i,j) not equal to fmax Not enough input arguments.
  2 Kommentare
Image Analyst
Image Analyst am 23 Mär. 2022
What does this say
>> which -all I
oumi k
oumi k am 23 Mär. 2022
I think the problem was with running the function script instead of the main script itself

Melden Sie sich an, um zu kommentieren.

Antworten (1)

yanqi liu
yanqi liu am 24 Mär. 2022
clc; clear all; close all;
I=imread('football.jpg');
if ndims(I)==3
I = rgb2gray(I);
end
imshow(I);
N=16; %niveau de quantification change to 4,8,16...128
[L,W]= size(I);
fmin=min(min(I)); % for 2D matrix of data (vector utilisation)
fmax=max(max(I));
q=(fmax-fmin)/N; % pas de quantification
for i=1:L
for j=1:W
[quant]=Quant_gray(I,N,q,fmax,fmin,i,j);
I(i,j)=quant;
end
end
% figure; imshow(I, []);
function [quant] = Quant_gray( I,N,q,fmax,fmin,i,j )
if I(i,j)~= fmax %I(i,j) not equal to fmax
quant= [I(i,j)*(fmax-fmin)/q]/N-1;
quant= floor(quant);
else
quant=N-1; % I(i,j)=fmax
end
end
  1 Kommentar
oumi k
oumi k am 24 Mär. 2022
Thank you for your answer. The problem was that I was running the function alone from the function script instead of the main script page itself.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Matrix Indexing 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