Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

scale factor

  • Loading branch information...
commit 691686d11b56048630678fcf6b6e88461f4102d8 1 parent 7f7376f
@obviousjim authored
View
8 RGBDVisualize/RGBDVisualize.xcodeproj/project.pbxproj
@@ -71,8 +71,6 @@
E7997A621541D06600D4130C /* dofblur.vert in Sources */ = {isa = PBXBuildFile; fileRef = E7997A5E1541D06500D4130C /* dofblur.vert */; };
E7997A631541D06600D4130C /* dofrange.frag in Sources */ = {isa = PBXBuildFile; fileRef = E7997A5F1541D06600D4130C /* dofrange.frag */; };
E7997A641541D06600D4130C /* dofrange.vert in Sources */ = {isa = PBXBuildFile; fileRef = E7997A601541D06600D4130C /* dofrange.vert */; };
- E79C454C15890A76002CF86B /* dofrange.geom in Sources */ = {isa = PBXBuildFile; fileRef = E79C454B15890A75002CF86B /* dofrange.geom */; };
- E7BA26031585546A004F657F /* unproject.geom in Sources */ = {isa = PBXBuildFile; fileRef = E7BA26021585546A004F657F /* unproject.geom */; };
E7DF569A147CA28300A3A9C7 /* ofxTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7DF5677147CA28300A3A9C7 /* ofxTimeline.cpp */; };
E7DF569C147CA28300A3A9C7 /* ofxTLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7DF567C147CA28300A3A9C7 /* ofxTLElement.cpp */; };
E7DF569D147CA28300A3A9C7 /* ofxTLElementHeader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7DF567E147CA28300A3A9C7 /* ofxTLElementHeader.cpp */; };
@@ -320,8 +318,6 @@
E7997A5E1541D06500D4130C /* dofblur.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = dofblur.vert; sourceTree = "<group>"; };
E7997A5F1541D06600D4130C /* dofrange.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = dofrange.frag; sourceTree = "<group>"; };
E7997A601541D06600D4130C /* dofrange.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = dofrange.vert; sourceTree = "<group>"; };
- E79C454B15890A75002CF86B /* dofrange.geom */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = dofrange.geom; sourceTree = "<group>"; };
- E7BA26021585546A004F657F /* unproject.geom */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = unproject.geom; sourceTree = "<group>"; };
E7DF5677147CA28300A3A9C7 /* ofxTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxTimeline.cpp; sourceTree = "<group>"; };
E7DF5678147CA28300A3A9C7 /* ofxTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxTimeline.h; sourceTree = "<group>"; };
E7DF567C147CA28300A3A9C7 /* ofxTLElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxTLElement.cpp; sourceTree = "<group>"; };
@@ -600,10 +596,8 @@
E7997A5D1541D06500D4130C /* dofblur.frag */,
E7997A5E1541D06500D4130C /* dofblur.vert */,
E7997A601541D06600D4130C /* dofrange.vert */,
- E79C454B15890A75002CF86B /* dofrange.geom */,
E7997A5F1541D06600D4130C /* dofrange.frag */,
E7F96F0D153E8D0F005841A9 /* unproject.frag */,
- E7BA26021585546A004F657F /* unproject.geom */,
E7F96F0E153E8D0F005841A9 /* unproject.vert */,
);
path = shaders;
@@ -1335,8 +1329,6 @@
E77C754515798B9B0016FA54 /* ofxSlider.cpp in Sources */,
E77C754615798B9B0016FA54 /* ofxToggle.cpp in Sources */,
E77797981583FB8C0041CEAF /* ofxRGBDScene.cpp in Sources */,
- E7BA26031585546A004F657F /* unproject.geom in Sources */,
- E79C454C15890A76002CF86B /* dofrange.geom in Sources */,
A6A4DC44158A567000EC8AF3 /* ofxRGBDMeshBuilder.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
View
17 RGBDVisualize/bin/data/shaders/dofrange.geom
@@ -1,17 +0,0 @@
-#version 120
-#extension GL_EXT_geometry_shader4 : enable
-
-varying in float VInFocus0[3];
-varying out float VOutFocus0;
-varying in float VZPositionValid0[3];
-void main() {
- if(VZPositionValid0[0] == 1. && VZPositionValid0[1] == 1. && VZPositionValid0[2] == 1.){
- for(int i = 0; i < gl_VerticesIn; ++i) {
- gl_Position = gl_PositionIn[i];
- gl_FrontColor = gl_FrontColorIn[i];
- gl_TexCoord[0] = gl_TexCoordIn[i][0];
- VOutFocus0 = VInFocus0[i];
- EmitVertex();
- }
- }
-}
View
15 RGBDVisualize/bin/data/shaders/unproject.geom
@@ -1,15 +0,0 @@
-#version 120
-#extension GL_EXT_geometry_shader4 : enable
-
-varying in float VZPositionValid0[3];
-
-void main() {
- if(VZPositionValid0[0] == 1. && VZPositionValid0[1] == 1. && VZPositionValid0[2] == 1.){
- for(int i = 0; i < gl_VerticesIn; ++i) {
- gl_Position = gl_PositionIn[i];
- gl_FrontColor = gl_FrontColorIn[i];
- gl_TexCoord[0] = gl_TexCoordIn[i][0];
- EmitVertex();
- }
- }
-}
View
2  RGBDVisualize/bin/data/shaders/unproject.vert
@@ -2,6 +2,7 @@
uniform vec2 dim;
uniform vec2 fudge;
+uniform vec2 scale;
//uniform sampler2DRect depthTexture;
uniform vec2 principalPoint;
@@ -31,6 +32,7 @@ void main(void)
texCd.xy *= -1.;
texCd.xy += 1.;
texCd.xy /= 2.;
+ texCd.xy *= scale;
texCd.xy += fudge;
texCd.xy *= dim;
View
24 RGBDVisualize/src/testApp.cpp
@@ -60,6 +60,9 @@ void testApp::setup(){
currentHoleKernelSize = 1;
currentHoleFillIterations = 1;
+ currentXScale = 1.0;
+ currentYScale = 1.0;
+
sampleCamera = false;
rendererDirty = true;
isSceneLoaded = false;
@@ -165,6 +168,9 @@ void testApp::setup(){
gui.add(undistortImages.setup("Undistort", ofxParameter<bool>()));
gui.add(currentXMultiplyShift.setup("X Shift", ofxParameter<float>(), -.15, .15));
gui.add(currentYMultiplyShift.setup("Y Shift", ofxParameter<float>(), -.15, .15));
+ gui.add(currentXScale.setup("X Scale", ofxParameter<float>(), .90, 1.10));
+ gui.add(currentYScale.setup("Y Scale", ofxParameter<float>(), .90, 1.10));
+
gui.add(fillHoles.setup("Fill Holes", ofxParameter<bool>()));
gui.add(currentHoleKernelSize.setup("Hole Kernel Size", ofxParameter<int>(), 1, 10));
gui.add(currentHoleFillIterations.setup("Hole Fill Iterations", ofxParameter<int>(), 1, 20));
@@ -290,12 +296,6 @@ void testApp::processDepthFrame(){
for(int x = 0; x < 640; x++){
int index = y*640+x;
- //***************************************************
- //CUSTOMIZATION: YOU CAN PROCESS YOUR RAW DEPTH FRAME HERE
- //*
- //* depthPixelDecodeBuffer contains the raw depth image
- //*
- //***************************************************
if(noise > 0){
//holeFilledPixels.getPixels()[index] += ofRandom(noise);
depthSequence.currentDepthRaw.getPixels()[index] += ofRandom(noise);
@@ -1004,6 +1004,8 @@ void testApp::update(){
if(currentXMultiplyShift != renderer.xshift ||
currentYMultiplyShift != renderer.yshift ||
+ currentXScale != renderer.xscale ||
+ currentYScale != renderer.yscale ||
currentMirror != renderer.mirror ||
fillHoles != holeFiller.enable ||
currentHoleKernelSize != holeFiller.getKernelSize() ||
@@ -1012,6 +1014,8 @@ void testApp::update(){
{
renderer.xshift = currentXMultiplyShift;
renderer.yshift = currentYMultiplyShift;
+ renderer.xscale = currentXScale;
+ renderer.yscale = currentYScale;
renderer.mirror = currentMirror;
renderer.forceUndistortOff = !undistortImages;
holeFiller.enable = fillHoles;
@@ -1475,7 +1479,10 @@ void testApp::saveComposition(){
xyshift.loadFile(loadedScene->scene.xyshiftFile);
xyshift.setValue("xshift", currentXMultiplyShift);
xyshift.setValue("yshift", currentYMultiplyShift);
+ xyshift.setValue("xscale", currentXScale);
+ xyshift.setValue("yscale", currentYScale);
xyshift.saveFile();
+
selectedScene->scene.hasXYShift = true;
cout << "saved shift file of " << loadedScene->scene.xyshiftFile << endl;
@@ -1627,6 +1634,8 @@ bool testApp::loadComposition(string compositionDirectory){
currentXMultiplyShift = projectsettings.getValue("xmult", 0.);
currentYMultiplyShift = projectsettings.getValue("ymult", 0.);
+ currentXScale = projectsettings.getValue("xscale", 1.);
+ currentYScale = projectsettings.getValue("yscale", 1.);
fillHoles = projectsettings.getValue("fillholes", false);
currentHoleKernelSize = projectsettings.getValue("kernelSize", 1);
@@ -1642,6 +1651,9 @@ bool testApp::loadComposition(string compositionDirectory){
if(selectedScene->scene.hasXYShift && xyshift.loadFile(selectedScene->scene.xyshiftFile)){
currentXMultiplyShift = xyshift.getValue("xshift", 0.);
currentYMultiplyShift = xyshift.getValue("yshift", 0.);
+ currentXScale = xyshift.getValue("xscale", 1.);
+ currentYScale = xyshift.getValue("yscale", 1.);
+
// cout << "laoded shift file of " << loadedScene->scene.xyshiftFile << " current x " << currentXMultiplyShift << " current y " << currentYMultiplyShift << endl;
}
else {
View
3  RGBDVisualize/src/testApp.h
@@ -102,6 +102,9 @@ class testApp : public ofBaseApp, public ofxMSAInteractiveObjectDelegate {
ofxToggle currentMirror;
ofxFloatSlider currentXMultiplyShift;
ofxFloatSlider currentYMultiplyShift;
+ ofxFloatSlider currentXScale;
+ ofxFloatSlider currentYScale;
+
ofxToggle undistortImages;
ofxToggle fillHoles;
ofxIntSlider currentHoleKernelSize;
Please sign in to comment.
Something went wrong with that request. Please try again.