Added error handling in latentsvmdetect sample

This commit is contained in:
Alexey Polovinkin
2010-10-16 07:10:46 +00:00
parent f678c8f07b
commit ba88b2ee54
5 changed files with 28 additions and 6 deletions

View File

@@ -22,8 +22,10 @@ CvLatentSvmDetector* cvLoadLatentSvmDetector(const char* filename)
int* kPartFilters = 0;
float* b = 0;
float scoreThreshold = 0.f;
int err_code = 0;
loadModel(filename, &filters, &kFilters, &kComponents, &kPartFilters, &b, &scoreThreshold);
err_code = loadModel(filename, &filters, &kFilters, &kComponents, &kPartFilters, &b, &scoreThreshold);
if (err_code != LATENT_SVM_OK) return 0;
detector = (CvLatentSvmDetector*)malloc(sizeof(CvLatentSvmDetector));
detector->filters = filters;