View FPSManager.java
package org.ochilab.util.time;
import java.util.concurrent.TimeUnit;
/**
* FPSの表示・調整するクラス
*/
public class FPSManager {
// 1秒(ナノ秒単位)
private static long ONE_SEC_TO_NANO = TimeUnit.SECONDS.toNanos(1L);
View ICCBasic.R
icc2 <- function(a, b, theta) {
prob <- 1/(1+exp(-1.7*a*(theta-b)))
prob
}
x<- icc2(a=1.0,b=1.5,theta=0)
print(x)
View unity2dBtnClick.cs
using UnityEngine;
using System.Collections;
using UnityEngine; using UnityEngine.UI;
public class NewBehaviourScript : MonoBehaviour {
public Text TestText;
//ボタンクリック時のメソッド
public void ClickTest() {
View Kinect2MakeMaskImage.cs
// 各変数の宣言は省略してあります
maskStride = (int)(depthFrameDesc.Width * colorFrameDesc.BytesPerPixel);
var maskBuffer = new byte[depthFrameDesc.LengthInPixels * colorFrameDesc.BytesPerPixel];
//距離カメラの座標に対応するRGBカメラの座標を取得//
var colorSpace = new ColorSpacePoint[depthFrameDesc.LengthInPixels];
kinect.CoordinateMapper.MapDepthFrameToColorSpace(depthBuffer, colorSpace);
for (int i = 0; i < depthFrameDesc.LengthInPixels; i++) {
int colorx = (int)colorSpace[i].X;
View sampleFirstOpenCVSharp3.cs
/*
* 以下、OpenCVSharp3対応です
*/
//画像ファイル読み込み
Mat img = new Mat(@"C:\Users\ochi\Documents\temp\test.png");
Mat img2 = img.Clone();
Mat img3 = img.Clone();
View Kinect2Init.cs
//変数宣言
Body[] bodies;
KinectSensor kinect;
//Color宣言
FrameDescription colorFrameDesc;
byte[] colorBuffer;
//ColorSpacePoint[] colorPoints;
View WPFMenuSample.xaml
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Menu>
<MenuItem Header="ファイル" />
<MenuItem Header="編集" />
<MenuItem Header="ヘルプ">
<MenuItem IsCheckable="True" Header="info" />
View LPMSample.reg
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\0012ee47-9041-4b5d-9b77-535fba8b1442\0b2d69d7-a2a1-449c-9680-f91c70521c60]
"Attributes"=dword:00000000
View TcpClientSample.cs
//TcpClientを作成し、サーバーと接続する
TcpClient tcp = new TcpClient("localhost", 10000);
Console.WriteLine("サーバー({0}:{1})と接続しました({2}:{3})。",
((System.Net.IPEndPoint)tcp.Client.RemoteEndPoint).Address,
((System.Net.IPEndPoint)tcp.Client.RemoteEndPoint).Port,
((System.Net.IPEndPoint)tcp.Client.LocalEndPoint).Address,
((System.Net.IPEndPoint)tcp.Client.LocalEndPoint).Port);
//NetworkStreamを取得する
View GetForegroundWindowProductName.cs
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll", EntryPoint = "GetWindowText", CharSet = CharSet.Auto)]
public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
[DllImport("user32.dll")]
private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out int lpdwProcessId);
int processid;