plz help me to understand this loop

for color_idx=1:3
img_tmp = img_in_lin(:,:,color_idx);
img_tmp = img_tmp(textureless_map);
% Estimate the veiling-light to be the median value in the region.
A(color_idx) = img_tmp(idx_median);
end

Answers (1)

for color_idx=1:3 % loop for each color channel Red, Blue, GReen
img_tmp = img_in_lin(:,:,color_idx); % This extracts the color channel
img_tmp = img_tmp(textureless_map); % From the color channle pick the pixel values at indices textureless_map
% Estimate the veiling-light to be the median value in the region.
A(color_idx) = img_tmp(idx_median);
end

Categories

Find more on Images in Help Center and File Exchange

Asked:

on 25 Sep 2018

Answered:

on 25 Sep 2018

Community Treasure Hunt

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

Start Hunting!