'Ratio Histograms of two images

For a cigarette detection project, I have been trying to implement the methodology given in the paper

I am stuck at implementing the following part: enter image description here

I have been able to generate image histograms, however yet to find a way that gives me the ratio. Any help is appreciated



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source