从深度提取剪影 [英] silhouette extraction from depth

查看:196
本文介绍了从深度提取剪影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我有深度图像,我想从中提取人(人)轮廓。我像这样使用像素阈值:

  for i = 1:240 
for j = 1:320
如果b(i,j)> 2400 || b(i,j)< 1900
c(i,j)= 5000;
else
c(i,j)= b(i,j);
结束
结束
结束

但还剩下一部分。有没有办法删除它?



Original_image:



Extracted_silhouette:

解决方案

根据。


Hello I have a depth image, I want to extract the person(human) silhouette from that. I used pixel thresholding like this:

for i=1:240 
  for j=1:320 
    if b(i,j)>2400 || b(i,j)<1900 
      c(i,j)=5000; 
    else 
      c(i,j)=b(i,j); 
    end 
  end
end

but there is some part left. Is there any way to remove that?

Original_image:

Extracted_silhouette:

解决方案

According to this thread depth map boundaries can be found based on the direction of estimated surface normals.
To estimate the direction of the surface normals, you can

[dzx dzy] = gradient( depth_map ); %// horizontal and vertical derivatives of depth map
n = cat( 3, dzx, dzy, ones(size(dzx)) );
n = bsxfun( @rdivide, n, sqrt( sum( n.^2, 3 ) ) ); %// normalize to unit length

A simple way would be to threshold

e = abs( n(:,:,3) ) < 1e-2;

Resulting with

A more sophisticated method of deriving silhouette from boundary can be found in this answer.

这篇关于从深度提取剪影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆