Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

# Index in position 1 exceeds array bounds (must not exceed 1). please do help to fix this error.

1 visualizzazione (ultimi 30 giorni)
uma il 11 Apr 2020
Chiuso: MATLAB Answer Bot il 20 Ago 2021
for y=0:0.1:1
if y(i,j)<=0.5
p(i,j)=2*(y(i,j)^2);
else
p(i,j)=1-2*((1-y(i,j))^2);
end
end
end
end
figure, imshow(p)
##### 3 CommentiMostra 1 commento meno recenteNascondi 1 commento meno recente
uma il 11 Apr 2020
Modificato: darova il 11 Apr 2020
why the output image is blank
imshow(a)
b=rgb2gray(a);
figure,imshow(b);
c=b(:);
lem=225;
minim=min(c(:));
maxim=max(c(:));
[m,n]=size(b);
x=zeros(1,225);
q=zeros(1,225);
w=zeros(1,225);
r=zeros(1,225);
E=zeros(1,225);
u=zeros(1,225);
for i=1:m
for j=1:n
g=b(i,j);
x(i,j)=((g-minim)/(maxim-minim));
q(i,j)=((1+lem)*x(i,j))/(1+lem*x(i,j));
w(i,j)=(1-x(i,j))/(1+(3*lem*x(i,j))+(lem^2*x(i,j))+x(i,j));
r(i,j)=1-q(i,j)-w(i,j);
E(i,j)=(1/x(i,j))*(sum(sum(r(i,j)*exp(1-r(i,j)))));
u(i,j)=maxim*(E(i,j)+lem);
t(i,j)=q(i,j)^1.25;
y(i,j)=1-t(i,j);
if y(i,j)<=0.5
p(i,j)=2*(y(i,j)^2);
else
p(i,j)=1-2*((1-y(i,j))^2);
end
end
end
enhanceimage=y(i,j)*p(i,j);
figure, imshow(unit8(enhanceimage))
darova il 11 Apr 2020

### Risposte (1)

uma il 12 Apr 2020
imshow(a)
b=rgb2gray(a);
figure,imshow(b);
c=b(:);
lem=225;
minim=min(c(:));
maxim=max(c(:));
[m,n]=size(b);
x=zeros(1,225);
q=zeros(1,225);
w=zeros(1,225);
r=zeros(1,225);
E=zeros(1,225);
u=zeros(1,225);
for i=1:m
for j=1:n
g=b(i,j);
x(i,j)=((g-minim)/(maxim-minim));
q(i,j)=((1+lem)*x(i,j))/(1+lem*x(i,j));
w(i,j)=(1-x(i,j))/(1+(3*lem*x(i,j))+(lem^2*x(i,j))+x(i,j));
r(i,j)=1-q(i,j)-w(i,j);
E(i,j)=(1/x(i,j))*(sum(sum(r(i,j)*exp(1-r(i,j)))));
u(i,j)=maxim*(E(i,j)+lem);
t(i,j)=q(i,j)^1.25;
y(i,j)=1-t(i,j);
if y(i,j)<=0.5
p(i,j)=2*(y(i,j)^2);
else
p(i,j)=1-2*((1-y(i,j))^2);
end
end
end
enhanceimage=y(i,j)*p(i,j);
figure, imshow(unit8(enhanceimage))
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Questa domanda è chiusa.

### Community Treasure Hunt

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

Start Hunting!

Translated by