Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

LDA training opencv c++

I'm working with retinal images and i' have to use LDA classifier with 2 classes. I have a data Base to train my classifier. For this i had to extract feautures from each image (done) but i couldn't find the way how to trained the classifier with all images in my Data Base and i wanna ask in lda.project i could use my features extracted or no?! and could someone show me how to train LDA with my Data Base ?! DiaretDB 1 in my case ans i have her ground truth. I found this lines in tutorials but i couldn't know how to use it

LDA lda(num_components); // retain N elements (e.g. numClasses-1)
lda.compute(trainData, trainLabels); // compute eigenvectors
Mat projected = lda.project(feature_row); // project feature vecs, then compare in lda-space