void addToHistogram ( int cellX , int cellY , int orientationIndex , double magnitude ) { // see if it's being applied to a valid cell in the histogram if ( cellX < 0 || cellX >= cellsPerBlockX ) return ; if ( cellY < 0 || cellY >= cellsPerBlockY ) return ; int index = ( cellY * cellsPerBlockX + cellX ) * orientationBins + orientationIndex ; histogram [ index ] += magnitude ; }
Adds the magnitude to the histogram at the specified cell and orientation