Reverted back to the previous method where a public method groupRectangles was added to HOGDescriptor to take care of ROI and weight grouping