I am trying to get the results of the Onclassify call into a usable format. I cannot seem figure out how to return classResult.m_class into a usable format such as updating a Text object or to store it in a variable.
Can someone please advise what is a good recommended way to pass the results from classResult.m_class for multiple or single classifiers into variables which I can action on later or pass on to other functions.
private void OnClassify(ClassifyTopLevelMultiple classify, string data)
{
if (classify != null)
{
Log.Debug("WebCamRecognition", "images processed: " + classify.images_processed);
foreach (ClassifyTopLevelSingle image in classify.images)
{
Log.Debug("WebCamRecognition", "\tsource_url: " + image.source_url + ", resolved_url: " + image.resolved_url);
foreach (ClassifyPerClassifier classifier in image.classifiers) {
Log.Debug ("WebCamRecognition", "\t\tclassifier_id: " + classifier.classifier_id + ", name: " + classifier.name);
foreach (ClassResult classResult in classifier.classes) {
Log.Debug ("WebCamRecognition", "\t\t\tclass: " + classResult.m_class + ", score: " + classResult.score + ", type_hierarchy: " + classResult.type_hierarchy);
}
}
}
}
else
{
Log.Debug("WebCamRecognition", "Classification failed!");
}
}