0

I want to computer HOG feature of an image using opencv hog.compute(image) function in python. But it gave me this error

"OpenCV Error: Assertion failed (0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows) in Mat, file /home/dipdeb/opencv-3.1.0/modules/core/src/matrix.cpp, line 469 * Error in `python': free(): invalid next size (normal): 0x0000000002b319d0 *"

here is my code

import cv2
hog = cv2.HOGDescriptor()
im = cv2.imread("35.jpg")
h = hog.compute(im)
EdChum
  • 376,765
  • 198
  • 813
  • 562
dip deb
  • 69
  • 3
  • 14
  • It seems that your image is too small. What's its size? Are you loading it correctly? – Miki Oct 18 '16 at 15:50
  • thanks for the comment. yes my picture size is too small(12*24 pixels). Actually I want to calculate small size of character in order to compare with other characters for recognition. I think I should increase it's size or is there any other option to do that? – dip deb Oct 18 '16 at 16:45
  • Or decrease box and cell sizes... – Miki Oct 18 '16 at 16:46
  • How can I do that? – dip deb Oct 18 '16 at 16:49
  • You can do that [in the constructor](http://docs.opencv.org/master/d5/d33/structcv_1_1HOGDescriptor.html#ac0544de0ddd3d644531d2164695364d9). However setting the correct parameters could be quite complex/confusing. Probably is better to just increase the image size.. Sorry for the confusion ;D – Miki Oct 18 '16 at 16:53
  • Try this link https://stackoverflow.com/questions/6090399/get-hog-image-features-from-opencv-python – 0AJ0 Jun 14 '17 at 08:20

0 Answers0