-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
請,我們需要您的最低質量的努力。閱讀[問] –