Skip to content

Instantly share code, notes, and snippets.

@TakashiYoshinaga
TakashiYoshinaga / Form1.cs
Created December 5, 2019 02:14
Acquisition of calibration info and function.
private void InitKinect()
{
//0番目のKinectと接続
kinect = Device.Open(0);
//Kinectの各種モードを設定して動作開始(設定内容自体は今回は特に考えなくてOK)
kinect.StartCameras(new DeviceConfiguration
{
ColorFormat = ImageFormat.ColorBGRA32,
ColorResolution = ColorResolution.R720p,
DepthMode = DepthMode.NFOV_2x2Binned,
@TakashiYoshinaga
TakashiYoshinaga / Form1.cs
Last active December 5, 2019 02:46
Image Transformation for Azure Kinect (Declaration of variables and methods)
namespace AzureKinectTest
{
public partial class Form1 : Form
{
//Kinectを扱う変数
Device kinect;
//(追加3)カラー/Depth画像をBitmapとして扱う変数
Bitmap colorBitmap;
Bitmap depthBitmap;
//追加4)各画像間の位置合わせ変換
@TakashiYoshinaga
TakashiYoshinaga / Form1.cs
Created December 3, 2019 09:53
Color Image Viewer of Azure Kinect
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//AzureKinectSDKの読み込み
@TakashiYoshinaga
TakashiYoshinaga / Form1.cs
Created December 3, 2019 09:18
Initialize Bitmap for Depth Image of Azure Kinect
//Kinectを扱う変数
Device kinect;
//(追加①)Depth画像のBitmap
Bitmap depthBitmap;
public Form1()
{
InitializeComponent();
InitKinect();
//(追加②)Kinectの設定情報に基づいてBitmap関連情報を初期化
InitBitmap();
@TakashiYoshinaga
TakashiYoshinaga / Form1.cs
Last active March 1, 2023 09:33
Color Image Viewer of Azure Kinect
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//AzureKinectSDKの読み込み
@TakashiYoshinaga
TakashiYoshinaga / Form1.cs
Last active March 1, 2023 09:33
Initialize Bitmap for Color Image of Azure Kinect
//Kinectを扱う変数
Device kinect;
//(追加①)カラー画像のBitmap
Bitmap colorBitmap;
public Form1()
{
InitializeComponent();
InitKinect();
//(追加②)Kinectの設定情報に基づいてBitmap関連情報を初期化
InitBitmap();
@TakashiYoshinaga
TakashiYoshinaga / Form1.cs
Created December 2, 2019 02:20
Connecting Test of Azure Kinect for C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//①AzureKinectSDKの読み込み
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello, WebVR! • A-Frame</title>
<meta name="description" content="Hello, WebVR! • A-Frame">
<script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
</head>
<body>
<a-scene background="color: #FAFAFA">
<a-scene background="color: #FAFAFA">
<a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9" shadow></a-box>
<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E" shadow></a-sphere>
<a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D" shadow></a-cylinder>
<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4" shadow></a-plane>
<!--下記を追加-->
<a-entity id="ctlL" laser-controls="hand: left"></a-entity>
<a-entity id="ctlR" laser-controls="hand: right"></a-entity>
<a-entity camera look-controls position="0 1.6 0">
<a-text id="txt" value="test" position="0 0 -1" scale="0.5 0.5 0.5" align="center" color="#000000"></a-text>
<!DOCTYPE html>
<html>
<head>
<title>Hello, WebVR! - A-Frame</title>
<meta name="description" content="Hello, WebVR! - A-Frame">
<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
<!--three.ar.jsとaframe-ar.jsを追加(下記2行)-->
<script src="https://rawgit.com/google-ar/three.ar.js/master/dist/three.ar.js"></script>
<script src="https://rawgit.com/chenzlabs/aframe-ar/master/dist/aframe-ar.js"></script>
</head>