Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding some new apps. of special importance is CaptureAppKinect, whic…
…h is the starting point for the new capture app. i decided to do it from scratch because there are like 4 older projects floating around influencing the current capture app and it's an absolute mess.
- Loading branch information
1 parent
1d0533b
commit 82a1b91
Showing
40 changed files
with
6,950 additions
and
31 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<serialPort>/dev/cu.usbserial-A3000XSL</serialPort> | ||
<serialPort>/dev/cu.usbmodemfa141</serialPort> |
1,024 changes: 1,024 additions & 0 deletions
1,024
CaptureAppKinect/CaptureAppKinect.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>English</string> | ||
<key>CFBundleExecutable</key> | ||
<string>${EXECUTABLE_NAME}</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.yourcompany.openFrameworks</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include "testApp.h" | ||
#include "ofAppGlutWindow.h" | ||
|
||
int main() { | ||
ofAppGlutWindow window; | ||
ofSetupOpenGL(&window, 640, 480 * 2, OF_WINDOW); | ||
ofRunApp(new testApp()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#include "testApp.h" | ||
|
||
void testApp::setup() { | ||
ofSetVerticalSync(true); | ||
|
||
capturedFrame = 0; | ||
recording = false; | ||
recordingLength = 128; | ||
|
||
setupKinect(); | ||
setupCanon(); | ||
setupArduino(); | ||
} | ||
|
||
void testApp::setupKinect() { | ||
kinect.init(); | ||
ofxKinectCalibration::setClippingInCentimeters(40, 110); | ||
kinect.open(); | ||
|
||
cout << "allocating " + recordingLength + " frames for kinect" << endl; | ||
kinectBuffer.resize(1); | ||
kinectBuffer[0].allocate(kinect.getWidth(), kinect.getHeight(), OF_IMAGE_GRAYSCALE); | ||
kinectBuffer.resize(recordingLength); | ||
} | ||
|
||
void testApp::setupCanon() { | ||
camera.setup(); | ||
|
||
cout << "allocating " + recordingLength + " frames for canon" << endl; | ||
cameraBuffer.resize(1); | ||
cameraBuffer[0].allocate(camera.getWidth(), camera.getHeight(), OF_IMAGE_COLOR); | ||
cameraBuffer.resize(recordingLength); | ||
} | ||
|
||
void testApp::update() { | ||
ofBackground(100, 100, 100); | ||
|
||
camera.update(); | ||
|
||
kinect.update(); | ||
if(kinect.isFrameNew()) { | ||
} | ||
|
||
if(recording) { | ||
|
||
kinectBuffer[capturedFrame].setFromPixels(kinect.getDepthPixels(), kinect.getWidth(), kinect.getHeight(), OF_IMAGE_GRAYSCALE); | ||
cameraBuffer[capturedFrame] = camera.getPixelsRef(); | ||
|
||
capturedFrame++; | ||
|
||
if(capturedFrame == recordingLength) { | ||
for(int i = 0; i < capturedFrame; i++) { | ||
ofSaveImage(kinectBuffer[i], "kinect/" + ofToString(i) + ".png"); | ||
ofSaveImage(cameraBuffer[i], "canon/" + ofToString(i) + ".png"); | ||
} | ||
|
||
recording = false; | ||
} | ||
} | ||
} | ||
|
||
void testApp::draw() { | ||
ofSetColor(255); | ||
int cw = camera.getWidth() * (640. / 1056); | ||
int ch = camera.getHeight() * (640. / 1056); | ||
camera.draw(0, 0, cw, ch); | ||
kinect.drawDepth(0, ch); | ||
|
||
ofSetColor(ofColor::red); | ||
ofLine(320, 0, 320, ofGetHeight()); | ||
ofLine(0, ch / 2, ofGetWidth(), ch / 2); | ||
ofLine(0, ch + 240, ofGetWidth(), ch + 240); | ||
} | ||
|
||
void testApp::exit() { | ||
kinect.close(); | ||
} | ||
|
||
void testApp::keyPressed(int key) { | ||
if(key == ' ') { | ||
recording = true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
#include "ofMain.h" | ||
#include "ofxOpenCv.h" | ||
#include "ofxKinect.h" | ||
#include "ofxEdsdk.h" | ||
|
||
class testApp : public ofBaseApp { | ||
public: | ||
void setup(); | ||
void setupKinect(); | ||
void setupCanon(); | ||
void setupArduino(); | ||
|
||
void update(); | ||
void draw(); | ||
void exit(); | ||
void keyPressed(int key); | ||
|
||
ofxKinect kinect; | ||
ofxEdsdk::Camera camera; | ||
|
||
int capturedFrame; | ||
|
||
bool recording; | ||
int recordingLength; | ||
vector<ofPixels> kinectBuffer; | ||
vector<ofPixels> cameraBuffer; | ||
|
||
ofSerial arduino; | ||
}; |
Oops, something went wrong.