< Back to IRCAM Forum

Image->bpc

for example

img1.jpg

Hopefully there is input available on this topic. I am taking text from paintings (i.e. in the artist’s hand), and the bpf interface is less nuanced. Therefore, I’d like to take a scanned/photographed image, reduce contrast so it is a “simple” line drawing, then have it read and interpreted through a bpf. Thanks, Paul

Hi
Some tools from teh Pixels library might be helpful, for instance to convert a picture into a bit-map (matrix of 0 or 1) according to a given threshold.
Basic processing of this matrix (finding the x-y coordinates o the 1s in the matrix) can the yield to BPC object’s parameters.
Jean

I’ll look more closely at your library. Thanks Jean, Paul

Pixels: https://forge.ircam.fr/p/omlibraries/downloads/162/

When the lib is loaded in OM you can access a few tutorials from the Workspace window : menu Help/Import Tutorials/Libraries/Pixels

The bitmap part is clear, but the question becomes getting the X/Y coordinates out of the picture and to a BPF. (Easy to the author, I know).

waaarg1.omp (5.27 KB)

Dear Jean,
I’ve been reviewing the tutorials. Most are towards generating pics or editing existing ones - it’s not clear how to extract x and y coordinates from a pic to then get into a BPF or BPC. A simple patch is in my last message. If you could lean me in the right direction, it would be appreciated. Thank you, Paul

Hi Jean, I’m hoping you have some further info on this, when you can. Thanks, Paul

Hi, sorry for the delay.

The attached patch makes some rudimentary work but I guess that’s how far you can go with the inbuilt tools.

After reducing the size of the image you can get an array of 0 and 1 where the 0s are black pixels you want to convert into points in your BPC.
Getting these point-coordinates is pretty straightforward to program in Lisp, or as an omloop (both are in the patch).

The hard part (which is not in the patch) is to determine the right order for these points in order to follow the initial drawing.
This would require more advanced algorithms.
In other word this patch will work well only for extracting some linear functions out of the picture (a BPF).

I hope it can help anyway.

waaarg2.omp (25.6 KB)

thanks Jean, this is super useful, and creates some new challenges that i will manage independently. paul