Facilea (Visual Programming Tool For Image Processing) : CKD Corporation
Facilea (Visual Programming Tool For Image Processing) : CKD Corporation
Facilea (Visual Programming Tool For Image Processing) : CKD Corporation
Tutorial
CKD Corporation
311A-00300A/3
Contents
1. Basic procedures ......................................................................................................... 2
2. Basic information of image data ................................................................................. 3
3. Load the image ............................................................................................................. 4
4. Pre-process the image ................................................................................................. 6
4.1 Change the color image to gray image ................................................................................ 6
4.2 Binarize the image ................................................................................................................. 8
1
311A-00300A/3
1. Basic procedures
Procedure 1
Connect the blocks in the toolbox pane to the flow pane to create an image processing flow that meets
the purpose.
The blocks in the flow pane are executed in order from the top.
Image
processing
flow
Lighting
Pre-
process
Block
Output
Procedure 2
Click a block in the flow pane to make it selected and make necessary settings.
Procedure 3
Click the flow execution button on the menu bar to see the result in the detail pane.
When necessary, make changes to the settings in the detail pane, and then click the flow execution
button.
2
311A-00300A/3
Pixel
Enlarged image
A pixel contains information on brightness and color, and the numerical representation of this information
is called a pixel value.
Brightness is expressed as a pixel value from 0 to 255, and the larger the value, the brighter the color
(closer to white in the case of a gray image).
The color information is expressed with the three primary colors red, green, and blue, each of which has
brightness information (0 to 255) in the RGB model. The color of each pixel is expressed as a
combination of the RGB values (0 to 255 x 3 colors).
B
0 127 255
This is the end of the section describing the basic information of image data.
3
311A-00300A/3
Select "Image input" in the toolbox pane and drag and drop block into the
adjacent flow pane.
4
311A-00300A/3
The flow has been executed successfully if the image is displayed in the detail pane.
If block is deselected by clicking anywhere other than this block, the image is
not displayed in the detail pane.
To delete a block from the flow pane, drag and drop the block into the toolbox pane.
5
311A-00300A/3
Here is the instruction on changing the loaded color image to a gray image.
Select "Pre-process" in the toolbox pane and drag and drop block into the
adjacent flow pane.
In this state, click the flow execution button on the menu bar.
6
311A-00300A/3
The flow has been executed successfully if the gray image is displayed in the detail pane.
7
311A-00300A/3
When measuring in the main process, binarization is performed to make the measurement range stand
out.
Select "Pre-process" in the toolbox pane and drag and drop block into the
adjacent flow pane.
After adding the block, set the threshold in the block.
After setting the threshold, click the added block to make it selected.
In this state, click the flow execution button on the menu bar.
8
311A-00300A/3
The flow has been executed successfully if the binarized image is displayed in the detail pane. If the
input image is a color image, R: Red, G: Green, and B: Blue are binarized respectively.
There are various other pre-processing blocks such as color extraction and filtering.
9
311A-00300A/3
Select "Main process" in the toolbox pane and drag and drop block into the adjacent
flow pane.
In this state, click the flow execution button on the menu bar.
10
311A-00300A/3
The measured value of the area is displayed in the detail pane for the selected block.
The measured value of the area is the number of pixels that have a value other than 0.
In case of a binarized image, the number of white pixels (pixel value: 255) is the measured value of the
area.
A threshold can be set to judge whether the object is OK or NG.
11
311A-00300A/3
Select "Main process" in the toolbox pane and drag and drop block into the
adjacent flow pane.
Selecting the block makes "Measurement" selected in the detail pane. Select "Setting".
12
311A-00300A/3
After setting the setting items, click the added block to make it selected.
In this state, click the flow execution button on the menu bar.
The measured value of the distance is displayed in the detail pane for the selected block.
13
311A-00300A/3
In this section, the edge detection threshold and edge detection direction are explained using a sample
image (gray image).
Sample image
A change is made to the edge detection threshold of the sample image. The edge detection position is
shown in red. Changing the edge detection threshold from 50 to 49 has changed the edge detection
position. (When the threshold is 50: the boundary between white and gray; when the threshold is 49: the
boundary between gray and black)
To measure the edge detection distance between top and bottom, set the edge detection direction to
vertical.
To measure the edge detection distance between left and right, set the edge detection direction to
horizontal.
14
311A-00300A/3
15
311A-00300A/3
Select "Main process" in the toolbox pane and drag and drop block into the adjacent
flow pane.
In this state, click the flow execution button on the menu bar.
The measured value of the number of objects is displayed in the detail pane for the selected block.
16
311A-00300A/3
Next, put a check next to the measurement item "Area". The check allows the threshold to be entered.
If the measured value is within the range of the threshold, it is judged OK; if it is outside the range, it is
judged NG.
Based on the measured value, set the threshold to "110000 to 120000".
In this state, click the flow execution button on the menu bar.
17
311A-00300A/3
The result is displayed in the block and in the judgment result in the detail pane.
Following is the result of the inspection conducted on a different workpiece using the same flow. The
measured value is 79627; and therefore, the judgment result shows NG.
18
311A-00300A/3
Select "Output" in the toolbox pane and drag and drop block into the adjacent
flow pane.
19
311A-00300A/3
First file name + date + time is inserted in the file name, and the image is output in the bmp format (the
specified format).
20
311A-00300A/3
Specify the file name and image format (bmp, png, jpg).
21
311A-00300A/3
Select "Output" in the toolbox pane and drag and drop block into the
adjacent flow pane.
22
311A-00300A/3
After adding the items, select "ID", "Measurement item", and "Target".
For "ID", specify the ID of the main process block.
For "Measurement item", specify the measurement item to output from the main process block.
For "Target", specify "Measurement value" or "Judgment result".
Executing the flow with this setting will output the results to CSV every time it is executed.
The time data when the flow is executed is automatically output in the first column.
23
311A-00300A/3
Select "Output" in the toolbox pane and drag and drop block into the adjacent flow
pane.
24
311A-00300A/3
Executing the flow after making the above settings will output the sound that corresponds to the result.
25
311A-00300A/3
Select "Lighting" in the toolbox pane and drag and drop block into the
26
311A-00300A/3
Set the name of the device to be used and the output pin number. In this state, click the flow execution
button on the menu bar.
The lighting wait time is the time after the light is turned on until the camera takes an image.
27
311A-00300A/3
Click the server mode button on the menu bar to switch from the edit mode.
Next, drag and drop block from the toolbox pane into the adjacent flow
pane.
After adding the block, click the added block to make it selected.
28
311A-00300A/3
After making the settings, click the run server button. If the server starts, the settings are complete.
The flow settings cannot be changed while the server is running.
Start server
29
311A-00300A/3
Next, drag and drop block from the toolbox pane into the adjacent flow pane.
After adding the block, click the added block to make it selected.
30
311A-00300A/3
After making the settings, click the run server button. If the server starts, the settings are complete.
The flow settings cannot be changed while the server is running.
Start server
31