Polyga Main Logo Mobile

Case StudyAutomatically Track Objects with the Polyga’s V1 and OpenCV

Polyga Vision V1 3D Scanner inspection

Polyga Vision V1

The Vision V1 is a high resolution – high speed 3D camera that is used in pick and place application, surface inspection, medical imaging and automated part inspections.

V1 Computer Vision Application

Polyga Vision V1 3D Scanner inspection

We paired the V1 with OpenCV, an open source computer vision library to show how you can acquire data in real time using SBSDK and then process the data in OpenCV to automatically find and track an object in space.

Below image is a sample project written to take simultaneous scans and output the data in real time. With the V1 it is possible to capture upto 15 frames of point cloud data for every 1 second.

Polyga SB SDK developer tools logo

C++ project examples which is included in our SDK

The data that needs to be used here is a depth map. Depth map is an image or an image channel that contains informations related to the distance of the surfaces of scene objects from a view point.

You may also change the camera exposure and projector brightness.For dark colored objects, you would need higher exposure and for light colored objects a lower exposure value would need to be set.

On scancaptured is a callback function when a scan is captured and Outdepth is the variable that contains the depth map. We have used a mat class which is basically a derived class in OpenCV library to store values of images. CV_32FC3 defines the type of matrix in the mat class. It means that three channel matrix of 32-bit floats would be stored. Now that we have the X, Y and Z in the mat class, the openCV split function can be used to split and store them individually. With these data, it is now possible to write functions for pick and place applications, flaw detection, and feature measurements.

The function detectCircles essentially detects circular objects. This is a very basic but classic example of pick and place application. The openCV function Houghcircles can be used here to detect circular objects. The minimum and maximum radius of the circle that needs to be detected can also be predefined here.

Polyga Vision V1 3D Scanner inspection banner

V1 is connected to the computer and there’s a bin full of random objects within its field of view.

If I call this function, the circular objects is detected as you can see from the live feed. The bin can also be moved sideways and V1 should still be able to track the object. It is also possible to measure radius of the circle in real time and this can be done for other objects of different size and shapes. On the other hand,the function Detectedges is used for flaw detection application and using gaussianblur and Canny edge detection, we will be able to find the outline of objects.

Polyga Vision V1 3D Scanner inspection square

DetectEdges example: Two boxes of different sizes

This would be very similar to a go or no go situation in an automated inspection line. Using X, Y and Z coordinates, the dimensions of the box can be measured in real time. I hope of some of these examples have given you an idea of what the V1 is capable of. If you have any questions, feel free to reach out to us at contact@polyga.com