Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 1 (최근 30일)
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
uma
uma 2020년 4월 11일
편집: darova 2020년 4월 11일
why the output image is blank
a=imread('F:\danu\IMG_20161030_121915.jpg');
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))

답변 (1개)

uma
uma 2020년 4월 12일
a=imread('F:\danu\IMG_20161030_121915.jpg');
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))

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by