Ask Your Question

cytathon's profile - activity

2020-10-08 03:10:12 -0600 received badge  Student (source)
2018-10-10 02:51:56 -0600 received badge  Popular Question (source)
2016-06-23 20:49:06 -0600 commented question The HOG feature extraction visualization
2016-06-23 02:25:23 -0600 asked a question The HOG feature extraction visualization

Hi all, I am using the HOGDescriptor class built-in the opencv 3.1 library. I can run the code to extract the descriptor values into the vector<float>.

compute (InputArray img, std::vector< float > &descriptors, Size winStride=Size(), Size padding=Size(), const std::vector< Point > &locations=std::vector< Point>()) const

However, I don't know which order the descriptors is stored in this vector "std::vector< float > &descriptors" row-column-bin or anything else. I really need the visualization of HOG descriptors. I also found the sample code here

http://www.juergenwiki.de/work/wiki/d...

But it seems that the order of 3 for-loops when he computes the gradient strengths conflict as usuall (we usually loop row then col then bin)

// compute gradient strengths per cell
int descriptorDataIdx = 0;
int cellx = 0;
int celly = 0;

for (int blockx=0; blockx<blocks_in_x_dir; blockx++)
{
    for (int blocky=0; blocky<blocks_in_y_dir; blocky++)
    {
        // 4 cells per block ...
        for (int cellNr=0; cellNr<4; cellNr++)
        {

I am really embarrassed at this point. Hope anyone can help me. Thank you !