Today I’m setting myself a little mini project to write a little bit of code in matlab to do something which I think should be pretty cool. Haven’t used matlab in a fair while and been pondering the best way to code this, so here we go…
The task for today is to write code that’ll create a video scope of any given image. A video scope or waveform monitor* is like a histogram’s older cooler brother, pretty similar in lots of ways, but more useful in many situations.
A histogram (in imaging) takes all the pixel values in the image, arranges them in order and plots this on a graph, showing you how many pixels of each value there are in an image. This is useful for quickly assessing images, often on the back of a camera, for an objective measure of lightness/darkness within the image. Sometimes histograms are broken down to represent individual colour channels and these plots can be used for assessing colour balance.
However, histograms throw away all the spatial information within an image; you might be able to say ‘this image is predominantly dark’ but you couldn’t say where in the image it was dark. In the same way you could say that overall there was more reds in the highlights of an image, but it might require guesswork to say spatially where those bright reds were.
Video scopes in contrast retain some spatial information, and thus give you a greater understanding of the image. This added information does however make the plot more complicated to read, and this is probably the reason you don’t see them on the back of consumer cameras (or pro ones for that matter!). Continue reading “Saturday Morning Mini Project: Coding for a video scope waveform in matlab”