Histogram equalization before extracting HOG features?

Dear everyone,
I’m new in skimage and I want to extract HOG-features from traffic sign images. The images were taken under different weather conditions.

Does is make sense to do histogram equalization before extracting HOG features?

from skimage import exposure
from skimage.feature import hog

img_eq = exposure.equalize_hist(img)
hog_img = hog(img_eq, orientations=9, pixels_per_cell=(4,4), cells_per_block=(2,2), visualize=False)

Or is that superfluous?
I’m asking because I have a memory problem if I do histogram equalization. Therefore, it would be good to know if this has any major impact on determining the HOG features.

I look forward to your opinions and thank you in advance.

Hi @codingRightNow, and thanks for your interest in skimage!

I myself don’t know the answer to your question. (Someone else might, we’ll see.) The original HOG paper is probably the best source to find the answer. Alternatively, you should take a small enough subset of your data that you can avoid your memory errors, then measure performance of your pipeline with and without histeq. Nothing beats measurement!

1 Like

I would recommend against using histogram equalization as a pre-processing step: it is too invasive, too non-linear. If you need to do a simple adjustment to ensure high contrast, I would rather rescale the image so that a certain percentile of data covers 0-1. See skimage.exposure.rescale_intensity. But since you are interested in an operation that operates on gradients, I suspect pre-processing is unnecessary.

1 Like

Thank you very much. This saves me a lot of time and I has no problems with the memory.