Created
January 25, 2017 11:46
-
-
Save kashimAstro/4833be6dee0de94133e734cb257182b3 to your computer and use it in GitHub Desktop.
extract fhog with dlib and openframeworks
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
void drawFHOG(ofPixels store, int x, int y) | |
{ | |
ofPixels pix; | |
ofImage debug; | |
ofPushMatrix(); | |
array2d<matrix<float,31,1> > hog; | |
array2d<rgb_pixel> img; | |
toDLib(store,img);//<-- view ofxDLib | |
extract_fhog_features(img, hog); | |
matrix<unsigned char> df = draw_fhog(hog); | |
int hf = df.nr(); | |
int wf = df.nc(); | |
pix.allocate(wf, hf, OF_IMAGE_COLOR); | |
for(int r = 0; r < hf; r++) | |
{ | |
for(int c = 0; c < wf; c++) | |
{ | |
pix.setColor(c, r, ofColor(df(r,c))); | |
} | |
} | |
debug = pix; | |
debug.draw(x,y); | |
ofPopMatrix(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment