Image Transform 
---------------

Generates datasets (*.raw files) from annotated images. It is possible to add random affine transforms and noise to the output samples.


Use
---

image_transform.exe -c configurationFIle -i annotationFile -raw outputFile -check checkFile.xml class1 class2 class3 ...

-c configurationFile 		The configuration file which controls used tranformations and number of generated samples.
-i annotationFile 		The annotation file with positions of "object" in images.
-raw outputFile 		The name of *.raw output file. If this file is not specified each sample is stored in separate tiff file.
-check checkFile.xml 		The annotation output check file. It can be used to check if the annotation file was loaded correctly.
class1 class2 class3 ...	The names of object classes which should be taken into account.

Output files are stored in current directory.


Usage example 
---------------

image_transform.exe -i annotation.txt -c generate.ini -raw transf.raw -check check1.xml CMU_face
image_transform.exe -i annotation.txt -c no_transform.ini -raw notransf.raw CMU_face

see file ./examples/generate.bat



Annotation file format
----------------------

<image>  Images/CMU/Test_A/voyager2.jpg	    !!! There has to be a blank space before the image path.
   <object> 	
       sub_class        = CMU_face
       roi_LeftTop      = 39:132				
       roi_LeftBottom   = 39:209
       roi_RightTop     = 117:132
       roi_RightBottom  = 117:209
   </object> 
   <object> 	
       sub_class        = CMU_face
       roi_LeftTop      = 39:132				
       roi_LeftBottom   = 39:209
       roi_RightTop     = 117:132
       roi_RightBottom  = 117:209
   </object> 
</image> 
<image>  Images/CMU/Test_A/voyager2.jpg	    !!! There has to be a blank space before the image path.
   <object> 	
       sub_class        = CMU_face
       roi_LeftTop      = 39:132				
       roi_LeftBottom   = 39:209
       roi_RightTop     = 117:132
       roi_RightBottom  = 117:209
   </object> 
   <object> 	
       sub_class        = CMU_face
       roi_LeftTop      = 39:132				
       roi_LeftBottom   = 39:209
       roi_RightTop     = 117:132
       roi_RightBottom  = 117:209
   </object> 
</image> 



Configuration file format
-------------------------

<transformation_nb>	= 35       	---- The number of samples generated from each relevant object in annotation file. 
					---- The real number of samples does not need to match this number as samples 
					---- exceeding image borders due to applied transformation are not generated.

<shiftX_range>   = from -0.5 to 0.5	---- The horizontal shift range in fraction of size of annotated object.
<shiftY_range> 	 = from -0.5 to 0.5	---- The vertical shift range in fraction of size of annotated object.
<scale_range> 	 = from  1.0 to 1.0	---- The scale range.
<shearX_range> 	 = from -0.0 to 0.0	---- The shear range.
<shearY_range> 	 = from -0.0 to 0.0	---- The shear range.
<rotation_range> = from -180.0 to 180.0 ---- The rotation range in degrees.

<gaussian_noise>  = 0			---- Additive gaussian noise. The specified value is the standard deviation in intensity values.


<output_resolution> = 26 x 26		---- The size of output samples.


All transformations are generated from uniform distribution.


Example
-------

Located in subdirectory ./examples 

annotation.txt	 	---- Annotation example.
generate.ini		---- Example of configuration used to generate multiple transformed samples.
no_transform.ini	---- Example of configuration with no transformation.
generate.bat		---- Executes image_transform.



Supported image formats
-----------------------
jpg, tiff, bmp, 


Known issues
--------------
Unable to load *.jpeg, the extension has to be reduced to *.jpg

Requirements:
============
	Uses DigILib - Library for working with images used at UPGM FIT. Is included in the *.zip file.
	Available at: http://www.fit.vutbr.cz/research/groups/graph/index.php?page=digilib