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

📄 drawrec.m

📁 本程序主要是为对人脸检测有兴趣人士提供一种参考例子
💻 M
字号:
% Version : 4.1
% Author  : Omid Bonakdar Sakhi

function out = drawrec (in,w)

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% This function will draw a 27x18 rectangle 
% Inputs are an image 'in' abd w is a binary image same size as the input
% image , in the binary image each 1 is the center of a rectangle and the
% function leaves zeros alone.
%

[m n]=size(in);
[LUTm LUTn]=find(in);
out = zeros (m,n);
for i =1:size(LUTm,1)
    out (LUTm(i),LUTn(i))=0;
    out (LUTm(i)-14:LUTm(i)+13,LUTn(i)-9)=1;
    out (LUTm(i)-14:LUTm(i)+13,LUTn(i)+8)=1;
    out (LUTm(i)-14,LUTn(i)-9:LUTn(i)+8)=1;
    out (LUTm(i)+13,LUTn(i)-9:LUTn(i)+8)=1;
end

⌨️ 快捷键说明

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