This software uses computer vision techniques to process video sequences of a machine used to manufacture plates. It is written in Python using OpenCV to do the processing.
- Python v3+
- OpenCV v3.4.3
- Numpvy v1.15.2
- Matplotlib v2.2.2
In the command line, go to the src file of this repository, and type the following command:
python main.py path_to_video
path_to_video
is the location of the video file to process. The path can be absolute or relative. For instance, for a video which path is ./video/new_video.mp4
, the command is the following:
python main.py ./video/new_video.mp4
The program has several parameters to set. The options have default values set based on Image 1. The parameters are the following:
-
Parameters for the press:
-pxc
Horizontal position of the center of the main area of the press. Default value is188
.-phw
Half width of the main area of the press. Default value is40
.-pyc
Vertical position of the center of the main area of the press. Default value is118
.-phh
Half height of the main area of the press. Default value is24
.-pyb
Vertical position of the inner area of the press. This value is relative to the main area. Default value is8
.-pbw
Half width of the inner area of the press. Default value is17
.-pbh
Half height of the inner area of the press. Default value is12
.-ptt
Name of one of the built-in trackers in OpenCV. Default value isBOOSTING
.
-
Parameters for the shoots:
-sx1
Horizontal position of top corner of left shoot. Default value is137
.-sy1
Vertical position of top corner of left shoot. Default value is198
.-sw1
Width of left shoot. Default value is48
.-sh1
Height of left shoot. Default value is15
.-sx2
Horizontal position of top corner of right shoot. Default value is216
.-sy2
Vertical position of top corner of right shoot. Default value is198
.-sw2
Width of right shoot. Default value is42
.-sh2
Height of right shoot. Default value is15
.
-
Parameters for the bands:
-bx1
Horizontal position of upper mark in left band. Default value is200
.-by1
Vertical position of upper mark in left band. Default value is296
.-bx2
Horizontal position of upper mark in right band. Default value is249
.-by2
Vertical position of upper mark in right band. Default value is295
.-bx3
Horizontal position of lower mark in left band. Default value is245
.-by3
Vertical position of lower mark in left band. Default value is474
.-bx4
Horizontal position of lower mark in right band. Default value is344
.-by4
Vertical position of lower mark in right band. Default value is465
.-bxd
Horizontal position of upper left corner of destination box. Default value is150
.-byd
Vertical position of upper left corner of destination box. Default value is100
.-bwd
Width of destination box. Default value is30
.-bhd
Height of destination box. Default value is180
.
-
Miscelaneous:
-
-o
Name of the output video. This option allows the creation of a video with caption of the processing information, as seen in Image 2. -
-a
Flag used for analysis. Default value isFalse
. When the value isTrue
, the program displays windows with images of the processing for the press (Image 3), the shoots (Image 4 and Image 5), and the bands (Image 6). -
-from
Position to start processing the video. It has the following format HH:MM:SS. -
-to
Position to finish processing the video. It has the following format HH:MM:SS.
-
Once the processing is done, the sofware creates several files:
-
Report: It is a csv file with timestamps and values for the state of each processor. The name of the file has the following format:
`report_[Date and time]_[Simple name of video].csv`.
The content structure of the report is as follows:
timestamp plates left plates right press state press moves upper left upper right lower left lower right 00:00:00 0 0 1 0 0 0 0 0 00:00:44 37 37 1 39 0 0 0 0 -
timestamp: Time of event.
-
plates left: Number of plates that came out of left shoot.
-
plates right: Number of plates that came out of right shoot.
-
press state: State of the press. 1 is ON, 0 is OFF.
-
press moves: Number of press moves.
-
upper left: State of the first mark in left band. 0 is not reached, 1 is reached.
-
upper right: State of the first mark in right band. 0 is not reached, 1 is reached.
-
lower left: State of the second mark in left band. 0 is not reached, 1 is reached.
-
lower right: State of the second mark in right band. 0 is not reached, 1 is reached.
-
-
Plots:
-
Press moves: It is a png file showing the signal of press moves created when processing the video. The name of the file has the following format:
PressCounter_0_[Date and time]_[Simple name of video].csv
. -
Plates counting: They are png files showing the signals of plates counting created when processing the video. The names of the files has the following format:
PlatesCounter_[Shoot number]_[Date and time]_[Simple name of video].csv
. -
Alarms: It is a png file showing the signal of plates moves over the bands created when processing the video. The name of the file has the following format:
LineAlarm_3_[Date and time]_[Simple name of video].csv
.
-
-
Miscelaneous:
- Output video: Available when the option
-o
has been set.
- Output video: Available when the option