Image Conversion

Take a photo and hear what it sounds like!

Remember the goal of the project is to take an image and convert it into music. In this experiment we finally do that! You could call it the Minimum Viable Product, I suppose. It combines all of the techniques learned in previous sketches.

So how to we convert an image to a sequence? Obviously we begin by taking a picture. The next step is to apply a threshold filter. The motivation behind this is that users can draw their sequence on a bit of paper. When we apply a threshold, the dark ink on the lighter paper will come out to a very clean sequence. On the thresholding page, click and drag up and down to change the threshold value, to allow for the cleanest (low noise) image. leaner images result in cleaner sequences.

Then click "convert to sequence". The conversion process that takes place at this point is the heart of this experiment, and it is explained in full in the project write-up. The aridged explanation goes as follows:

  1. Take a thresholded image.
  2. Scan the image left to right, examining each column of pixels.
  3. For each column, identify the groups of neighbouring black pixels. Suppose the image is a photograph of some hand-drawn lines. Well those lines are probably going to be more than one pixel thick! So we identify which pixels belong to each of those lines by seeing which pixels neighbour each other.
  4. Find the centre points of each of those groups. The goal here is to remove the thickness of each of the lines mentioned in the example above.
  5. Map those lines onto voices in the sequence.