opencv에서 BP 신경 네트워크를 호출하여 이미지 분류

1551 단어 opencv
/* BP :
img0=cvLoadImage("099.pbm",0);
BPClassifier bp_cly;// .
number=bp_cly.classify(img0);*/
 
 
 
 

#include 
CvANN_MLP BP; //opencv BP
// 
BPClassifier:: BPClassifier ()
{
 
    //initial
    //sprintf(file_path , "../OCR/");
    sprintf(file_path , "C:\\Users\\y450\\Desktop\\recognize\\OCR\\");
    train_samples = 80;
    classes= 10;
    size=40;
    trainData = cvCreateMat(train_samples*classes, size*size, CV_32FC1);
    trainClasses = cvCreateMat(train_samples*classes, 10, CV_32FC1);
    neuralLayers=cvCreateMat(3,1,CV_32SC1);
    sampleWts=cvCreateMat(train_samples*classes,1,CV_32FC1);
    for (int i=0;i

좋은 웹페이지 즐겨찾기