You are here:

Lightact has 2 computer vision nodes that try to find features in an incoming cvMat. They are Find CV circles and Find CV contours.

find circles and contours

In short, Find CV Circles finds minimum enclosing circles of all the blobs it finds in Source as long as the radius is between Min circle and Max circle inputs. It outputs a Tracking cvMat with the circles drawn and an array of Vec3 that includes x, y and radius of all the circles that it found.

Find CV Contours finds contours of all the blobs it finds in Source. Approximation input governs the number of points each contour is described with. It outputs a Tracking cvMat with the contours drawn and a Contour variable type including the information about all the contours.

[vc_message]You can download the sample video file we are using in this guide here. It shows a FLIR recording from above of 2 people walking. To make programming easier, please make sure Ignore Pause boolean input on Video reader node is checked.[/vc_message]

Find circles

find circles layout

The above layer layout is very similar to the layout we used in the MOG2 Background Subtraction user guide, except that we added a Find CV Circles node between the MOG2 Background Subtraction and cvMat to Texture nodes.

Please note: you don’t necessarily need to have MOG2 Background Subtraction before Find CV Circles node. Depending on your original cvMat you might get away with just Find CV Circles node.

Node inputs

  • Source is the cvMat you’d like to find minimum enclosing circles in.
  • Min circle is the minimum radius of the circles.
  • Max circle is the maximum radius of the circles.

Node outputs

  • Tracking is a cvMat output with circles drawn in different shades of grey
  • X, Y, Radius is an array of Vec3 containing the x and y coordinates of the center of the circle as well as its radius. You can connect it to Shared memory sender node to pass the data to Unreal Engine for advanced real-time rendering.

Find contours

find contours layout

The above layer layout is very similar to the layout we used in the MOG2 Background Subtraction user guide, except that we added a Find CV Contours node between the MOG2 Background Subtraction and cvMat to Texture nodes.

Please note: you don’t necessarily need to have MOG2 Background Subtraction before Find CV Contours node. Depending on your original cvMat you might get away with just Find CV Contours node without the MOG2.

Node inputs

  • Source is the cvMat you’d like to find minimum enclosing circles in.
  • Approximation determines how many points will there be in each contour. The lower the number the more points.

Node outputs

  • Tracking is a cvMat output with circles drawn in different shades of grey
  • Contours is a variable type that contains the information about the contours. You can connect it to Shared memory sender node to pass the data to Unreal Engine for advanced real-time rendering.
Previous CV Canvas
Next Optical flow