資源簡介
這個代碼專用KinectV2中彩色圖片的尺寸變換,相比于其它圖像變換的方法,具有簡單高效的特點。變換之后的彩色圖像中的物體可以與深度圖一一對應。
代碼片段和文件信息
//?color_resize.cpp:?定義控制臺應用程序的入口點。
//
#include?“stdafx.h“
#include
#include
#include
using?namespace?cv;
using?namespace?std;
#define?WINDOW_NAME?“【彩色圖】“
void?on_value(int?void*);
Mat?colorImage?depthImage?srcImage?dstImage?color;
int?g_Xcutvalue1?=?220;
int?g_Ycutvalue1?=?0;?
int?g_Xcutvalue2?=?130;
int?g_Ycutvalue2?=?0;
int?addvalue?=?110;
int?main()
{
colorImage?=?imread(“color.jpg“);
depthImage?=?imread(“depth.jpg“);
imshow(“【深度圖】“?depthImage);
namedWindow(WINDOW_NAME?WINDOW_AUTOSIZE);
Mat?color(1080?+?addvalue?*?2?1920?CV_8UC3?Scalar::all(0));
//imwrite(“blank.jpg“?srcImage);
Mat?grayImage;
//srcImage?=?imread(“blank.jpg“);
Mat?imageROI?=?color(Rect(0?addvalue-5?colorImage.cols?colorImage.rows));
cvtColor(colorImage?grayImage?COLOR_BGR2GRAY);
- 上一篇:SEGD文件讀取C++源代碼
- 下一篇:C++ 數據結構 算法B+樹實現
評論
共有 條評論