【图像处理】基于形状提取和模式匹配组合的面部特征点提取方法(Matlab代码实现)

 👨‍🎓个人主页:研学社的博客 

💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

📋📋📋本文目录如下:🎁🎁🎁

目录

💥1 概述

📚2 运行结果

🎉3 参考文献

🌈4 Matlab代码实现


💥1 概述

基于形状提取和模式匹配组合的面部特征点提取方法是一种常用于计算机视觉和图像处理的技术。以下是这种方法的基本步骤:

### 1. 预处理
   - **灰度化**:将彩色图像转换为灰度图像,以减少计算复杂度。
   - **直方图均衡化**:增强图像的对比度,突出面部特征。
   - **噪声去除**:应用高斯滤波或中值滤波等方法去除图像中的噪声。

### 2. 形状提取
   - **边缘检测**:使用Canny边缘检测算法或Sobel算子来检测图像中的边缘。
   - **轮廓检测**:利用边缘检测的结果,应用轮廓检测算法(如OpenCV中的findContours函数)来提取面部的主要轮廓。
   - **面部区域分割**:通过分析轮廓,分割出面部区域。

### 3. 特征点检测
   - **初步检测**:利用Haar特征或HOG特征结合分类器(如SVM或Adaboost)进行初步的面部特征点检测,通常用于检测眼睛、鼻子、嘴巴等主要特征点。
   - **形状模型**:使用主动形状模型(ASM)或主动外观模型(AAM)来对初步检测的结果进行精细化调整。这些模型依赖于预定义的特征点集合,通过迭代优化的方法,逐步调整特征点的位置,使其更加精确地符合面部的形状。

### 4. 模式匹配
   - **模板匹配**:对于一些固定形状的特征(如眼睛、嘴巴),可以预先构建模板,然后通过模板匹配的方法进一步优化特征点的位置。
   - **特征描述符匹配**:使用特征描述符(如SIFT、SURF、ORB等)对特征点进行描述,通过特征匹配算法(如BFMatcher或FLANN

文献来源:

[1] Y. Ohkawa, C. H. Suryanto, K. Fukui, "Fast Combined Separability Filter for Detecting Circular Objects", The twelfth IAPR conference on Machine Vision Applications (MVA) pp.99-103, 2011.

[2] K. Fukui, O. Yamaguchi, "Facial feature point extraction method based on combination of shape extraction and pattern matching", Systems and Computers in Japan 29 (6), pp.49-58, 1998.

本文包含来自[1]和[2]的算法的实现和使用示例,用于检测给定图像中的圆形对象。
[2] 中的算法称为可分离性滤波器,它通过滑动窗口在整个图像中使用圆形的掩模滤波器计算费舍尔准则。通过费舍尔准则的计算,我们得到了一个可分离性图,其中局部峰最有可能是圆形物体的中心。为了加快 [2] 的计算速度,[1] 的工作近似于具有四个组合矩形的圆形形状,并在计算中使用积分图像。详情请参考[1]和[2]。

📚2 运行结果

 

 

 

 

 

 

部分代码:

Im = imread('testimages/cheek.jpg');
gr = double(rgb2gray(Im));
figure(40);clf;
image(Im);
axis equal tight;
title('Original parts of face');

tic
circMap = zeros(size(gr,1),size(gr,2));
for nR = 8:2:12, %multiple scales of separability filter's size (radius)
    r=nR; % radius (please refer to [2])
    r1=nR; % inner circle radius (please refer to [2])
    r2=nR; % outer circle radius (please refer to [2])
    cMap = cvtCircleSepFilter(gr, r, r1, r2);
    circMap = max(circMap, cMap);
end
timerequired=toc;
fprintf('Time required: %g seconds\n',timerequired);

figure(41);clf;
subplot(1,2,1);
imagesc(cMap);
axis equal tight;
title('Separability map (circular filter)');

subplot(1,2,2);
image(imfuse(gr,cMap));
axis equal tight;
title('Fused image (circular filter)');

% find local peaks
nTH = 0.2; % threshold for local peaks 
S1 = imfuse(gr,cMap);
PL = cvtFindLocalPeakX(cMap,1,nTH);
for H=1:size(PL,2)
    % draw cross at each local peak (cross size is relative to the peak value)
    S1 = cvtDrawCross(S1, PL(2,H),PL(1,H),round(10*PL(3,H)),[255,255,255]);
end
figure(42);clf;
image(S1);
axis equal tight;
title(['Local peaks > ' num2str(nTH) ' (original circular filter)'],'fontweight','bold');

Im = imread('testimages/cheek.jpg');
gr = double(rgb2gray(Im));
figure(40);clf;
image(Im);
axis equal tight;
title('Original parts of face');

tic
circMap = zeros(size(gr,1),size(gr,2));
for nR = 8:2:12, %multiple scales of separability filter's size (radius)
    r=nR; % radius (please refer to [2])
    r1=nR; % inner circle radius (please refer to [2])
    r2=nR; % outer circle radius (please refer to [2])
    cMap = cvtCircleSepFilter(gr, r, r1, r2);
    circMap = max(circMap, cMap);
end
timerequired=toc;
fprintf('Time required: %g seconds\n',timerequired);

figure(41);clf;
subplot(1,2,1);
imagesc(cMap);
axis equal tight;
title('Separability map (circular filter)');

subplot(1,2,2);
image(imfuse(gr,cMap));
axis equal tight;
title('Fused image (circular filter)');

% find local peaks
nTH = 0.2; % threshold for local peaks 
S1 = imfuse(gr,cMap);
PL = cvtFindLocalPeakX(cMap,1,nTH);
for H=1:size(PL,2)
    % draw cross at each local peak (cross size is relative to the peak value)
    S1 = cvtDrawCross(S1, PL(2,H),PL(1,H),round(10*PL(3,H)),[255,255,255]);
end
figure(42);clf;
image(S1);
axis equal tight;
title(['Local peaks > ' num2str(nTH) ' (original circular filter)'],'fontweight','bold');

Im = imread('testimages/cheek.jpg');
gr = double(rgb2gray(Im));
figure(40);clf;
image(Im);
axis equal tight;
title('Original parts of face');

tic
circMap = zeros(size(gr,1),size(gr,2));
for nR = 8:2:12, %multiple scales of separability filter's size (radius)
    r=nR; % radius (please refer to [2])
    r1=nR; % inner circle radius (please refer to [2])
    r2=nR; % outer circle radius (please refer to [2])
    cMap = cvtCircleSepFilter(gr, r, r1, r2);
    circMap = max(circMap, cMap);
end
timerequired=toc;
fprintf('Time required: %g seconds\n',timerequired);

figure(41);clf;
subplot(1,2,1);
imagesc(cMap);
axis equal tight;
title('Separability map (circular filter)');

subplot(1,2,2);
image(imfuse(gr,cMap));
axis equal tight;
title('Fused image (circular filter)');

% find local peaks
nTH = 0.2; % threshold for local peaks 
S1 = imfuse(gr,cMap);
PL = cvtFindLocalPeakX(cMap,1,nTH);
for H=1:size(PL,2)
    % draw cross at each local peak (cross size is relative to the peak value)
    S1 = cvtDrawCross(S1, PL(2,H),PL(1,H),round(10*PL(3,H)),[255,255,255]);
end
figure(42);clf;
image(S1);
axis equal tight;
title(['Local peaks > ' num2str(nTH) ' (original circular filter)'],'fontweight','bold');

🎉3 参考文献

部分理论来源于网络,如有侵权请联系删除。

[1] Y. Ohkawa, C. H. Suryanto, K. Fukui, "Fast Combined Separability Filter for Detecting Circular Objects", The twelfth IAPR conference on Machine Vision Applications (MVA) pp.99-103, 2011.

[2] K. Fukui, O. Yamaguchi, "Facial feature point extraction method based on combination of shape extraction and pattern matching", Systems and Computers in Japan 29 (6), pp.49-58, 1998.

🌈4 Matlab代码实现

  • 32
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值