Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Pointers for making a polargraph processing sketch
AndyB
Beginner
Posts: 28
Permalink
AndyB
Post Pointers for making a polargraph processing sketch
on: November 29, 2013, 09:27
Quote

Sooo, now that Sandy is making a polargraph library for processing I figured it was time to get down and dirty and try to program a little drawbot sketch for it. I'm pretty much a noob when it comes to programming/processing, but know the basics (and I'm a copy-paste-borrow pieces of code here and there expert!). It would be a great way to gain some programming experience.

The sketch I'm envisioning would take an image and trace it to a vector output. Very much like Sandy's webcam feature in that previous version of the polargraph controller, but without those closed path layered blobs type of output. I want open paths (and lot's of pen lifts) for a more realistic looking drawing.

I'm thinking of using the openCV for processing library, and it's "canny" edge detection function. (https://github.com/atduskgreg/opencv-processing) It pretty much does half the job, only problem the output is raster paths. I need to figure out a way to convert the openCV raster output into 1 point vector paths so the polargraph can draw it.

So, for those of you with the know-how, any pointers,tips,tutorials or links are greatly appreciated!

Maybe I'm being naive here, and this is really difficult to achieve..Or maybe I should approach it in another way, i.e point cloud/pixel color values. I've searched the web high and low on the subject, but having a hard time finding any useful info.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Pointers for making a polargraph processing sketch
on: November 30, 2013, 21:27
Quote

I'll admit that I found getting openCV installed and working at all was an entirely frustrating and fruitless exercise - if you have managed that, then you are (at least) one step ahead of me!

In the live trace stuff I did, I struggled to bridge that last gap too - having generated bitmap blobs, how to trace them effectively into vectors. I'm positive it is a well-solved problem, but I really laboured on it. I don't have much insight into graphics - it's a very mathsey kind of area, and not my strength at all.

I don't think there's a strong developer community here, partly because the polargraph code has traditionally been so... uninviting, so I guess you'll probably have more luck on the processing boards. The polargraph library will be pretty agnostic about what it plugs into, so there needn't be anything special about how the source vectors are generated.

I am currently on the horns of a dilemma about what kind of geometry library to use. Geomerative is Processing-only, but very nice and quite well liked, though slightly over-capable for what I'm using it for. The java.awt.geom package is part of the core java runtime environment so is ubiquitous, but it's also deprecated in Processing 2 because it is not available on Android, it's probably made fun of because it's old fashioned and it's clunky in the way that java likes to be.

The reason I'm mentioning it, is because the interface to the polargraph library will likely take objects in the form of one of these (maybe both) objects. If you end up using geomerative (RShape and RPath etc), then polarlib is likely to understand that natively.

Good luck!

AndyB
Beginner
Posts: 28
Permalink
AndyB
Post Re: Pointers for making a polargraph processing sketch
on: December 2, 2013, 16:16
Quote

Yeah I also had a hard time getting openCV running, but that was with processing 1.51. I had to experiment with different versions and what not. With P2 it's running just fine out of the box for me.

I figured I would try my luck here before bugging the guys over at the processing forums, they seem so grumpy at times and I don't want to step on anyones toes. I'll do some more research first methinks. Hmm, geomerative might actually be my missing link for drawing the paths, does seem a bit complicated though. Like you said it's well liked, I've seen it used in a lot of interesting drawing type processing sketches. Guess it makes sense to have polarlib take cues from it. Then again I'm a noob and you know this stuff much better than me! 🙂

Thanks for the goodluck, going to need it!

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Pointers for making a polargraph processing sketch
on: December 2, 2013, 21:04
Quote

Aha, I never tried with Processing 2, maybe that's (one of the places) where I was going wrong. Problem with forums is that it's hard to use them except for specific problems, so you can give an example and say "how should I fix it". You need to give it a shot figuring it out on your own first though, then describe how far you got, and what is going wrong and what is going right.

I've got the queue / serial port stuff left to do on the library, and then I can start testing properly. But it's going ok!

sn

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.03 seconds.