發表文章

精選文章

import * as fs from ' fs ' ; import * as cv from ' ../../ ' ; import { lccs , centerLetterInImage , saveConfusionMatrix } from ' ./OCRTools ' ; const trainDataPath = ' ../../data/ocr/traindata ' ; const testDataPath = ' ../../data/ocr/testdata ' ; const outPath = ' ../../data/ocr ' ; const SVMFile = ' lcletters.xml ' ; const hog = new cv . HOGDescriptor ({ winSize: new cv . Size ( 40 , 40 ), blockSize: new cv . Size ( 20 , 20 ), blockStride: new cv . Size ( 10 , 10 ), cellSize: new cv . Size ( 10 , 10 ), L2HysThreshold: 0.2 , nbins: 9 , gammaCorrection: true , signedGradient: true }); const svm = new cv . SVM ({ kernelType: cv . ml . SVM . RBF , c: 12.5 , gamma: 0.50625 }); const computeHOGDescriptorFromImage = ( img : cv . Mat , isIorJ : boolean ) => { let im = img ; if ( im . rows !== 40 || im . cols !== 40 ) {
最近的文章