简单的Kinect前景抠图

第四章 利用Kinect抠图和自动拍照程序 第四章  利用Kinect抠图和自动拍照程序   在本篇博客中,我将详细介绍Kinect的一种特殊数据源,BodyIndex(人物索引二值图),Kinect就是利用这个数据源来区分目标是人体还是其他物体,有没有觉得功能很强大。说到这里,很多朋友就应该会想到如何利用Kinect去抠图了,主要是依靠这个数据源,把 Kinect获取的图像中的人体和其他物体(主要是背景)区分开来。另外一点是关于自动拍 阅读详情


    这个是用Kinect做三维扫描时的第一步,就是将感兴趣的前景部分取下来。大家都知道,Kinect的最大特点就是可以采集到深度数据,利用深度数据就可以将前景和背景区分开来。

    长话短说,先上效果图吧。

 

再上源代码:

 

/***************************************
* Description:This program can rebuild  
* models by scanning objects with kinect
*
* Methods of application:
* 
*
* Author:Lixam
* Time:2012-11
****************************************/
#include "stdafx.h"

#include <XnCppWrapper.h> 
#include <opencv/highgui.h>
#include <opencv/cv.h>
#include <vector>
using namespace cv;
using namespace xn;
using namespace std;


#define IMAGEWIDTH 640
#define IMAGEHEIGTH 480

typedef struct 
{
	unsigned char R;
	unsigned char G;
	unsigned char B;
}RGBPIXEL;

typedef struct 
{
	unsigned char data_L;	//Low bits 
	unsigned char data_H;	//Heigh bits
}DEPTHPIXEL;

//Generator  
ImageGenerator m_imageGenerator;
DepthGenerator m_depthGenerator;
Context m_context;

/*************************************************************************
 *
 * GetROIdata()
 *
 * Parameters:
 *
 * IplImage* image		- Source of color image data
 * IplImage* depth		- Source of
关于Kinect根据深度图对齐彩色图抠人比彩色图像人大的问题 我根据Kinect自带的那个绿色抠人Demo,大家有没有发现抠出来的人比彩色图像中人变大了,该Demo是根据一个函数NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution来对齐,导致我根据帧差法得到的前景图无法与抠出人的大小对齐,因此无法修复抠出来人边缘的抖动。下面,我介绍一个函数MapColorFrameToDept 阅读详情

相关推荐

使用Kinect 2.0进行深度学习抠图技术研究与实现

Kinect 2.0作为Microsoft推出的第二代体感设备,它不仅仅是一次简单的升级,更是用户体验的一次飞跃。其改进的传感器技术、高级的视觉功能、以及更加丰富的编程接口,共同构建了一个强大的体感计算平台。它不仅推动了体感游戏的进化,也为科研、教育、医疗等多个领域提供了新的思路和可能。了解Kinect 2.0的技术细节对于推动相关领域的创新至关重要。本章将对Kinect 2.0的技术背景、核心功能和应用潜力进行全面概述。Kinect 2.0相较于前代产品,其在硬件和软件两个方面都做了大幅度的改进。

weixin_42583683的博客 828

Kinect v2实时抠图程序实战项目

计算机视觉作为一门跨学科的领域,融合了计算机科学、人工智能、数学、物理学和认知科学等多种技术,致力于使机器能够从图像或视频中解释并理解视觉信息。它的发展历程可以追溯到20世纪50年代,那时的研究主要集中在如何用计算机解析简单的视觉场景。随着技术的进步,尤其是在图像处理和分析算法的发展,计算机视觉领域迎来了新的突破。到了1990年代,随着大量数据的可获取性和算法的改进,机器学习方法开始在计算机视觉任务中发挥作用。

weixin_31459297的博客 555

Kinect v2抠图程序

采用Kinect v2进行实时抠图,把目标人体完美融入背景图,完全实时,非常流畅。 C++写的

kinect2.0抠图

最近两年微软开发出了最新版本的kinect2.0深度相机,出于好奇对其进行研究,根据骨骼信息进行抠图处理

kinectV2 抠图 自动拍照

利用Kinect抠图和识别简单动作自动拍照程序。 kinectV2 抠图 自动拍照。相关博客https://blog.youkuaiyun.com/baolinq/article/details/52388095

kinect v1 抠图

此代码功能利用kinect的图像采集功能(深度图像和彩色图像)对人体进行抠图,在此基础上可以学习扣人体某一部分的图像。

[Unity_Plastic SCM小技巧] 使用 UnityYAMLMerge 工具合并场景和预制件文件

首先YAMLMerge工具其实并不局限于PlasticSCM,git也可以,它是内置在Editor内的一个更加智能的版本控制工具,只不过正常不会启用,他的目录在C:\Program Files\Unity\Editor\Data\Tools\UnityYAMLMerge.exe(Unity Editor安装目录),MAC上:/Applications/Unity/Unity.app/Content...

unityofficial的博客 1143

SAP 零售 FMS 物料主数据(一)

SAP 零售 FMS 物料主数据(一) SAP 对于鞋服行业最新的解决方案-FMS(相当于原来的AFS+Retail);更偏向与零售; 商品主数据与原来的AFS大不相同,取消了原来的Grid的网格概念,取而代之的是变式;商品主数据维护也偏向于Retail的维护模式;事物代码也不是MM01而是MM41 /MM46; 在维护商品主数据前,需要与商品部沟通定义各种商品相关的规范如编码规则,大中小类 ,颜色库,尺码库等,此处不赘述; 创建商品需要确定哪些物料是变式物料,哪些是常规不带特性的单一物料;这决定了在创建商

weixin_45518759的博客 5061

树莓派CSI/DSI二合一接口深度玩法:同时驱动MIPI摄像头和屏幕的配置秘籍

本文详细解析了树莓派5上CSI/DSI二合一接口的深度玩法,提供了同时驱动MIPI摄像头和屏幕的完整配置秘籍。从硬件连接到软件设置,包括config.txt的优化配置,帮助用户充分利用树莓派5的双多功能接口,实现高效的双设备工作模式。

weixin_30687051的博客 573

三种方法教你下载大模型到本地,总有一种适合你

本文主要介绍了下载大模型到本地的三种解决方案,希望能对同学们有所帮助。 文章目录 1. 场景/问题描述 2. 方案一:使用git 3. 方案二:镜像站 4. 方案三:高速下载工具(变体及自定义代码) 4.1 aria2 4.2 自定义代码

weixin_43178406的博客 17万+

9.16华为OD机试真题 新系统 - 矩阵螺旋遍历 (Java/Py/C/C++/Js/Go)

9.16华为OD机试真题 新系统 - 矩阵螺旋遍历 (Java/Py/C/C++/Js/Go)

算法大师! 637

改进yolov8|BackBone改进:PWConv、FasterNeXt替换yolov8主干网络

各位哥哥姐姐弟弟妹妹大家好,我是干饭王刘姐,主业干饭,主业2.0计算机研究生在读。和我一起来改进yolov8变身计算机大牛吧!本文中的论文笔记都是刘姐亲自整理,原创整理哦~

weixin_44379985的博客 748

初探802.11协议(0)——PCF/DCF与CSMA/CA机制

IEEE802.11 CSMA/CA机制与DCF机制

FanFF的博客 4505

【系统分析师】第6章-基础知识:企业信息化(核心总结)

企业信息化是数字化转型的核心,涵盖战略规划、技术应用和实施路径等方面。关键内容包括ERP、CRM、SCM等系统的定义与实施,以及数据仓库、商业智能等技术的应用。备考系统分析师需掌握信息化战略规划方法(如BSP、SDP)、系统建模工具,并能分析解决信息孤岛等问题。论文可围绕ERP实施、数据仓库应用等主题展开。企业信息化面临组织变革、技术选型等挑战,但能显著提升运营效率和竞争力。

数据知道的博客 6931

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

上一篇: 3ds文件结构(四)
下一篇: 能改变世界当然好,但能赚钱才是王道
fesito
博客等级 码龄15年 210粉丝 27原创
评论 6
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值