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