资源简介
单kinect静止场景多帧去噪,时间域用中值,空间域用最近邻。

代码片段和文件信息
#include“denoise.h“
/**************************************************************
constructor initializes all the data members in the class.
create new image for denoisedImage and set the rest zero.
the following function addframe() add frames in frameSet
just copy addresses belongs to shallow copy.
**************************************************************/
kinectDenoising::kinectDenoising()
{
denoisedImage = cvCreateImage(cvSize(widthheight)IPL_DEPTH_16U1);
memset(frameSet0sizeof(IplImage*)*nframes);
numOfframes = 0;
imageROI = cvRect(00widthheight);
}
kinectDenoising::~kinectDenoising()
{
cvReleaseImage(&denoisedImage);
for(int i=0;iames;i++)
{
if(frameSet[i] != NULL)
cvReleaseImage(&frameSet[i]);
}
}
void kinectDenoising::addframe(IplImage* frame)
{
if(numOfframes >= nframes)
{
cout<<“the frame set is full adding frame ignored!“< }
else
{
frameSet[numOfframes++] = frame;
}
}
/*******************************************************************
setImageROI() conputes the image eara to be denoised. if isUpdate
is true recomputation process will start. first regard frameSet[0]
as the operating image set the value of non zero pixels 1and the
rest pixels 0. then use projecting method to compute the imageROI.
*************************************************************/
void kinectDenoising::setImageROI(bool isUpdate)
{
if(!isUpdate)
{
imageROI = cvRect(2244591434);
}
else
{
IplImage* image8u = cvCreateImage(cvSize(widthheight)IPL_DEPTH_8U1);
IplImage* bitImage = cvCreateImage(cvSize(widthheight)IPL_DEPTH_8U1);
// cvThreshold can only handle images of 8UC1 or 32FC1
cvConvertScale(frameSet[0]image8u255.0/4096.0);
cvThreshold(image8ubitImage01CV_THRESH_BINARY);
// the two mats rowReduced and colReduced have to be CV_32SC1 type
// for function cvReduce() seems not to suitable for 16U type and
// 8U type doesn‘t have enough room for the result.
CvMat* rowReduced = cvCreateMat(1bitImage->widthCV_32FC1);
// bitImage->width represents number of cols while bitImage->height stands for rows
CvMat* colReduced = cvCreateMat(bitImage->height1CV_32FC1);
cvReduce(bitImagerowReduced0CV_REDUCE_SUM);
cvReduce(bitImagecolReduced1CV_REDUCE_SUM);
// compute imageROI.x
for(int i=0;icols;i++)
{
float temp = CV_MAT_ELEM(*rowReducedfloat0i);
if(temp>bitImage->height/3)
{
imageROI.x = i;
break;
}
}
// computer imageROI.width
for(int i=rowReduced->cols;i>0;i--)
{
float temp = CV_MAT_ELEM(*rowReducedfloat0i-1);
if(temp>bitImage->height/3)
{
imageROI.width = i-imageROI.x;
break;
}
}
// compute imageROI.y
for(int i=0;irows;i++)
{
float temp = CV_MAT_ELEM(*col
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 825 2011-11-23 16:26 denoise.h
文件 1188 2011-11-23 16:51 denoiseSingeKinectMultipleMapStaticScene.cpp
文件 6808 2011-11-23 16:48 denoise.cpp
----------- --------- ---------- ----- ----
8821 3
- 上一篇:中国网络游戏专业术语表
- 下一篇:VISIO UI控件
相关资源
- VisualStudioUninstaller vs卸载工具
- 组态王驱动开发包3.0.0.7(中文)
- 多窗口后台鼠标连点器
- 使用选择性重传协议实现UDP可靠通信
- VC 获得文件属性 获取文件的创建时
- 读者写者问题(读者优先,写者优先
- 用VC 编写的仿QQ聊天室程序源代码
- 外点法程序
- 外罚函数程序
- qt-电子点菜系统
- 推箱子及人工智能寻路C 源代码
- 自己写的航空订票系统c 版--数据结构
- 数据结构实验魔王语言
- MUSIC算法c 实现
- C 餐厅叫号系统(QT平)
- 国际象棋c 完整版
-
ob
jectARX给Auto CAD加工具条 - 画图程序MFC/VC/VC CRectTracker 串行化
- MFC网络编程实例
- c 课程设计 职工信息管理系统
- 基于OpenCV的数字识别468815
- VC 游戏编程—附源代码
- 使用opencv去掉二值化图像中黑色面积
- IpHlpApi.h&IpHlpApi.lib
- 清华大学 c 郑莉 ppt课件
- c 程序判断离散数学中命题公式
- 多项式求和(数据结构C 版)
- vc 6.0开发的流程图编辑器
- VC 天空盒(skyBox)实现(附源代码)
- c MFC 画多边形
评论
共有 条评论