26 Apr

Using the Cognex In-Sight 7000 Gen II Status Lights

Cognex 7000 Gen II Status LightAt KTM Research, we have been testing the recently release Cognex In-Sight 7802 Gen II camera.  One of the most interesting features of the In-Sight 7000 Gen II series cameras is the new on-camera illuminator.  This is a major new feature that opens up a lot of new possibilities like the SurfaceFX tool that we looked at more in depth on an earlier blog post.

One of the less touted features, but one that we think will be really useful is the 360 degree status light! Cognex has taken one of the two user-controllable status lights and redesigned it to encircle the entire camera.  This makes the status light visible from any direction.  The second user-controllable status light (red) remains located on the interface panel with the other lights and buttons.

Controlling the status lights

Cognex documentation could do a better job informing users of the user-controllable status lights in general, and how to use them specifically.  If this is something you have not done before, it’s pretty straight forward.  If you have ever used discrete outputs on the In-Sight line of products, this will look very familiar to you as it is essentially the same  process.

It’s always best to use a relatively up to date version of In-Sight Explorer.  I am currently using In-Sight Explorer version 5.4.0 for this example.  You can always find the most up to date version from Cognex’s In-Sight Support Page here.

Open In-Sight Explorer, log into your camera, and open a new spreadsheet view.  If you are in EasyBuilder mode, switch to spreadsheet view by pressing the Ctrl+Shift+V keys.  Once in spreadsheet view, you are going to setup two cells.

In cell A1, type “CheckBox” without the parenthesis and press enter.  You will get a popup window like the one shown below.  If you copy/paste it, make sure that the leading tick mark (‘) is deleted or else it will be treated like a comment.  Type “Light” into the Name field as shown and click the OK button.

Cognex In-Sight Explorer CheckBox Window

In cell B1, type “Button” and press enter.  You will get the button configuration popup window like the one shown below.  Type “Set Light” into the name field and press the OK button.

Cognex In-Sight Button Window

In the next cell to the right, C1, type “WriteDiscrete” and press enter.  You will get the WriteDiscrete popup window like the one shown below.  In this window, we are going to change several of the fields.  For the event and value fields, you can either type in the data shown in the image, or you can double-click on the name portion of the window for the field and then double-click on the spreadsheet cell you want to set it to.  For the event field, this should be the button created in cell B1.  For the value field, this should be the check box created in cell A1.  Set the start bit field to 4 for the green wrap-around status light.  When you have your box setup like this, press the OK button.  (Note: you can come back to this step and set the start bit to 5 to toggle the red user-controllable light.)

Cognex In-Sight WriteDiscrete Window

Now you should have a spreadsheet that looks like mine below.  When you are ready to test this, put the camera into “online” mode by clicking on the online/offline button in the top menu, or by pressing Ctrl+F8.  When the camera is online, you should see the green box with “Online” as shown at the bottom right of my screenshot below.

Cognex In-Sight Example Program Window

 

With the camera online, you can set the light status with the check box.  To make the light change, you will need to trigger the DiscreteWrite to update the bit registers.  In this example that is done by pressing the set light button.  Go ahead and play with checking or unchecking the check box and pressing the button.  You should be seeing the light turn on and off.  If not, make sure that you are in online mode.

You now have the basic framework to start exploring the user-controllable lighting.  By using different value cells that are automatically calculated, and events triggered by your software instead of the button, the use options are almost endless.

About KTM Research:

KTM Research is an engineering firm that specializes in industrial machine vision systems for quality control and vision-guided robotics.  Formed in 2009, we are located in Tualatin, Oregon.  We serve industries in the fields of advanced manufacturing, consumer electronics, bio-tech, food and beverage, research, and logistics.  Our systems have been successfully used by customers across North America and Asia.

Our goal at KTM Research is to be the first call you make when faced with a vision challenge.  Our team of engineers view themselves as an extension of your organization and strive to be your trusted vision partner.  Our success is our clients’ success.  Our collaborative approach to projects with our conservative and robust design process allows KTM Research to successfully complete projects that many others cannot.

Contact KTM Research at info@ktmresearch.com for more information on our vision solutions.

 

24 Apr

Cognex SurfaceFX Feature Extract Tool

Cognex SurfaceFX Featured Image

Cognex’s SurfaceFX tool offers a new way to inspect physical features that are engraved, embossed, stamped, etc.  It can find physical defects such as scratches, dents, puncture holes, etc.   SurfaceFX outputs an image that any of Cognex’s existing tools can use to analyze.  Cognex SurfaceFX opens up many possibilities for inspections that would otherwise be difficult or impossible.  We have included some sample imagery below captured at KTM Research’s facilities to demonstrate the capabilities of SurfaceFX.

SurfaceFX Feature Extract Tool

Cognex In-Sight 7802The Cognex SurfaceFX capability are available on the In-Sight 7000 Gen II series of cameras.  The feature is enabled by the new on-camera illuminator that offers individual control of four lighting quadrants.  By capturing four separate images each illuminated by one quadrant of the illuminator, a reconstructed image similar to photometric stereo can be achieved.  While not true photometric stereo, as available with MVTec Halcon’s photometric stereo feature, the Cognex SurfaceFX feature extract tool gives a similar effect with much less work.

Independently controlled quadrant illumination

While the new on-camera illuminator’s independent control of the four quadrants enables the SurfaceFX tool, it also opens up other new imaging possibilities that would have previously required complex off-camera hardware.  Below is an example of a ping pong ball being imaged with each of the four lighting quadrants (left, top, bottom, right) demonstrating the directionality of the light. Cognex In-Sight 7000 Gen II Quadrant Light

The SurfaceFX tool takes these four images and generates the SurfaceFX image.  The SurfaceFX image can then have any of the other Cognex filters, tools, or scripts applied.  The new on-camera illuminator with independent quadrant control opens up many possibilities for novel inspection methodologies.

SurfaceFX Application Examples

The most direct and simple use of Cognex SurfaceFX is to find physical defects (bumps, holes, etc.) in a smooth surface.  The example below shows a coffee creamer pouch with a small hole in the seal.  With traditional illumination (left), this would very difficult for machine vision software to successfully identify.  With Cognex SurfaceFX (right), the physical features, including the hole, are obvious while printed text/graphics practically vanish.

Cognex SurfaceFX Example Creamer Hole Defect

Below is an example of a foil packet with a lot code and expiration date stamped into the material.  The shiny surface would normally make this inspection extremely difficult, even with off-camera lighting.  SurfaceFX and the on-camera quadrant illumination make the stamped features stand out with enough contrast for simple inspection.

Cognex SurfaceFX Example Pill Pouch Embossed

The example below is of an debossed lot code marking in an injection molded part.  The original image (left) shows that with lighting setup to eliminate glare on the marking, low contrast makes the inspection very difficult.  With SurfaceFX (right), the marking stands out in high contrast to the background and allows for easy OCR.

Cognex SurfaceFX Example Power Supply Marking

The examples above highlight features with sharp edges.  Features with sharp edges work especially well with SurfaceFX but SurfaceFX can work equally as well with softer features.  In the example below, the embossed information on the bottom of a coffee creamer is difficult to impossible to read (left) using machine vision.  The SurfaceFX image (right) does an excellent job extracting the physical features with enough contrast for analysis.

Cognex SurfaceFX Example Creamer Bottom

The Solo cup lid below shows a difficult, but potentially possible text extraction application using diffuse lighting.  This type of inspection is made significantly easier using SurfaceFX to increase contrast of the physical features.  Like the coffee creamer example above, the lid has softer, rounded features, but SurfaceFX is still easily able to extract the features with sufficient contrast for analysis.  Again, this example is using a stock In-Sight 7000 Gen II sensor with only the on-camera illumination.

Cognex SurfaceFX Example Solo Lid

One key area that Cognex SurfaceFX excels at with the on-camera lighting is imaging features on shiny or glossy surfaces.  This was an almost impossible task before, but SurfaceFX easily extracts psychical features regardless of glare.  The example below of a Leatherman tool would have been impossible with on-camera lighting without SurfaceFX.
Cognex SurfaceFX Example Leatherman

In addition to imaging shiny surfaces, Cognex SurfaceFX can extract very fine details that would otherwise be impossible to discern.  The vertical lines in this Taiwanese coin provide an excellent example of this capability. (Click for full size image.)
Cognex SurfaceFX Example New Taiwan Dollar

Coins provide an excellent example of everything Cognex SurfaceFX excels at.  They are difficult to illuminate and have physical features that even with off-camera illumination are still difficult to analyze.  Below we have included the full-resolution example of a newer United States penny.

Cognex SurfaceFX Example Penny

Like the penny above, the quarter below also demonstrates SurfaceFX’s ability to extract physical features.  In this example, all the text around the edge is debossed instead of embossed like is found on many coins.
Cognex SurfaceFX Example Quarter

 

Using Cognex SurfaceFX

In our opinion, the Cognex In-Sight 7000 Gen II is one of the best cameras that Cognex has produced to date.  The on-camera illuminator is significantly better than anything that Cognex has released before.  The fact that the new illuminator with independent quadrant control allows for the SurfaceFX tool is just one more reason to strongly consider this camera series for your next project.

There are some caveats to consider with SurfaceFX.  The tool relies on illuminating the part from four different sides.  The on-camera illuminator is larger than before, but will work best on objects smaller than three to four inches (75-100 mm).  The camera also needs to be closer to the object than we are used to with Cognex’s other cameras, which can cause distortion issues.

For example, we can show you extreme detail in the back of the below penny.  To the human eye, the Abraham Lincoln statue inside the Lincoln Memorial is almost invisible, but is easily extracted with SurfaceFX.

Cognex SurfaceFX Penny Close Up

The image below of three pennies demonstrates the reduced field of view that is required to obtain the level of detail on this scale of the middle penny.  Note that in this setup, the front face of the camera/lighting is approximately two inches (50 mm) from the coin.  The image below shows the SurfaceFX effect dropping out on the neighboring pennies.  Click the image for the uncropped full-resolution version.Cognex SurfaceFX Penny FOV Preview

The image of the three pennies above demonstrates an extreme example of the reduced usable field of view.  In most applications, the FOV reduction will not be as extreme, but should be taken into account when designing a system using the new Cognex 7000 Series Gen II cameras.

If you have an application that you believe Cognex SurfaceFX would be a good solution for, feel free to contact KTM Research for more information, or to setup a demo.  KTM Research specializes in machine vision and can make sure your vision project succeed.

 

About KTM Research

KTM Research is an engineering firm that specializes in industrial machine vision systems for quality control and vision-guided robotics.  Formed in 2009, we are located in Tualatin, Oregon.  We serve industries in the fields of advanced manufacturing, consumer electronics, bio-tech, food and beverage, research, and logistics.  Our systems have been successfully used by customers across North America and Asia.

Our goal at KTM Research is to be the first call you make when faced with a vision challenge.  Our team of engineers view themselves as an extension of your organization and strive to be your trusted vision partner.  Our success is our clients’ success.  Our collaborative approach to projects with our conservative and robust design process allows KTM Research to successfully complete projects that many others cannot.

Contact KTM Research at info@ktmresearch.com for more information on our vision solutions.