-4
算法BLUE-白色的面纱DETECTION如何在MATLAB中为以下算法编写if-else条件语句?
**for** each pixel in extracted region do
**if** R > 90 and R > B and R > G then
Mark the pixel as **healthy skin**.
**else**
Ignore the pixel and continue.
**end if
end for**
Set R¯s as the mean of red channel values for pixels marked
healthy skin.
**for** each pixel in the image **do**
nB = B/R+G+B
rR = R/R¯s
**if** nB ≥ 0.3 and −194 ≤ rR < −51 then
Classify pixel as veil
**else**
Classify pixel as non-veil
**end if
end for**
我已经执行的algorith即像素成健康皮肤或非健康的皮肤分类的第一部分。如何与第二部分相提并论?
clc;
clear all;
colorSkin=imread('veil.jpg'); %original image
% colorSkin=imresize(a, [384 512]);
[m, n]=size(colorSkin);
hs = colorSkin; %initialising heaklthy skin array
nhs = colorSkin; %initialising non-healthy skin array
R = colorSkin(:, :, 1);
G = colorSkin(:, :, 2);
B = colorSkin(:, :, 3);
ROI = R > 95 & R > B & R > G;
ROI3 = ROI(:,:,[1 1 1]);
hs(~ROI3) = 0;
nhs(ROI3) = 0;
当我尝试使用下面的命令来实现该算法的第二部分:
> nB=B(hs)./(R(hs)+B(hs)+G(hs));
我得到那个说错误“下标指标必须是真正的正整数或逻辑值。”
您需要。 1)学习MATLAB。 2)参考以前的答案。这是我从你甚至没有接受的答案中得到的代码。 –
[如何使用MATLAB从皮肤图像中提取蓝色遮罩特征]可能的重复(http://stackoverflow.com/questions/42352564/how-to-extract-the-blue-veil-feature-from-skin -images-in-using-matlab) – Adriaan
请,我们需要您的最低质量的努力。阅读[问] –