發表文章

目前顯示的是有「Kinect v2開發特訓」標籤的文章

KinectV2_人體索引(BodyIndex)_[WPF_vs_WinForm]

圖片
在 WPF上運行的測試結果 在 WPF上運行的代碼 視窗介面 MainWindow.xaml <Window x:Class="KinectV2_BodyIndex_exercise.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:KinectV2_BodyIndex_exercise" mc:Ignorable="d" Title="MainWindow" Height="600" Width="1200" Loaded="Window_Loaded" Closing="Window_Closing" > <Grid> <Image x:Name="ImageBodyIndex" Width="512" Height="424"/> </Grid> </Window> 事件運行的代碼 MainWindow.xaml.cs using System; using System.Collections.Generic; using System....

第一次做專案_寫了一個爛到爆X差勁透頂的程式_剖析

圖片
這是一個表面看似可以work 具有背景融合而且還添加了 前框的小應用程式 還沒有添加GUI的狀態 為捨麼說這個東西爛~~而且差勁透頂了 第一、沒有去精確算解析度 第二、圖像產生鋸齒 第三、我不應該直接在前框上做遮罩,而且還是拿jpg 是否可考慮換png做遮罩直接合成上去 第四、視覺效果沒有到非常好,可以work!!!!不代表程式是好的 第五、並不了解  「預覽解析度」  VS  「拍照解析度」  到底差在哪裡             胡亂做了一通~~ 第六、Kinect  V2 實際拍照像素是否可以去做等比縮放不產生鋸齒 我對Kinect V2 了解不夠徹底 =========================================================== 首先,預覽解析度 通常會比較小 實際拍照解析度會較大,合成較不易失真 而它們之間成等比縮放狀態 測試Kinect V2是否拖拉會進行等比縮放 向橫拖拉是否會產生鋸齒(失真)

KinectV2_背景消除_多拉A夢任意門空間轉換效果

圖片
這次我們要來學習如何寫一個Kinect V2 背景去除效果 首先 我們的第一個目標是如下圖的結果 感覺非常好玩可以到任何國度或者雨林中 我們先觀察 Kinect V2 呈現了彩色資訊 和 身體索引 等等 這是我在一開始所觀察到的 或許還有少些資訊 還有很直觀的一個人的身體輪廓(身體資訊)前景 可以在一張圖上做融入現場環境的有趣小互動 我們先來觀察 Kinect V2 官網上雖說 彩色解析度是1920*1080 第1-1階段程式碼 試著印出   彩色資訊的解析度 #include<iostream> #include<stdio.h> //opencv Library #include"opencv\cv.h" #include"opencv\highgui.h" #include"opencv2\highgui\highgui.hpp" #include"opencv2\opencv.hpp" //Kiinect SDK #include "Kinect.h" using namespace std; using namespace cv; int main() { //open Kinect V2 sensor IKinectSensor * mySensor = nullptr; GetDefaultKinectSensor(&mySensor); mySensor->Open(); //obtain Kinect V2 color source IColorFrameSource *myColorSource = nullptr; mySensor->get_ColorFrameSource(&myColorSource); //obtain Kinect V2 color frame description IFrameDescription *myColorDescription = nullptr; //we want to know the...

Kinect V2 _ 數據源處理及獲得統整_獲取特定骨節點數據

先備知識 Kinect V2 在Windows Form 上的配置教學_秀彩色影像_L1 link :  http://coolmandiary.blogspot.tw/2016/04/kinect-v2-windows-form.html KinectV2_骨節點_分析 link :  http://coolmandiary.blogspot.tw/2016/06/kinectv2.html 再度開啟Kinect_深度影像分析 link :  http://coolmandiary.blogspot.tw/2016/06/kinect.html 【程式碼】 //Standard Library #include <iostream> #include <stdio.h> //OpenCV Header #include <opencv2\opencv.hpp> #include<opencv2\highgui\highgui.hpp> #include<opencv2\imgproc\imgproc.hpp> #include<opencv2\video\background_segm.hpp> using namespace cv; using namespace std; // Kinect for Windows SDK Header #include <Kinect.h> const string get_name(int n); //判斷關節的名字 int main( ) { /* (1) 取得 Sensor (2)選擇你所要讀取的資料源(data source) / Select the data source to read from (3)處理從資料源讀取到的資料 / Handle the data you read from the source */ //取得預設傳感器並開啟 IKinectSensor * mySensor = nullptr; GetDefaultKinectSens...

Kinect V2 _ 同時取得 彩色影像 和 深度影像

圖片
【程式碼】 #include <opencv2/opencv.hpp> #include<opencv2/highgui/highgui.hpp> #include <Windows.h> #include <Kinect.h> using namespace std; using namespace cv; template<class Interface> inline void SafeRelease(Interface *& pInterfaceToRelease) { if (pInterfaceToRelease != NULL){ pInterfaceToRelease->Release(); pInterfaceToRelease = NULL; } }; class Kinect { protected: Kinect(){} public: virtual ~Kinect(){} virtual void update() = 0; virtual Mat* getColorMat() = 0; virtual Mat* getDepthMat() = 0; //virtual KINECTVERSION getKinectVersion() = 0; }; #pragma once /* Kinect v2 Specs * Depth Resolution: 512 x 424 px * Color Resolution: 1920 x 1080 px * Depth Range: 50 cm to 8000 cm * Horizontal FOV: 70° * Vertical FOv: 60° */ class KinectV2 : public Kinect { private: static const int cColorWidth = 1920; static const int cColorHeight = 1080; //Kinect Variables...

再度開啟Kinect_深度影像分析

圖片
這次的研究 針對於opencv套用在Kinect v2 SDK 的深度影像呈現方式 我們已經很清楚知道Kinect 在處理 frame 數據的先後流程為 從 「傳感器」 獲得 「源」 從 「源」 打開 「閱讀器」 從 「閱讀器」 獲得 「視訊 幀 (frame)」 (ps: 「 幀」   讀作 ㄓㄥˋ  計算照片、字畫、影像等單位,也就是frame) 【程式碼】 #include <iostream> #include <opencv2\opencv.hpp> #include<opencv2\highgui\highgui.hpp> #include<opencv2\imgproc\imgproc.hpp> #include<opencv2\video\background_segm.hpp> #include <Kinect.h> using namespace std; using namespace cv; // Safe release for interfaces template<class Interface> inline void SafeRelease(Interface *& pInterfaceToRelease) { if (pInterfaceToRelease != NULL) { pInterfaceToRelease->Release(); pInterfaceToRelease = NULL; } } int main() { //取得sensor IKinectSensor* pSensor;//處理Kinect v2的Sensor接口 HRESULT hResult = S_OK; hResult = GetDefaultKinectSensor(&pSensor);//取得預設的Sensor if (FAILED(hResult)) { cerr << " Error : GetDefaultKinec...