OpenCv Tools

OpenCv Tools

Summary

This demonstration shows off some of the tools in the built-in OpenCV tool set. These tools have been implemented using the tool C API and the OpenCv integration API. The full source code of these tools is available in the VisionAppster SDK that comes with the installer.

Downloads

Detailed description

Let us walk through a simple application that uses both VisionAppster and OpenCv tools. The application segments blobs from input image, calculates the distance transform which describes the "closest territory" of each blob. Finally, it finds the convex hull of the centroids of the blobs, creating "a perimeter fence" that encircles the set of blobs.

As usual, the image originates from an Image Source and is passed on to a Detect Blobs Tool. The output is split to two processing branches. Let's first go over the left branch.

  • Binarize Tool is configured to produce a binary image which has zero pixels (black) inside and ones (white) outside of the blobs.

  • The binary image is passed to a tool which calls the distanceTransform OpenCv function. MaskSize and DistanceType options can be selected from drop-down lists.

  • Color Distance Tool inverts the gray levels of the Distance output of the previous tool in order to improve the visual output. The brighter the pixel, the closer it is to a blob. Pixels inside the blobs are white.

The tools in the rightmost processing branch are:

  • Analyze Blob Geometry Tool inputs the labeled image from Blob Detection Tool. The output of interest is Centroid which contains coordinates of the centers of the blobs.

  • The coordinates are passed to a tool which calls the convexHull OpenCv function. It selects the centroids that are on the outer perimeters of the set of points. The perimeter points are listed either clockwise or counter-clockwise, depending on the value of the Parameter flag.

The colorful display with the title Multiple parameters shows the Labels output of the Distance Transform tool. The color map of the image display has been set to Light Colors. The output of the Level Thresholding tool has been overlaid with the labeled image. Also the Centroid output of Blob Geometry Analysis has been dragged and dropped on the image. The coordinates are shown as connected points.

Pills, segmentation of the distance transform and its inverse.

Pills, segmentation of the distance transform and its inverse.