We are a Novanta Company

VIDEO: Clarity Machine Vision Software – The Finder/Measure Plug-Ins

In this video we’re going to talk about the Finder tool and also how it can be used along with the Measure tool to bring out some of the information in the images. For the images, we have some canned images of centrifuged blood that you can see the red blood cell layer as well as the white cell blood layer above it. And what we’re going to do for this exercise is find the various layers of the blood types in our test tube and then actually measure the distance between the layers. So in the case if we just wanted to get the plasma out of the blood, we would be able to inform the host system where within the test tube to find the plasma and where to stop and not get the red blood cells or the buffy coat.

So first off what you’ll notice here is these are a series of color images. And for the purpose of our Finder tool and our Measure tool, step 1 we have to use the Process Type to Convert To Grayscale image [below image]. Which you see there. Now that we have the images converted into a gray scale, I’m just going to work with this one test tube in the center here. We bring up our Finder widget [at top of screen]. And you’ll notice it brings up an area of interest, which I’m going to drag over to our test tube and expand over the length of the test tube. And you’ll see immediately that it found one of the edges. In this particular case we’re looking for Find Line [below image]. Later on we can talk about Finding Corners and Find Circles. But we’ll concentrate on Find Line here.

Some of the options you’ll see for Finder Options, in this case it found the Strongest line, which happens to be the very top of the plasma. The other options are Left Most [drop down menu], which you’ll notice when I hit this, we’ll have to zoom in here a bit, but you can see this line is now at the top of the red blood cells. Even if we wanted to expand this down to the bottom, we’ll find the bottom of the test tube. But for the purposes of this video what we’re going to do is just concentrate on these two layers.

So I’m going to drag these both up. So on the Left Most case it finds the bottom of the interface between the plasma and the red blood cells. In this case Middle Most isn’t going to do much it stays on the Left Most. If we drag it down to the bottom, Middle Most gives you the interface, Left Most gives you the bottom of the test tube, and Right Most will give you the top, which also happens to be the strongest. So, now that we’ve found the top layer, or the meniscus, what we want to do is try to find the interface between the two types of blood.  Our Finder comes up. We have to drag it over to our test tube of interest, in this particular case, and we’ll basically lay it on top of the region of interest we had before. So once again, the default is strongest. So it finds the top. What we’re going to do in this case is find the Left Most, so you’ll see the yellow line or the Finder finds the interface. That was actually fairly straight forward.

Now what we want to do if this was a machine vision application and we only want to get the plasma off and know how deep or what the distance is between the plasma and the red blood cells, we’re going to use the Measure tool. I’m going to Measure the distance between the two using the Measurement tool. I’ll click on this [Finder] and one thing you’ll notice just the way the tool is structured, you can measure between various Finder objects. In this particular application, I only have two, so it defaulted, which happens to be the Finder and Finder 1, which is the interface between the two layers. It automatically calculated the pixel difference between the two at 151 pixels. Zoom in so you can see the line that it drew. So Finder finds the top, Finder 1 finds the bottom, and then the Measure tool automatically drew the line in between the two Finder patterns, which happens to be 151 pixels. With a little math, knowing the sensor resolution and the distance between the sensor and the object of interest, in this case the test tubes, we can actually convert that pixel measurement into an actual millimeter measurement, and then ultimately give that information to the host system to siphon off the plasma off the top of the centrifuged blood.

Next, we’re going to continue with the Finder tool, but we want to highlight some of the different features of the Finder tool, in this case finding Circles. What we have here in our canned image is a rack of test tubes imaged from above, we’re going to Step 1 change our Finder widget [Find Type] from Find a Line to Find Circle Options, and you’ll see that the graphic changes to a circle. And right away it found the center of the test tube, and as I expanded out, it finds the outside of the test tube. These test tubes happen to be the type of test tubes where the center of the test tube as it goes near the bottom actually diminishes in size. So what we want to do for the purpose of this video is measure the center to center distance between these test tubes.

In this case the inner most, as you can see, this widget is having trouble finding the center spot. If we move it, it still finds the outside of the test tube. So what we might have to do here is actually delete this step and enhance this portion of the image a bit. We’ll go to the Image Process widget. Go over our test tubes, and in this case it’s Sharpen but I really want to bring this out, so I’ll go to a Histogram Equalization. You’ll see the contrast is dramatically increased.

We’ll go back to our Finder tool. Change it to Circle [under Find Type]. Bring it over the center. We’ll find the center radius, and as we expand it still finds the outside. But in this case since we enhanced it, we look for the inner most circle. It does find the center section of the bottom of the tube. So the difference Outer Most, finds the outside top of the test tube, Strongest, still going to be the outside top of the test tube, but we can go and pick the inner diameter at the bottom of the test tube by picking Inner Most.

Now what we’re going to do is try to measure the distance between the centers of these two test tubes. Now that we’ve found our inner diameter of our first circle, let’s use the Finder tool, once again, to find the center point of our second test tube. Bring that up, and we need to change it from Line Finder to Circle. As you can see with that placement we immediately find the center of the test tube, but what we want to do is actually expand this out, so we can see not only to find the strongest or inner, but can we find the outer? Yes in fact, we do. We can see the outer circle at the top of the test tube. Then switch it to the Inner Most and we find that inner center circle at the bottom of the test tube. This one is a little off axis, so you can see the center is skewed to the left a little bit, where the first test tube was right above the camera. Nonetheless, we have found that the center point of both of our circles. At which point we can use the Measure tool to find the distance between the two center points.

As you can see since it only has the two finder patterns, it immediately goes from Finder 1 to Finder 2 and measures the distance between the centers of the two test tubes as 123 pixels. And as before, if we had information on the specific distance and we know the sensor resolution, we can turn those pixel values into actual millimeter or inch values.