Info

This question is closed. Reopen it to edit or answer.

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

1 view (last 30 days)
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 Comments
uma
uma on 11 Apr 2020
Edited: darova on 11 Apr 2020
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))

Answers (1)

uma
uma on 12 Apr 2020
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))

Tags

Community Treasure Hunt

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

Start Hunting!