Skip to content

Commit

Permalink
rotation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HalfdanJ committed May 25, 2016
1 parent ed0be31 commit ee04df6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion example-simple/src/ofApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ void ofApp::setup(){

// Setup tracker
tracker.setup();
tracker.setFaceRotation(90);
}

//--------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions src/ofxFaceTracker2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ bool ofxFaceTracker2::update(Mat image, cv::Rect _roi) {
resize(image, im, cv::Size(), scale,scale, cv::INTER_NEAREST);
}

// Rotate image if required
if(imageRotation){
rotate_90n(im, im, imageRotation);
}

// Update info object
if(info.inputWidth != image.cols || info.inputHeight != image.rows){
info = ofxFaceTracker2InputInfo(image.cols, image.rows, im.cols, im.rows, imageRotation);
}

// Rotate image if required
if(imageRotation){
rotate_90n(im, im, imageRotation);
}

if(threaded) mutex.lock();

roi = _roi;
Expand Down
3 changes: 1 addition & 2 deletions src/ofxFaceTracker2Landmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ ofxFaceTracker2Landmarks::ofxFaceTracker2Landmarks(dlib::full_object_detection s

ofVec2f ofxFaceTracker2Landmarks::getImagePoint(int i) const {
ofVec3f p = ofVec3f(shape.part(i).x(),
shape.part(i).y(),0);
shape.part(i).y(), 0);
p = p * info.rotationMatrix;
ofLog()<<info.imageRotation;

return ofVec2f(p);
}
Expand Down

0 comments on commit ee04df6

Please sign in to comment.