We are a Novanta Company

VIDEO: Clarity Machine Vision Software – The Presence/Absence Plug-In – Part 2 and Part 2

I’m going to show you how to run the script in the device and test in the actual camera. I restarted Clarity and I’m going to select FM-5, which is the camera that we’re actually using here. Before I was working offline from images on my hard drive. Now I’m going to select USB, I know my camera is set up on Com6, and let’s click next. I already have the job loaded into the device. Now I’m just going to reload it here from the camera back to my PC. I’m going to acquire image. So now I have a good image here that I can test.

You can see my test tube in the fixture that I can test. I have a few different variations and I can play around with that test tube and see really what happens and how well I set up my script. To start you see the test tube is present, the cap is present, and the barcode is present. And all those different steps pass, which is a good thing.

So let’s just take the whole thing out [removed test tube] and run and everything should fail. Well that’s good. If that didn’t work, it would be very bad.

Now I’m going to take the cap off the test tube and set it off to the side there. We’re going to run it again. And hopefully everything will pass, except for cap presence. Which is exactly what it did.

Let’s put the cap back on, run again, and everything should pass this time.

The one thing I want to start playing with now is the barcode. Because the barcode can be rotated really anywhere, 360 degrees around this test tube. So let’s start first with it all the way around. Okay barcode is not present, which is good, because you can’t see any of it. But let’s see what happens if I just have that text in the front. Because I wouldn’t want to detect that text and have the camera think it’s a barcode. That failed, and it’s actually a good thing. Because you can see from the image from my area of interest that I have very little of the barcode in there but I have the text in there. So this is where you’re going to want to adjust our threshold to make sure we don’t detect handwriting or text like this as the barcode.

You can see I have 710 edge pixels, well I have my threshold at 700. So let’s raise that a ways, say 860 and see what happens. You can see it failed there. Now let’s just turn the barcode a little bit and see at what point it actually starts to pass. Okay, at 1038 pixels there, the barcode is turned mostly in front of the image, so that seems to be passing. So this is an example where we’d want to take a whole bunch of images of this barcode, maybe rotate that test tube in very controlled steps. And gather all those different images to make sure our script is actually performing the way we want it to.

Now that I’ve adjusted that threshold, I want to take that script and send it back to the device. There it is. And I’m also going to save the script to the hard drive.

That’s a quick presentation of how you would test the images and test the script in the device.