#####-------------------------------------JAC-Script------------------------------------#####
##### Dieses Script beinhaltet alle Parameter und Funktioenen die für die captcha      #####
##### erkennung nötig sind                                                             #####
#####################################---filebase.to---#######################################
##############Set parameter

param.simplifyFaktor = 1;
param.trainOnlyUnknown=true;
param.colorType = RGB;


param.borderVarianceX=3;
param.borderVarianceY=3;
param.scanVarianceX=3;
param.scanVarianceY=3;

param.intersectionDimensionWeight=6.0;

param.scanAngleLeft=-18;
param.scanAngleRight=18;
param.scanAngleSteps=3;

param.errorAWeight=4;
param.errorBWeight=4;

param.coverageFaktorAWeight=1;
param.coverageFaktorBWeight=0.2;

param.LetterSearchLimitPerfectPercent=6;
param.quickScanReliabilityLimit=3.0;
param.quickScanValityLimit=19;
param.preScanFilter=100;
param.preScanFaktor=3;
param.preScanEmergencyFilter=80;

#param.useColorObjectDetection=false;
param.multiplePartMergeMinSize=1;
param.useObjectDetection = true;
param.objectColorContrast = 0.4;
param.objectDetectionContrast = 0.6;
param.relativecontrast=0.85;
param.usepeakgapdetection=true;
param.useaveragegapdetection=true;
param.minimumObjectArea=30;
param.splitPixelObjectsOverlap=2;
param.splitGapsOverlap=0;
param.overlayNoiseSize=3;
param.turnDB=true;
#param.backgroundSampleCleanContrast=0.01884;
param.backgroundSampleCleanContrast=0.0001;





##################Prepare captcha Funktionen
# Remove black border
captcha.prepare.crop(1,1,1,1);

# Remove problematic Green variations
captcha.prepare.cleanBackgroundByColor(3276337);
captcha.prepare.cleanBackgroundByColor(3342130);

# Remove problematic Blue variations
captcha.prepare.cleanBackgroundByColor(33023);
captcha.prepare.cleanBackgroundByColor(3158268);
captcha.prepare.cleanBackgroundByColor(3224062);
captcha.prepare.cleanBackgroundByColor(3289855);

# Convert to blackNwhite
captcha.prepare.toBlackAndWhite(0.7);


#################Letter Prepare Funktionen
letter.prepare.resizetoHeight(24);