Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

HOG-Descriptor malloc freed error

I am trying to calculate the HOGDescriptors for a roi of an image but I am getting the following error:

HOG-Descriptor(34411,0x10618d340) malloc: * error for object 0x106654a98: incorrect checksum for freed object - object was probably modified after being freed.

  HOGDescriptor h;
        h.winSize =  Size(windows_n_rows, windows_n_columns);
        vector<float> descriptors;
        for(int k=0; k<=img.rows-windows_n_rows; k+=Step_slide){
            for(int m=0; m<=img.cols-windows_n_columns; m+=Step_slide){
                // Resulting window
                Rect window(m, k, windows_n_rows, windows_n_columns);
                Mat Roi = img(window);
                h.compute(Roi, descriptors);
                Mat feature(descriptors, true);
                Mat k = feature.reshape(1,1);
                forest.predict(k, pred, task3_trained_trees, confid);
                float classId =<float>(0,0);
                float c =<float>(0,0);
                if (c > 0.5){
                    if(classId != 3.){