bakercp / ofxDlib

An openFrameworks wrapper for dlib. http://dlib.net/
MIT License
52 stars 15 forks source link

How to convert track.second.alignedFace() to matrix<rgb_pixel> ? #36

Open stephanschulz opened 3 years ago

stephanschulz commented 3 years ago

I am trying to combine the example_dlib_dnn_face_recognition and example_face_tracking. But both use different ways to get faces. In order to get a tracked face in to the vector that contains all faces std::vector<matrix<rgb_pixel>> faces I need to create a faceChip.

track.second.alignedFace() returns ofPixels but ofxDlib::toDlib(my_of_pixels) does not work.

also tried this

                        ofPixels pix = track.second.alignedFace();
                        matrix<rgb_pixel> face_chip;
                        face_chip = ofxDlib::to_rowm(pix);
                        all_faces.push_back(move(face_chip));

I should mention I am using the develop branch.

I thought this should work: https://github.com/bakercp/ofxDlib/blob/develop/libs/ofxDlib/include/ofx/Dlib/Utils.h#L314

stephanschulz commented 3 years ago

found it ! :) https://github.com/bakercp/ofxDlib/blob/master/example_dlib_dnn_cars/src/ofApp.cpp#L38

bakercp commented 3 years ago

Yes! The magic wrappers.

On Thu, Dec 3, 2020, 2:18 PM Stephan Schulz notifications@github.com wrote:

found it ! :)

https://github.com/bakercp/ofxDlib/blob/master/example_dlib_dnn_cars/src/ofApp.cpp#L38

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bakercp/ofxDlib/issues/36#issuecomment-738323107, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACJLRDPWWWL4KJGFZYJG6TSS76CJANCNFSM4UMQU3SA .