//Parameters.h //written by scott reed, 29th December 2003. //this file contains all the changeable parameters for the Detection and CSS //model, with a short description of each one. #ifndef PARAMETERS_H #define PARAMETERS_H //in the pre-processing, the model removes single lines over a given length if they are above a certain greylevel (254). The //model assumes these are electronic noise lines. #define electronic_line_length 20 //During the initialisation phase of the program, the model assumes a given percent of the image is highlight and shadow regions. //This allows the model to become initialised. The ICE_Iterations and ICE_PixelChanges parameters are for the parameter fine-tuning phase. // The larger these numbers, the longer the program will take to run. This phase of the code is the most computer intensive phase. //ICE_PixelChanges must not be larger than the number of pixels in the image quadrant. #define percent_shadow_in_image 10.0 #define percent_highlight_in_image 5.0 #define ICE_Iterations 5 #define ICE_PixelChanges 10000 //during the iterative phase of the detection model, one of the terms considers how closely the object highlight pixels are to the //shadow regions. ShadPotSigma determines how close the object highlight pixels can be, a larger number equates to a weaker link //between the two regions. In actuality, changing this parameter will not make a lot of difference. AcceptPixelChanges states how //close the model can be to complete convergence(no pixels changing for an iteration) before the model stops. RecalcParams determines after //how many iterations the model parameters are re-calculated. #define ShadPotSigma 5.0 #define AcceptPixelChanges 100 #define RecalcParams 5 //These are probably the most powerful parameters in the model. The first 4 states the minimum and maximum size and height of object being //looked for by the model. This value is in metres. These values are used in the post-processing phase and have a big impact on the final result. //The MinShadowPotential is a relic of an old post-processing function and is not used. #define max_object_size 2.20 #define min_object_size 0.20 #define max_object_height 2.20 #define min_object_height 0.20 #define MinShadowPotential 0.5 //the next set of parameters are used within the CSS highlight and shadow extraction model. MP describes the maximum //number of points each snake may have on the extraction model. PositionPriorGrad relates to the prior which models the knowledge //that the shadow and highlight should have roughly the same across track size. The 100 is equivalent to 10^2. i.e the model would consider //a difference of 10 pixels in the height as a large discrepancy. NumPointAdditions controls how often new points are added to each of the snakes. //PointIterations describes how many iterations are carried out before new points are added. The values lambda2, lambda3, lamb4 describe //the relative importance of the three terms for the CSS model. The final term, lamdaRegIncr is used to increase the importance of a //regulating prior term as new points are added. This attempts to keep the snakes smooth in shape. #define MP 100 #define PositionPriorGrad 100.0 #define NumPointAdditions 4 #define PointIterations 5000 #define lambda2 0.60 //importance of statistical snake term #define lambda3 0.20 //importance of mean prior term #define lamb4 0.20 //importance of postion prior, #define lambdaRegIncr 0.10 //how much the regulating prior increases in importance. //before the CSS model can operate, it is necessary to produce a small mugshot of the image. The hightlight and shadow region //of the object are first detected after which the model attempts to put MugshotCutRow and MugshotCutCol pixels on either side of the //object to ensure that the object is included in the image. The value ShadowHomoThresh is used to 'find' the shadow region and initialise //the CSS model, this value should be kept high at all times (it is one of 2 mechanisms used to initialise the snake). #define MugshotCutRow 60 #define MugshotCutCol 60 #define ShadowHomoThresh 0.80 //in the CSS model, points are moved so as to find the best shadow extraction result. At the coarsest resolution, the points are //moved using a gaussian with a standard deviation of PointSigmaOriginal. Thereafter, this value is halved as the segmentation //becomes finer. #define PointSigmaOriginal 3.0 //The CSS model adds new points to the perimeter of its snakes as the extraction process proceeds. Add the point-adding stage, if 2 points //are seperated by a distance greater than MinPointsDist, then a new point is added. The other 3 distances are relics of an old model. This //current model only adds a maximum of one new point between 2 old points. #define MinPointsDist 8 #define AddPointsDist1 20 #define AddPointsDist2 10 #define AddPointsDist3 10 #endif