i am encountering this error on below mention code Undefined function or variable 'greenchannel'. Error in bidemo (line 47) [Gout]=bil​ateral_eac​h_channel(​w,sigma_r,​sigma_d,gr​eenchannel​);

%%Clear everything
clear all;
close all;
clc;
v = VideoReader('peng.mp4');
tic
numFrames = v.NumberOfFrames;
k=1;
while k<=numFrames
frame=read(v,k);
frame=imresize(frame,[256 256]);
frame=double(frame);
[a b z]=size(frame);
frame = frame/255.0;
% Extract the individual red, green, and blue color channels.
redChannel = frame(:, :, 1);
greenChannel = frame(:, :, 2);
blueChannel = frame(:, :, 3);
sigma = 0.1; %noise standard deviation
xr = redChannel + sigma*randn(size(redChannel));
xg = greenChannel + sigma*randn(size(greenChannel));
xb = blueChannel + sigma*randn(size(blueChannel));
noisyRGB = cat(3,xr,xg,xb);
w=9; % window size
sigma_d=1;
sigma_r=30;
tic;
[Rout]=bilateral_each_channel(w,sigma_r,sigma_d,redChannel);
[Gout]=bilateral_each_channel(w,sigma_r,sigma_d,greenchannel);
[Bout]=bilateral_each_channel(w,sigma_r,sigma_d,bluechannel);
frame(:,:,1)=(Rout);
frame(:,:,2)=(Gout);
frame(:,:,3)=(Bout);
rgbFixed = cat(3, redMF,greenMF,blueMF);
imshow([frame,noisyRGB,rgbFixed],[0,1])
k=k+1;
end
finalpsnr1=avgPSNR1/numFrames
% finalpsnr2=avgPSNR2/numFrames
toc

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Labels and Annotations 的更多信息

产品

版本

R2015a

标签

Community Treasure Hunt

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

Start Hunting!

Translated by