why this code can't run in my PC but can run in another. it show error about "Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters"

2 次查看(过去 30 天)
R=imread('test.png');
R=rgb2gray(R);
figure(1); imshow(R);
F=[0:255];
gamma1=0.6;
G1=(round(255*(F/255).^gamma1)
gamma2=0.4;
G2=(round(255*(F/255).^gamma2)
R2=uint8(zeros(size(R)));
R3=uint8(zeros(size(R)));
for i=1:numel(R)
R2(i)=G1(R(i)+1);
R3(i)=G2(R(i)+1);
end
figure(2); imshow(R2,[]);
figure(3); imshow(R3);
figure(4); plot(F,G1); xlabel('f(r,c)');ylabel('g(r,c)');
hold on
plot(F,G2);

回答(1 个)

Sudhakar Shinde
Sudhakar Shinde 2020-11-3
Looks like bracket close ')' missing for G1 & G2:
G1=(round(255*(F/255).^gamma1))
G2=(round(255*(F/255).^gamma2))

类别

Help CenterFile Exchange 中查找有关 Gamma Functions 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by