[OpenR8 solution] Image_Binarize (Image_Binarize)
  1. Image_Binarize

 

Image_binarize is used to separate the image from the foreground and background of the scene. That is, divided into the part we are interested in, (foreground), and the part that is not interested, (background), usually a threshold (threshold) as the standard of segmentation, pixels above the threshold as the foreground, otherwise the background. Fig. 1 below.

 

Fig. 1. Diagram of Image binarization..png

Fig. 1. Diagram of Image binarization.

 

 

  1. Introduction to use

 

This section describes how users can load an existing solution through R8 software to achieve image binarization.

 

Step 1. Run R8.exe. Please click on the mouse twice to open the R8. The picture is shown in Fig. 2 below.

 

Fig. 2. Run R8.exe ..png

Fig. 2. 【Run R8.exe】.

 

Step 2. Click "File" => "open" above R8. The picture is shown in Fig. 3 below.

 

Fig. 3. File Open ..png

Fig. 3. 【File】=>【Open】

 

Step 3. Select the Image_ binarize folder under Solution. Fig. 4 below.

 

Fig. 4. Solution Folder..png

Fig. 4. Solution Folder.

 

Step 4. Select and open process files. Fig. 5, Fig. 6 below. 

 

Fig. 5. Select a flow file..png

Fig. 5. Select a flow file.

 

Fig. 6. Open flow file..jpg

Fig. 6. Open flow file.

 

Step 5. Select the image you want to binarization. See Fig. 7 below.

 

Fig. 7. Select the image you want to binarization..png

Fig. 7. Select the image you want to binarization.

 

Step 6. Setting threshold Parameters. Fig. 8 below.

 

Fig. 8. Setting Binarization Thresholds..png

Fig. 8. Setting Binarization Thresholds.

 

Step 7. Run and Display results. See Fig. 9.

 

Fig. 9. Run and Display results..png

Fig. 9. Run and Display results.

 

 

  1. Introduction to process Content

 

A total of six processes for this solution. Fig. 10 below.

 

Fig. 10. The process of the solution..jpg

Fig. 10. The process of the solution.

 

The process is from up to bottom :

 

【1 Image_Open】

Open the image you want to read. See Fig. 11.

Variable name

Name

Value

Usage

imageFileName (String)

file name

sample.png

The image you want to do processing.

In addition to self-input, you can also choose from the way you select a file. See Fig. 11 below.

image (Image)

Image

 

Save the read image to the image variable.

 

Fig. 11. Select the image you want to test..png

Fig. 11. Select the image you want to test.

 

【2 Image_Show】

Displays the read-in image. 

Variable name

Name

Value

Usage

image (Image)

SampleImage

 

Select the image variable you want to display.

displayPercentage (Int)

 

 

Displays the percentage of the image. A value of 200 means 200 % (the picture is magnified one times), 50 means 50 % (the picture is halved), and so on, zoom in and out.

windowTitle (String)

windowTitle

SampleImage

The title of the window that displays the image. The window name is sampleimage.

 

 

【3 Image_Binarize】

The image is binarization.

Variable name

Name

Value

Usage

image (Image)

SampleImage

 

Images that want to be binarization.

threshold (Int)

gray value

110

Important parameters that affect the results.

In the image, it is filtered out greater than this value.

imageBinarize (Image)

Output Image

0

0

 

【4 Image_Show】

To show the images that are read in.

Variable name

Name

Value

Usage

image (Image)

Output Image

 

Select the image variable you want to display.

Displays the image after binarization.

displayPercentage  (int)

 

 

Displays the percentage of the graph. A value of 200 means 200 % (the picture is magnified one times), 50 means 50 % (the picture is halved), and so on, zoom in and out.

windowTitle (string)

windowTitle1

Output Image

The title of the window that displays the image. The window name is Output Image.

 

【5 Image_Save】

The image after the binary is stored.

Variable name

Name

Value

Usage

image (Image)

Output Image

 

The image you want to store.

imageFileName (String)

Output File Name

output.png

The value is the file name where the image is stored.

 

【6 WaitKey】

After the "Image_Show" process must be added "Waitkey" to see the image, the image stay how many microseconds of the setting.

 

Variable name

Name

Value

Usage

keyCode (Int)

keyCode

0

The output is turned off by the signal.

milliSeconds (Int)

milliSeconds

0

Set to 0 if you want the image display window to press any key to close; Set 1000 if you want the image to be turned off after 1 seconds.

1 seconds = 1000 microseconds.

 

【7 Image_DestoryAllWindows】

After "Image_Show" and "Waitkey", be sure to add "image_DestoryAllWindows".

This feature closes the window for all “Images_Show”.

 


Recommended Article

1.
OpenR8 - AI Software for Everyone (Download)