We are a Novanta Company

VIDEO: Clarity Machine Vision Software – The Color Detection Plug-In – Part 1 and Part 2

In this video we’re going to demonstrate the color detection tool that is included in Clarity 2.0. What you’ll notice in this video is how easy it is to get it up and running, to train the camera to look for specific colors, and how easy it is to employ this tool on JADAK’s smart vision cameras.

In this demonstration I’m going to program the cameras to look for two different cap types. I want it to be able to differentiate between green or red in this case. In many clinical analyzers, the cap color will determine the different kinds of tests that are going to be required. So in this video, I’ve already acquired an image of a test tube here with a green cap on it. And so the first step that you’ll do is select the Color Detection tool from the toolbar up at the top. You’ll see the color match tool will then appear in the Step List here on the left. So the very first thing you’ll want to do is to train the camera to look for a specific type of color, to tell that camera that the certain color is going to be identified, and either therefore acceptable or not acceptable.

You’ll need to click the Train Colors button here [bottom below image] and when you do that it’s going to bring up a pop-up window and within that pop-up window you’ll see a square region of interest. Use your mouse and the cursor to move that region of interest over the area you want to train to look for a specific color. Now I’ve used the bottom right corner of that square to extend and size accordingly. And I’ve highlighted the bulk of the green cap on this test tube. You can see the corresponding color appear under the matching dominant color bar on the right. And this is showing a dark green color, and what that represents is the majority of pixels that show up in my region of interest. In this case I want to train the camera to look for a green cap. Once I do that, click the Add Color button and you can actually double click on the label to type text for what you want to call that color on your script and have it be listed in the output once you ask the camera to look for a specific color.

I’m going to then click the close button and you’ll see at the top corner of your live image the region of interest you want to move to actually provide the analysis of color matching or color detection. In this case I’m going to put it similarly in an area over where the cap would be positioned on the test tube, and you can see that the border of the region of interest in this border turns green. So that is a live analysis to say that this is a color match from the color that we trained previously, as well as in the Step List over here that’s turned green, and you’ll notice that the output has actually included the text that we told it earlier when we called it a Green cap.

Down here in the Train Colors table, you can see the label we applied, the color that we’re looking at, and a measurement distance. It’s actually looking for a differentiation between between the color that we trained and the color that it’s seeing in the live picture. A number below five represents a good match, anything above a 5 will be rejected as not a color match.

Now I’m going to show you how we can train additional colors. If I remove that test tube and replace it with a test tube with a red cap, I can then acquire a second image. And once that image is acquired you’ll notice I have a test tube with a red cap. And the live image then analyzes this color to say it’s not a good match. The border of the region of interest then turns red, as well as my step output. But I’m then going to train the camera a second time in the same manner. I’ll click Add Color and apply a label, this time calling it “red.” Click the close button and notice that the distance between red is less than five, so I’m getting a success. Between looking for a green cap and a red cap, it says yes to the red cap and no to the green cap. So my output shows red versus the green.

You can download this script directly to the camera by selecting “send job to the device.” This will send the script to the camera itself. And you can run in a mode where the camera looks images directly, without Clarity running on a laptop.

In this example I’ve showed you how you can train Clarity to look for two specific color types. Of course we can program it to look for several more, using the same method I showed you earlier. Once the job is then uploaded to the camera, JADAK’s smart camera will operate independently looking for the specific color types that you’ve trained.

Hopefully this example has shown you how easy it is to employ color detection and train a JADAK smart camera using Clarity 2.0.