Skip to content

Instantly share code, notes, and snippets.

View UnaNancyOwen's full-sized avatar

Tsukasa Sugiura UnaNancyOwen

View GitHub Profile
@UnaNancyOwen
UnaNancyOwen / main.cpp
Last active July 4, 2016 14:42
Kinect v2 Coordinate System Mapping
#include <iostream>
#include <sstream>
#include <Windows.h>
#include <Kinect.h>
#include <opencv2/opencv.hpp>
#include <atlbase.h>
// Error Check
inline void result( const CComPtr<IVisualGestureBuilderFrame>& gestureFrame, const CComPtr<IGesture>& gesture, const int count )
{
// TrackingIdを取得
UINT64 trackingId;
ERROR_CHECK( gestureFrame->get_TrackingId( &trackingId ) );
// Gestureの種類(Discrete or Continuous)を取得
GestureType gestureType;
ERROR_CHECK( gesture->get_GestureType( &gestureType ) );
switch( gestureType ){
@UnaNancyOwen
UnaNancyOwen / CMakeLists.txt
Last active August 10, 2016 19:39
CMake Module for Speech Platform SDK
# Example CMakeLists.txt
# FindSpeechPlatformSDK.cmake copy to CMake\share\cmake-3.5\Modules or same directory as this file
cmake_minimum_required( VERSION 2.8 )
set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH} )
project( solution )
add_executable( project main.cpp )
set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "project" )
@UnaNancyOwen
UnaNancyOwen / OpenNI2.props
Created January 31, 2015 13:42
Property Sheet for OpenNI2
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets"/>
<!-- Debug|Win32 -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@UnaNancyOwen
UnaNancyOwen / example1.cpp
Last active October 18, 2016 13:31
How to Retrieve Specific Joint Position
// Retrieve Joints
std::array<Joint, JointType::JointType_Count> joints;
ERROR_CHECK( body->GetJoints( JointType::JointType_Count, &joints[0] ) );
// Retrieve Specific Joint Position ( e.g. Left Hand )
const Joint joint = joints[JointType::JointType_HandLeft];
if( joint.TrackingState == TrackingState::TrackingState_Tracked ){
const CameraSpacePoint position = joint.Position;
const float x = position.X; // X coordinate (+/-1.0)
const float y = position.Y; // Y coordinate (+/-1.0)
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <functional>
//#include <ppl.h>
//#include <concurrent_vector.h>
#include <opencv2/opencv.hpp>
// opencv/samples/gpu/tick_meter.hpp
/*
// Retrieve Body Data
IBody* bodies[BODY_COUNT];
ERROR_CHECK( bodyFrame->GetAndRefreshBodyData( BODY_COUNT, &bodies[0] ) );
// Find Closest Body
const int count = findClosestBody( bodies );
// Retrieve Closest Body
IBody* body = bodies[count];
@UnaNancyOwen
UnaNancyOwen / info.h
Last active December 11, 2016 10:31
OpenCV Build Information Parser
/*
BuildInformation info;
std::string value = info.getValue( "JPEG" );
std::cout << value << std::endl; // build (ver 90)
*/
#ifndef __BUILD_INFORMATION__
#define __BUILD_INFORMATION__
#include <string>
@UnaNancyOwen
UnaNancyOwen / CMakeSettings.json
Last active December 14, 2016 18:30
Visual C++ Tools for CMake Setting Files
{
"configurations": [
{
"name": "Visual Studio 15 2017 (x86)",
"generator": "Visual Studio 15 2017",
"variables": [
{
"name": "OpenCV_DIR",
"value": "C:\\Program Files\\opencv\\build"
}
@UnaNancyOwen
UnaNancyOwen / FreeType.2.7.0.md
Last active December 23, 2016 14:33
Building FreeType2 with Visual Studio