Group Admins

  • Profile picture of Karim
  • Profile picture of Jean

OpenMusic

Public Group active 4 days, 7 hours ago

User group for OpenMusic and computer-aided composition. Visit the Forum for discussions.

image->bpc

Author 2 Subscribed Users |
steenhuisen
steenhuisen

for example

  • This topic was modified 5 months, 3 weeks ago by steenhuisen steenhuisen.
  • This topic was modified 5 months, 2 weeks ago by Profile photo of Jean Jean.
Attachments:
  1. img1

    img1.jpg

December 3, 2016 at 04:45 #20040
steenhuisen
steenhuisen

Hello,
Is there an existing method or workaround by which I can take freehand line drawings (black on white background and get the black line data into a bpf?
Thanks,
Paul

December 3, 2016 at 04:45 #20039
steenhuisen
steenhuisen

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

December 7, 2016 at 10:17 #20078
Profile photo of Jean
Jean

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

December 7, 2016 at 10:31 #20079
steenhuisen
steenhuisen

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

December 7, 2016 at 10:37 #20082
Profile photo of Jean
Jean

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

December 7, 2016 at 10:39 #20084
steenhuisen
steenhuisen

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).

  • This reply was modified 5 months, 1 week ago by steenhuisen steenhuisen.
Attachments:
  1. waaarg1.omp
December 7, 2016 at 22:20 #20114
steenhuisen
steenhuisen

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

December 16, 2016 at 23:57 #20244
steenhuisen
steenhuisen

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

December 30, 2016 at 23:42 #20333
Profile photo of Jean
Jean

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.

January 3, 2017 at 00:42 #20349
steenhuisen
steenhuisen

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

January 3, 2017 at 07:51 #20352

You must be logged in to reply to this topic.

Log in now