小编Dav*_*ger的帖子

使用Kinect和OpenGL进行投影映射

我目前使用名为procamcalibJavaCV软件来校准Kinect-Projector设置,该设置以Kinect RGB Camera为原点.此设置仅包括Kinect RGB相机(我现在大致使用Kinect作为普通相机)和一台投影仪.该校准软件使用LibFreenect(OpenKinect)作为Kinect驱动程序.

一旦软件完成其过程,它将为我提供相机和投影仪的内在和外在参数,这些参数被抛出在OpenGL软件上以验证校准,并且是一些问题开始的地方.正确设置投影和模型视图后,我应该能够适应Kinect所看到的投影内容,但为了达到这个目的,我必须在所有3轴上进行手动平移,最后一部分不做对我有任何意义!你能帮我解整一下吗?用于检索Kinect数据的SDK是OpenNI(不是最新的2.x版本,应该是1.5.x)

我将解释我正在做什么来重现这个错误.校准参数使用如下:

投影矩阵设置为(基于 http://sightations.wordpress.com/2010/08/03/simulating-calibrated-cameras-in-opengl/):

r = width/2.0f;         l = -width/2.0f;
t = height/2.0f;        b = -height/2.0f;

alpha = fx;      beta = fy;
xo    = cx;      yo   = cy;

X = kinectCalibration.c_near + kinectCalibration.c_far;
Y = kinectCalibration.c_near*kinectCalibration.c_far;

d = kinectCalibration.c_near - kinectCalibration.c_far;


float* glOrthoMatrix = (float*)malloc(16*sizeof(float));

glOrthoMatrix[0] = 2/(r-l); glOrthoMatrix[4] = 0.0f;        glOrthoMatrix[8] = 0.0f;        glOrthoMatrix[12] = (r+l)/(l-r);
glOrthoMatrix[1] = 0.0f;    glOrthoMatrix[5] = 2/(t-b);     glOrthoMatrix[9] = …
Run Code Online (Sandbox Code Playgroud)

c++ opengl mapping camera kinect

22
推荐指数
1
解决办法
2840
查看次数

AngularJS:基本$ watch无效

我试图在AngularJS中设置一个手表,我显然做错了什么,但我无法弄明白.手表在即时页面加载时触发,但是当我更改观察值时,它不会触发.为了记录,我还在匿名函数上设置监视以返回监视变量,但是我得到了完全相同的结果.

我已经在下面编写了一个最小的例子,在控制器中执行所有操作.如果它有所不同,我的实际代码被挂钩在指令中,但两者都以相同的方式失败.我觉得我必须要有一些基本的东西,但我只是看不到它.

HTML:

<div ng-app="testApp">
    <div ng-controller="testCtrl">
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

JS:

var app = angular.module('testApp', []);

function testCtrl($scope) {
    $scope.hello = 0;

    var t = setTimeout( function() { 
        $scope.hello++;
        console.log($scope.hello); 
    }, 5000);

    $scope.$watch('hello', function() { console.log('watch!'); });
}
Run Code Online (Sandbox Code Playgroud)

超时工作,hello增量,但手表不会触发.

演示http://jsfiddle.net/pvYSu/

watch angularjs

17
推荐指数
1
解决办法
3万
查看次数

PushViewController导致黑屏

SettingsViewController *viewController = [[SettingsViewController alloc] init];
    [[self navigationController] pushViewController:viewController animated:YES];
Run Code Online (Sandbox Code Playgroud)

在NavigationController中使用此代码时,显示的场景只是一个黑屏.在故事板中,它显示内容但不会显示在手机上.

iphone xcode objective-c

12
推荐指数
2
解决办法
8413
查看次数

为什么以下代码无法修改指针数组中的字符串?

我正在尝试将字符串"hello"修改为"Hello"但它不起作用,它都没有给出任何错误.可以请某人解释为什么它不起作用.

#include <stdio.h>

int main() {
    char *arr[] = {"hello" , "world"};
    char **p = arr;
    printf("%s\n",arr[0]);
    *(*(p+0)+1) = 'H';
    printf("%s\n",arr[0]);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c

2
推荐指数
1
解决办法
186
查看次数

PHP替换字符串中的随机单词并替换为变量

我知道标题与其他问题相似,但我找不到我想要的东西.

我有一个变量,说:

$myVar = 'bottle';
Run Code Online (Sandbox Code Playgroud)

然后,我有一个字符串:

$myString = 'Hello this is my string';
Run Code Online (Sandbox Code Playgroud)

我需要一些代码来选择随机单词$myString并替换它$myVar.我怎样才能做到这一点?

php

1
推荐指数
1
解决办法
138
查看次数

标签 统计

angularjs ×1

c ×1

c++ ×1

camera ×1

iphone ×1

kinect ×1

mapping ×1

objective-c ×1

opengl ×1

php ×1

watch ×1

xcode ×1