Image Classifier

9.1 What is this Program for?

This program is developed to merge information from Images with data files. It uses a set of images and group of data files and create a new image output with the synchronized information using the image creation date.


*Note: The camera clock must be on the right time set or the time offset need to be known to be added to the configuration file.

9.2 Support

This program has been developed by OceanDrivers. www.oceandrivers.com


The main developer is: Matias Bonet Fullana.


If you have any question contact info@oceandrivers.com with the subject ImageClassifier



9.3 Program usage

The software run is configured by a config file. The documentation of this config file is explained after on this document. To run the program after the config file is done you need to do this.


The console.bat does this automátically.


  • Open the windows command line: windows+R then type cmd

  • Browse to the installation folder: cd c:\path\to\the\unzip\folder\

  • Execute the program: imageclassifier.exe -h


The option -h show you the help on how to use the program. This will be the most updated usage help.


If you double click on the imageclassifier.exe it runs the program with the default config.cfg file.




*Note:The configFiles/config.cfg is the default file used to run the program. If you use this file name you just need to double click on the exe file and the program will run.



9.4 Configuration files


9.4.1 Syntax

The configuration file consists of sections:

led by a [section] header

and followed:

name: value

name=value is also accepted.

*Note: that leading whitespace is removed from values.


Lines beginning with '#' or ';' are ignored and may be used to provide comments.


9.4.2 General Configuration File

This file defines the general behaviour of the classification. Here is an example of the configuration file.


[sensor_data]

base_folder = input/test/

filenames = *.txt

type = faro ; deckman


[sail_data]

base_folder = input/test/

filename = 20160503.sail


[images_input_config]

base_folder=input/test/

limit_images = 10000 ; this is a limit to the number of images to be selected

timedelta_hours = 0

timedelta_minutes = 0

timedelta_seconds = 0


[images_output_config]

output_folder = output/test/

output_classify = None ; None will leave all in the place

output_location = PLM ; add_nearbyairport

align = bottom ; top - bottom

configfile = configFiles/imageConfig1.cfg

font_folder = fonts

font_type = Anonymous.ttf

PORT = none,none

STBD = flip,none

variables_number = 2

variable_0 = TWS,k,1,

variable_1 = RakeDeg,Rake,1,



9.4.2.1 Sensor_data

The sensor data section defines the data we want to merge with the images.

  • Base_folder: base folder where the data files are.

  • Filename: regular expression with the filenames you want to add. Direct name if you want only one file or for example *.txt files if you want to use all the set of created files.

  • Type: type of configuration file. For now there is only Faro files implemented (waiting for deckman files samples to parse).

Sail_data

The sail data define the file to be used to classify the sail type.


The file format of the .sails file is :

INITDATE#ENDDATE#DURATIONSECONDS#MAIN JIB

The date format is YYYYMMDDHHMMSS.


Here an example

20160503120115#20160503122120#1205#MNB LM1

20160503122321#20160503130019#2218#MNB LM3

20160503130043#20160503130700#377#MNB LM3

20160503130752#20160503132733#1181#MNB A11

20160503132840#20160503133658#498#MNB LB

20160503133946#20160503135635#1009#MNB LM3

20160503142329#20160503144626#1377#MNA LM1

20160503144829#20160503145840#611#MNA A15A

20160503152059#20160503154207#1268#MNA LM1


The config option is the following:

  • base_folder: base folder where the sail file is

  • filename: filename with extension where the file is.



9.4.2.2 Images_input_config

This sections defines where to get the source images from.

  • Base_folder: base folder where the images are

  • Limit_images: this is the limit for the images to be processed. It is good for testing configuration files. Default limit is 1000 images.

  • Timedelta_hours: time correction to set the images on the same clock

  • Timedelta_minutes: time correction to set the images on the same clock

  • Timedelta_seconds: time correction to set the images on the same clock


9.4.2.3 Images_output_config


  • Output_folder: root base folder for the output (default is output)

  • Output_classify: if you set up this parameter to “use_camera” will create folders for each of the images camera you have, good for in boats cameras.

  • font_folder : fonts folder, not really needed if you don’t want to change the font output type.

  • font_type : name of the font you want to use.

  • Align: this can have 2 values: top | bottom defines where the place the white image zone.

  • output_classify = use_camera: if you set this value the program automátically generate a new folder for each camera at the output destination. Usefull for images from inside the boat.

  • output_location = add_nearbyairport: if you set this value the program automátically gets the nearest airport name from the picture and get the country and city. If you already now the location you can set up the value as output_location = PALMA

  • PORT = flip,rotation: defines if the port images must be “flip | none” and rotated 90 | 180 | 270

  • STBD= flip,rotation: defines if the starboard images must be “flip | none” and rotated 90 | 180 | 270

  • Variables_number: same as column number, number of variables will be used need a definition of variable_x from 0 until variables_number-1.

  • Variable_x: where x starts in 0 until the variable_number-1. It defines de variable to be displayed. It is a set of 4 comma separate values: VariableFile, OutputName, decimals, factor

    • VariableFile: name of one column of the csv file.

    • Output Name: output name we want to see in the image

    • Decimals: number of decimal points we want to use.

    • Factor: multiplying factor in case we want to change the units of a variable for example from m/s to knots we apply a factor or 1.94384. If leave blank de default value is 1.






9.4.3 Image output configuration

This configuration file is where you define the output variables you want to merge with the images. Here there is an example of config file. This will generate a 4 columns variable list. The time and GPS position are added by default.


[image_information]

column_number = 4


[column_data_0]

title = Wind Conditions

color = 0,153,110

variables_number = 5

; VariableFile,Output Name,decimals,factor

variable_0 = TWA,TWA,1,

variable_1 = TWS,TWS,2,

variable_2 = TWD,TWD,0,

variable_3 = AWA,AWA,1,

variable_4 = AWS,AWS,2,


[column_data_1]

title = Boat conditions

color = 20,204,255

variables_number = 8

variable_0 = BSI,BSI,2,

variable_1 = BS,BS-,2,

variable_2 = Hdg,HDG,1,

variable_3 = SOG,SOG,2,

variable_4 = COG,COG,1,

variable_5 = VMG,VMG,2,

variable_6 = Heel,HEE,2,

variable_7 = RudderPot,RUP,2,


[column_data_2]

title = Gyro

color = 214,46,0

variables_number = 3

variable_0 = Gyro2_X,G2X,,

variable_1 = Gyro2_Y,G2Y,,

variable_2 = Gyro2_Z,G2Z,,



[column_data_3]

title = Octans PTVF

color = 120,153,0

variables_number = 7

variable_0 = Octans_PTVF_Pitch_Deg,Pitch_Deg,2,

variable_1 = Octans_PTVF_Roll_Deg,Roll_Deg,2,

variable_2 = Octans_PTVF_Heading_Deg,Heading_Deg,2,

variable_3 = Octans_PTVF_PitchRate_Deg,PitchRate_Deg,2,

variable_4 = Octans_PTVF_RollRate_Deg,RollRate_Deg,2,

variable_5 = Octans_PTVF_HeadingRate_Deg,HeadingRate_Deg,2,

variable_6 = Octans_PTVF_VesselSpeed_Knots,VesselSpeed_Knots,2,


9.4.3.1 image_information

column_number : define the number of columns we want to use.


9.4.3.2 Column_data_x

We need to add one of this sections for each column we want to add.

X start with 0 and increments it by 1. For example column_number 4 will need column_data_0,column_data_1,column_data_2 and column_data_3


Data for each column:


  • title: Title to be displayed Maximum size is 20 Caracters

  • Color: RGB value expresed with 3 numbers separates with , 255,0,0 is red.

  • Variables_number: same as column number, number of variables will be used need a definition of variable_x from 0 until variables_number-1.

  • Variable_x: where x starts in 0 until the variable_number-1. It defines de variable to be displayed. It is a set of 4 comma separate values: VariableFile, OutputName, decimals, factor

    • VariableFile: name of one column of the csv file.

    • Output Name: output name we want to see in the image

    • Decimals: number of decimal points we want to use.

    • Factor: multiplying factor in case we want to change the units of a variable for example from m/s to knots we apply a factor or 1.94384. If leave blank de default value is 1.