Research on the Training and Management of Industrializing Workers in Prefabricated Building with Machine Vision and Human Behaviour Modelling Based on Industry 4.0 Era
Algorithm 1
Pseudocode of facial expression data collection for industrializing worker training test.
(1)
Import the video recorded by workers during the test into the program.
(2)
if cap.grab ():
(3)
numframe + = 1
(4)
if numframe %15 = = 1: # Screenshot of dismantling the video.
(5)
flag, frame = cap.retrieve ()
(6)
end if
(7)
Save the video split images to the specified path, and the naming rule is str(numframe/15).
(8)
Import the image disassembled by video.
(9)
i = 0; m = 0; t = 0
(10)
if≤100:
(11)
i + = 1
(12)
if t ≤ 20:
(13)
t + = 1; m + = 1
(14)
Import the image numbered T for expression recognition, and input the recognition data into m rows.
(15)
end if
(16)
Arrange the positive and negative expression choice array by Eq. (3).