Things we need:
-1 Computer with Vision Builder and LabVIEW
-1 Webcam
First of all, we open Vision Builder an we make a states machine. There, we create a simple program where we read the dimensions of an usual rectangle: we adquire an image, we convert it to a greyscale image, we locate the borders of the image to get a point of reference and then, we measure the high and the length. Then, we compare them to see if the dimensions may be right. If they are right, we finish the program, else, we go to the other state, where we repeat the first pass, but turning all the ROIs 45 degrees. Then, we print the correct result on the screen.
After this first part, we have to migrate the inspection to LabVIEW, so we click on "Tools -> Migrate Inspection To LabVIEW..." and we follow the steps. This step may take a while.
After that, we will have something like this:
This program has been modified to have the measures and the surface of the piece on the screen. Moreover, it has the instructions to use the program.
If we go inside the block diagram, we will see this image. On the left, we have initialized the first variables and we hide some blocks on the front panel. then, we have the main while, where we read the values of the measure. We also have added a part to make the biggest number be always in the high and the lowest number on the width. We control from here also the surface of the object.
If in the block diagram we go inside the Inspect step, we can go here. There, we pick the values measured, unbundle them and we introduce them in a global variable.
You can download the program from here:
https://drive.google.com/folderview?id=0B20kHfrc3NnpckZUMFA4MHBoTTg&usp=sharing
No hay comentarios:
Publicar un comentario