DIBR源码
DIBR源码
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-11-27 15:51 DIBR程序
文件 31070 2013-06-13 09:35 DIBR程序depth00300.jpg
目录 0 2013-11-27 15:51 DIBR程序DIBR
文件 1971 2013-06-13 09:34 DIBR程序dibr.cpp.txt
文件 261 2013-06-13 09:34 DIBR程序dibr.h.txt
目录 0 2013-11-27 15:51 DIBR程序DIBRDebug
文件 32256 2013-06-13 10:09 DIBR程序DIBRDebugDIBR.exe
文件 355336 2013-06-13 10:09 DIBR程序DIBRDebugDIBR.ilk
文件 1141760 2013-06-13 10:09 DIBR程序DIBRDebugDIBR.pdb
目录 0 2013-11-27 15:51 DIBR程序DIBRDIBR
文件 14110720 2013-06-13 11:26 DIBR程序DIBRDIBR.sdf
文件 879 2013-06-13 09:40 DIBR程序DIBRDIBR.sln
文件 11264 2013-06-13 11:26 DIBR程序DIBRDIBR.suo
目录 0 2013-11-27 15:51 DIBR程序DIBRDIBRDebug
文件 1130 2013-06-13 10:09 DIBR程序DIBRDIBRDebugcl.command.1.tlog
文件 25692 2013-06-13 10:09 DIBR程序DIBRDIBRDebugCL.read.1.tlog
文件 610 2013-06-13 10:09 DIBR程序DIBRDIBRDebugCL.write.1.tlog
文件 406 2013-06-13 10:02 DIBR程序DIBRDIBRDebugDIBR.exe.embed.manifest
文件 472 2013-06-13 10:02 DIBR程序DIBRDIBRDebugDIBR.exe.embed.manifest.res
文件 381 2013-06-13 10:09 DIBR程序DIBRDIBRDebugDIBR.exe.intermediate.manifest
文件 46 2013-06-13 10:09 DIBR程序DIBRDIBRDebugDIBR.lastbuildstate
文件 2110 2013-06-13 10:09 DIBR程序DIBRDIBRDebugDIBR.log
文件 69847 2013-06-13 10:02 DIBR程序DIBRDIBRDebugDIBR.obj
文件 198 2013-06-13 10:02 DIBR程序DIBRDIBRDebugDIBR_manifest.rc
文件 2 2013-06-13 10:09 DIBR程序DIBRDIBRDebuglink-cvtres.read.1.tlog
文件 2 2013-06-13 10:09 DIBR程序DIBRDIBRDebuglink-cvtres.write.1.tlog
文件 2 2013-06-13 10:09 DIBR程序DIBRDIBRDebuglink.5500-cvtres.read.1.tlog
文件 2 2013-06-13 10:09 DIBR程序DIBRDIBRDebuglink.5500-cvtres.write.1.tlog
文件 2 2013-06-13 10:09 DIBR程序DIBRDIBRDebuglink.5500.read.1.tlog
文件 2 2013-06-13 10:09 DIBR程序DIBRDIBRDebuglink.5500.write.1.tlog
文件 1602 2013-06-13 10:09 DIBR程序DIBRDIBRDebuglink.command.1.tlog
............此处省略27个文件信息
#include “DIBR.h“
void DIBR(IplImage *colorIplImage *depthIplImage *dibr_n)//generate right image and fill holes
{
IplImage *gray_b*gray_g*gray_r;
IplImage *dibr_b*dibr_g*dibr_r;
gray_b=cvCreateImage(cvGetSize(depth)IPL_DEPTH_8U1);
gray_g=cvCreateImage(cvGetSize(depth)IPL_DEPTH_8U1);
gray_r=cvCreateImage(cvGetSize(depth)IPL_DEPTH_8U1);
dibr_b=cvCreateImage(cvGetSize(depth)IPL_DEPTH_8U1);
cvSetZero(dibr_b);
dibr_g=cvCreateImage(cvGetSize(depth)IPL_DEPTH_8U1);
cvSetZero(dibr_g);
dibr_r=cvCreateImage(cvGetSize(depth)IPL_DEPTH_8U1);
cvSetZero(dibr_r);
cvSplit(colorgray_bgray_ggray_rNULL);
int table[256];
int knear = 0; // knear = 0 means everything is displayed behind the screen
int kfar = 128;
int xb = 6; // eye seperation distance 6cm
int D = 800; // view distance 3m
int Npix = 320; // standard definition display to reduce the parallax (maybe 720 better!!)
for (int i = 0; i < 256; i++)
{
double A = i * ( knear/64 + kfar/16 ) / 255;
double h = - xb * Npix * ( A-kfar/16) / D;
table[i] = (int)(h/2);
}
int S = 25; // depth=0 maxmium shift. !!If Npix changes this value will change!!
int step = depth->widthStep/sizeof(uchar);
uchar* datadepth = (uchar*)depth->imageData;
uchar* datagray_b = (uchar*)gray_b->imageData;
uchar* datagray_g = (uchar*)gray_g->imageData;
uchar* datagray_r = (uchar*)gray_r->imageData;
uchar* datadibr_b = (uchar*)dibr_b->imageData;
uchar* datadibr_g = (uchar*)dibr_g->imageData;
uchar* datadibr_r = (uchar*)dibr_r->imageData;
//generate right image from color image and associated depth
for (int i=0; iheight;i++)
{
for (int j=0; jwidth; j++)
{
int d = (int)(datadepth[i*step+j]);
int shift = table[d];
if (j+shift-S>=0)
{
datadibr_b[i*step+j+shift-S] = datagray_b[i*step+j];
}
}
}
for (int i=0; iheight;i++)
{
for (int j=0; jwidth; j++)
{
int d = (int)(datadepth[i*step+j]);
int shift = table[d];
if (j+shift-S>=0)
{
datadibr_g[i*step+j+shift-S] = datagray_g[i*step+j];
}
}
}
for (int i=0; iheight;i++)
{
for (int j=0; jwidth; j++)
{
int d = (int)(datadepth[i*step+j]);
int shift = table[d];
if (j+shift-S>=0)
{
datadibr_r[i*step+j+shift-S] = datagray_r[i*step+j];
}
}
}
cvMerge(dibr_bdibr_gdibr_rNULLdibr_n);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-11-27 15:51 DIBR程序
文件 31070 2013-06-13 09:35 DIBR程序depth00300.jpg
目录 0 2013-11-27 15:51 DIBR程序DIBR
文件 1971 2013-06-13 09:34 DIBR程序dibr.cpp.txt
文件 261 2013-06-13 09:34 DIBR程序dibr.h.txt
目录 0 2013-11-27 15:51 DIBR程序DIBRDebug
文件 32256 2013-06-13 10:09 DIBR程序DIBRDebugDIBR.exe
文件 355336 2013-06-13 10:09 DIBR程序DIBRDebugDIBR.ilk
文件 1141760 2013-06-13 10:09 DIBR程序DIBRDebugDIBR.pdb
目录 0 2013-11-27 15:51 DIBR程序DIBRDIBR
文件 14110720 2013-06-13 11:26 DIBR程序DIBRDIBR.sdf
文件 879 2013-06-13 09:40 DIBR程序DIBRDIBR.sln
文件 11264 2013-06-13 11:26 DIBR程序DIBRDIBR.suo
目录 0 2013-11-27 15:51 DIBR程序DIBRDIBRDebug
文件 1130 2013-06-13 10:09 DIBR程序DIBRDIBRDebugcl.command.1.tlog
文件 25692 2013-06-13 10:09 DIBR程序DIBRDIBRDebugCL.read.1.tlog
文件 610 2013-06-13 10:09 DIBR程序DIBRDIBRDebugCL.write.1.tlog
文件 406 2013-06-13 10:02 DIBR程序DIBRDIBRDebugDIBR.exe.em
文件 472 2013-06-13 10:02 DIBR程序DIBRDIBRDebugDIBR.exe.em
文件 381 2013-06-13 10:09 DIBR程序DIBRDIBRDebugDIBR.exe.intermediate.manifest
文件 46 2013-06-13 10:09 DIBR程序DIBRDIBRDebugDIBR.lastbuildstate
文件 2110 2013-06-13 10:09 DIBR程序DIBRDIBRDebugDIBR.log
文件 69847 2013-06-13 10:02 DIBR程序DIBRDIBRDebugDIBR.obj
文件 198 2013-06-13 10:02 DIBR程序DIBRDIBRDebugDIBR_manifest.rc
文件 2 2013-06-13 10:09 DIBR程序DIBRDIBRDebugli
文件 2 2013-06-13 10:09 DIBR程序DIBRDIBRDebugli
文件 2 2013-06-13 10:09 DIBR程序DIBRDIBRDebugli
文件 2 2013-06-13 10:09 DIBR程序DIBRDIBRDebugli
文件 2 2013-06-13 10:09 DIBR程序DIBRDIBRDebugli
文件 2 2013-06-13 10:09 DIBR程序DIBRDIBRDebugli
文件 1602 2013-06-13 10:09 DIBR程序DIBRDIBRDebugli
............此处省略27个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)