Skip to content
Advertisement

Why can’t I plot image histogram’s in python-OpenCV

I have to get a image, apply Histogram equalization and plot the histogram of both images (original and modified). So I tried this code:

JavaScript

But The plot returned is..: enter image description here

How can I fix it?

Advertisement

Answer

You are not creating a new figure, so the histogram is plotted on the last figure that displays the image.
You may create a new figure before plotting the histogram:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement