sumit3203 / jfeaturelib

Automatically exported from code.google.com/p/jfeaturelib
0 stars 0 forks source link

Feature vector in PHOG twice as large as needed #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is in version 1.3.0

When I run PHOG on an image, the resulting feature is twice as large as it 
should be, with the first half of the features equal to zero.  

The reason for this is the following:  
  -- PHOG initializes the feature vector in the function 'void initFeature()'.  initFeature computes the size of the final size of the feature vector (correctly) and then allocates memory for it (feature = new double[length];).  These are all zero.

  -- In 'void buildHistogramRecursively()', the feature vector is _appended_ to by the histogram data  (feature = Arrays2.append(feature, histogram.getData());).  This adds features to the end of the vector (after re-sizing it).  

A solution is to change initFeature and set feature=new double[0].  
Arrays2.append handles this case, and results in the correct size feature vector

Original issue reported on code.google.com by cedorma...@gmail.com on 20 Feb 2013 at 8:04

GoogleCodeExporter commented 9 years ago
This issue was closed by revision daa6a7fb9f45.

Original comment by franz.graf on 20 Feb 2013 at 9:53

GoogleCodeExporter commented 9 years ago
Thanx a lot for the fix!!!

Original comment by franz.graf on 20 Feb 2013 at 9:54

GoogleCodeExporter commented 9 years ago

Original comment by franz.graf on 20 Feb 2013 at 9:56