Commit 706e6a61 by wester

test

parent 9f572c13
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -71,7 +71,7 @@ std::vector<glm::vec3> controllerPositions;
bool toggleCam = false;
bool toggleCam = true;
Camera mainCam;
static bool trackControllerPos = true;
......@@ -83,18 +83,19 @@ int lastX, lastY;
//Filter Settings
float minTrackingKinect = 0.2f;//0.8f;
float maxTrackingKinect = 1.0f;// 2.5f;
float minTrackingKinect = 0.3f;//0.8f;
float maxTrackingKinect = 0.9f;// 2.5f;
//Custom
//float angleDegrees = 20.0f;
float maxNormalAngle = degreeToRadian(25.0f);
bool enableDepthFilter = false;
bool enableNormalFilter = false;//true;
bool enableNormalFilter = true;//true;
//Bilateral / FastDepthNoise
bool enableFastDepthNoiseFilter = true;
float repairThreshold = 100.0f;
bool captureFramesTXT = true;
......@@ -389,14 +390,14 @@ void processCurrentFrameForExport() {
float maxx, maxy, maxz;
maxx = maxy = maxz = -std::numeric_limits<float>::max();
bool captureFramesTXT = false;
std::ofstream myfile;
if (captureFramesTXT) {
char buffer[64]; // make sure it's big enough
snprintf(buffer, sizeof(buffer), "frames/pnts_%d.txt", counter++);
myfile.open(buffer, std::ios::out | std::ios::binary);
myfile.open(buffer, std::ios::out);
}
glm::mat4x4 temp = glm::inverse(*currentTrackerPos);
for (unsigned int i = 0; i < width*height; i++) {
if (frameValidPoints[i]) {
glm::vec3 position = framePositions[i];
......@@ -405,8 +406,6 @@ void processCurrentFrameForExport() {
if (isinf(position.x) || isinf(position.y) || isinf(position.z))
continue;
if (position.x < minx) minx = position.x;
if (position.x > maxx) maxx = position.x;
if (position.y < miny) miny = position.y;
......@@ -418,8 +417,10 @@ void processCurrentFrameForExport() {
colors.push_back(frameColors[i * 3]);
colors.push_back(frameColors[i * 3 + 1]);
colors.push_back(frameColors[i * 3 + 2]);
if (captureFramesTXT) {
myfile << positionGlobal.x << " " << positionGlobal.y << " " << positionGlobal.z << " "
glm::vec3 tempvec = glm::vec3(temp* glm::vec4(positionGlobal, 1.0f));
myfile << tempvec.x << " " << tempvec.y << " " << tempvec.z << " "
<< (int)frameColors[i * 3] << " " << (int)frameColors[i * 3 + 1] << " " << (int)frameColors[i * 3 + 2] << std::endl;
}
......@@ -451,26 +452,25 @@ void writePointCloud() {
return;
}
if (!currentTrackerPos)
currentTrackerPos = new glm::mat4x4(glm::rotate(*steamTracking->getTransformationForDevice(trackerID, 0.0f), degreeToRadian(-00), glm::vec3(1.0f, 0.0f, 0.0f)));
currentTrackerPos = steamTracking->getTransformationForDevice(trackerID, 0.0f);
currentTrackerPos = new glm::mat4x4(glm::rotate(*currentTrackerPos, degreeToRadian(-90), glm::vec3(1.0f, 0.0f, 0.0f)));
std::vector<glm::vec3> exportpoints;
exportpoints.reserve(points.size());
for (size_t i = 0; i < points.size(); i++) {
exportpoints.push_back(glm::vec3(glm::rotate(glm::inverse(*currentTrackerPos), degreeToRadian(00), glm::vec3(1.0f, 0.0f, 0.0f)) * glm::vec4(points[i], 1.0f)));
exportpoints.push_back(glm::inverse(*currentTrackerPos) * glm::vec4(points[i], 1.0f));
}
//exportpoints.clear();
/*
for (int i = 0; i < 1000; i++) {
exportpoints.push_back(glm::vec3(i/1000.0f, 0.0f, 0.0f));
exportpoints.push_back(glm::vec3(0.0f, i / 1000.0f, 0.0f));
exportpoints.push_back(glm::vec3(0.0f, i / 2000.0f, 1.0f));
//exportpoints.push_back(glm::vec3(0.0f, i / 2000.0f, 1.0f));
exportpoints.push_back(glm::vec3(0.0f, 0.0f, i / 1000.0f));
}
}*/
pntsHeader header;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment