Skip to content

Commit

Permalink
added check to make sure not to return null feature maps
Browse files Browse the repository at this point in the history
  • Loading branch information
genekogan committed Aug 30, 2016
1 parent f4eca25 commit 7f23db5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ofxCcv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@ void ofxCcv::FeatureMap::getImage(ofImage & img, bool autoBrighten) {
}

vector<ofxCcv::FeatureMap> ofxCcv::getFeatureMaps(int layer) const {
vector<FeatureMap> maps;
if (convnet->acts[layer] == NULL) {
return maps;
}
int rows = convnet->acts[layer]->rows;
int cols = convnet->acts[layer]->cols;
int channels = CCV_GET_CHANNEL(convnet->acts[layer]->type);

vector<FeatureMap> maps;
for (int c=0; c<channels; c++) {
FeatureMap map;
map.rows = rows;
Expand Down

0 comments on commit 7f23db5

Please sign in to comment.