Loading...
Logo
Processing Forum





this library contains tools that are used in the field of computer vision.
its not a wrapper of openCV or some other libraries , so maybe you are missing some features ( ... which may be implemented in the future).

its designed to be very fast to use it for realtime applications (webcam-tracking, kinect-tracking, ...).
also, it works very well in combination with the kinect-library ( dLibs.freenect   ) ... which i basically built it for ... to track blobs, generate contours from 3d-data, and else.
it should work in combination with other libraries too, since the blobdetection is very flexible and works with any given data-arrays.

the examples, that come with the library, demonstrates:

  • kinect 3D/2D tracking (requires dLibs.freenect v01.10 or higher)
  • a simple marker tracking
  • image-blob tracking

FEATURES:
  1. connected component labeling - blobdetection
  2. contours:
    continuous polyline
    a blob has only one outer contours, and can have endless inner contours
    the outer contour always goes in clockwise-direction, the inner ones go counter-clockwise
  3. convex hull
  4. double-linked-list (used for the covex hull for quick node adding/removing)
  5. polyline tools (simplification, area-size, length, etc.)
  6. color class for fast generating/extracting of color components













Replies(8)

Excellent!

As a minor note, the download page link points to the blog home instead to the specific section about the cv library.
perfect... some great features so far!
hey! how would you go about collision detection?

i tried stuff like:

Copy code
  1. public void BallTouchesContour(ArrayList<Pixel> pixel_list, List<Ball> balls_list){
      for (Pixel p : pixel_list){
        for (Ball b : balls_list){
          //if (round(b.pos.x)==p.x_ && round(b.pos.y)==p.y_){
            if (b.pos.y > p.y_ && round(b.pos.x)==p.x_){
            println("yay");
            b.vel.x*=-0.98;
            b.vel.y*=-0.98;
          }
        }
      }
    }

i'm using the above function in your "kinect_2D" example which i added a ball class to: 

calling the function like this: "BallTouchesContour(contour.getPixels(), balls);" in the loop that iterates through the blob_list, which in turn gets the contours from the blobs. 

my problem is: with my function there's a ~50 percent chance that the balls don't bounce off of the contour but go through it and bounce around inside the contour.
hi,

hm, so far i never did something with collision detection except the simple one (orthogonal bounds), .. so i dont have really much experience in that field.
but after a quick search, i think its a little bit more complicated than just one condition.

if i have the time, i will post an update on this (collision circle-polyline),... but i cant say how long this will take.

heres a forum-post that might help you more. it seems that toxiclibs also has collision-detection.
https://forum.processing.org/topic/2d-collision-detection-irregular-shapes-computer-vision-blobs

but you definitly should simplifiy the blob-contour ( there's an example in the library how to do that)  for two reasons:
1) you get a smoother polyline
2) with less vertices, which will improve speed a lot.

hth, thomas

ok thanks! another useful feature would be a method that returns the position of the "last" blob, so one could calculate the velocity and direction of the "current" blob :D. how would you do that? 


do you mean, the position of the blob int the previous frame?
if so, you could just copy all the values (center, contour-pixels, etc. ... what you need ) after each update. (same as mouseX and pmouseX).

i didnt include such things into the library, because this can slow down the update a lot because of all the copying.
blobdetection, connected component labeling, contour generating are already very cpu-consuming features.

if someone needs such a feature, an individual solution is the best i think, because not everyone needs the same copyied data.


ok i see! btw thanks for the library 

just finished my first kinect work using your library and toxiclibs:  http://vimeo.com/29536235