views:

615

answers:

6

So we have Histograms... Is there any algorithm to generate original image from them?

alt text

+1  A: 

No. Histograms are lossy.

Ignacio Vazquez-Abrams
Although not wrong I'd say this answer is confusing. With Lossy you usually mean lossy compression where some information is lost in the compression, but the original can be reconstructed with some tolerable error. In the case of color histograms there is simply no way that the original image could ever be reconstructed.
kigurai
I guess one could guess the type of image from the histogram and present the best matching image out of a small selection. Might work well of images of woods (green), faces (pink) and water(blue) ... One could consider that a VERY lossy compression
Jens Schauder
histograms are not images which have been compressed. they are not even an alternate representation of an image...they convey some portion of the information contained in the image, but not all. This does not mean they are lossy. They convey all the information that they are meant to. if lossy histograms would "poor man's histograms"
Egon
+21  A: 

No, because the histograms simply plot the number of pixels of various tones, not their locations.

Ben James
+13  A: 

That's like saying: "Can you reconstruct a specific painting (not knowing which one) from a couple of pots of paint?"

Wim Hollebrandse
+10  A: 

It's not possible to reconstruct an unknown picture from a histogram, but that doesn't mean there's nothing you can do. If you have a database of possible pictures, you can "fingerprint" each picture, by generating its histogram, and then use the histogram you have to search over that database of fingerprints to identify which picture it is. If you find a decent distance metric, you could possibly even use this to find pictures that are "similar" (in some very rough sense) to the picture you have.

You can't use this to say "here's a picture of the Tower of London; now find me other pictures of the Tower of London" but you could use it to say "here's a picture of a sunset; find me pictures that contain a similar set of colours", which might end up being useful to some extent.

Of course it might turn out that your evening landscape picture has a very similar histogram to something completely irrelevant, and may have a completely different histogram to a picture that, to a human, looks similar. So it's not a robust approach. But if all you have is the histogram, then it may be worth looking into what can be achieved.

Ben
Good post. The histogram can also be used for image forensics, i.e., to determine a history of operations performed upon the image. A histogram can reveal traces of luminance adjustments such as contrast stretching, equalization, or gamma correction. For example, see the first two publications of my colleague here: http://www.ece.umd.edu/~mcstamm/research.html
Steve
Right. In fact, color histograms were the first feature to be used in image-search systems, IIRC.
Darius Bacon
+2  A: 

A histogram doesn't carry any spatial information. I mean, it's not possible to find the x,y position of the pixel that contributed to a particular histogram bin. The histogram only represents image global brightness information.

Andres
+1  A: 

Histogram only carries and provides information about what's distribution of tones in an image. It is an aggregation of discrete information encoded in original image - how many pixels have particular values. Thus, it's not possible to generate original image without providing addition details like what's location of pixels, etc.

mloskot