How to: Pixelise a webcam stream using OpenCV
r3dux | December 8, 2010There was a video the other day which I posted about where the video footage was all highly pixelised into circles of varying sizes and colours, and I reckoned I could produce a similar effect by either resizing the stream down so it’s really blocky then scaling it back up or reading all the pixels in a block, averaging the colour and then drawing blocks of that averaged colour.
Well, I had an hour or so today to do a bit of “me-coding”, and in the end I took the second option.
![]()
The pixelisation works on the live stream, and you can drag the slider around to switch through from 1 division (i.e. the entire window is one block of solid colour) to 160 divisions.
I’ll bring the values into OpenGL and see what I can do with points and the like when I have another hour or two spare over the coming few days – fun stuff =D
Source code after the jump for those interested…









