⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classify_img.m

📁 Information Fusion of Flash and Non-Flash Images (Project)
💻 M
字号:
function [res_img] = classify_img(rgb_img, t_inds,tol);
% uses SINGLE cube for background
%convert to YCbCr- this has less covariance
ycc_img = double(rgb2ycbcr(rgb_img));
[M N P] = size(rgb_img);
Y_img = reshape(scaleData(ycc_img(:,:,1),0,1),M*N,1);
CB_img = reshape(scaleData(ycc_img(:,:,2),0,1),M*N,1);
CR_img = reshape(scaleData(ycc_img(:,:,3),0,1),M*N,1);

%train..
tdata = [Y_img(t_inds), CB_img(t_inds), CR_img(t_inds)];
tcube = getCube(tdata);

%now classify
img_data = [Y_img, CB_img, CR_img];
resvec = fuzzy_classify(img_data,tcube,tol);
%results(t_inds) = 2;
res_img1 = reshape(resvec,M,N);
res_img = medfilt2(res_img1);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -