drawing lines around openCV points?

mattl's picture

Hello.. Does anyone have any experience with drawing lines around open cv points? Im interested in doing something like this.. http://www.vimeo.com/853555 ie creating obstacles/collider objects for particles or other objects in QC.. any help appreciated! Matt

dust's picture
Re: drawing lines around openCV points?

there is a patch of recent upload called centriod color tracking by jstreker and smorkis. this patch creates a mask around and object sort of like the lines in the video. normally you would do this with open cv find contours but don't think that is an option with cv tools although it is part of opencv.

i think your best bet in qc maybe to vector threshold out your image to create a mask use a duplicate of that image to create a hole in the mask which would make a line around your object then use cv tools point flow to center the mask under your object.

there is how ever a find lines in cv-tools. i would search this on the forum as there is a patch showing how to find lines. so this would work as well if your object has definable lines. i think the patch posted was referencing adding animation to shadows with cv-tools.

mattl's picture
Re: drawing lines around openCV points?

Thank-you Dust.. I've been looking into using opentsps to do this, Im starting a new thread regarding getting the OSC data into quartz composer correctly.. Cheers

lichtspiel's picture
Re: drawing lines around openCV points?

and - might there me a way to create connection-lines between the points tracked?

benoitlahoz's picture
Re: drawing lines around openCV points?

You might want to try my OpenCV plugin you can download at www.benoitlahoz.net.

It performs contours & convex hull and output a line structure, so you can get interesting points. Getting the lines is a little bit harder because it suppose that the point on image n are at the same index as on image n-1. For this you would have (I guess) to perform tracking between image n and image n-1 (camShift in OpenCV or a SURF method). But you can try to queue each point and output a line with resulting coordinates.

lichtspiel's picture
Re: drawing lines around openCV points?

i`ll check it out - thank you very much!