Hi,
I am trying to add instances to a Minos TrainingSet I created in the program. The instances are all on the same image. I created the image by copying an image of a coin for testing purposes, so all the instances are identical.
This works perfectly fine when I am using the TeachBench but not inside my program.
This is the code I use:
TrainingSet newTrainingSet = new TrainingSet();
newTrainingSet.Images.Add(TrainingImage);
newTrainingSet.CorrelationThreshold = 0.5;
newTrainingSet.ExpectationRadius = 3;
newTrainingSet.Models.Add(newTrainingSet.Images[0], "SearchTraining", RectCenter[0], TrainingWindow);
TrainingSet.ImageInstanceInfoCollection instanceInfos = new TrainingSet.ImageInstanceInfoCollection(newTrainingSet, newTrainingSet.Handle);
if (RectCenter.Count > 1)
{
for (int i = 1; i < RectCenter.Count; i ++)
{
Point2Dd tempRectCenter = new Point2Dd(RectCenter[i]);
string tempModel = newTrainingSet.Models[0].Name;
TrainingSet.InstanceInfo testInstanceInfo = instanceInfos.Add(tempModel, true, ref tempRectCenter);
}
}
RectCenter is a List with the locations of the instances.
TrainingWindow is a Rect with the size of the Training Window.
The message I get is:
It just does not make any sense to me as the instances are identical and they are not located too close to the image boundaries. There is also not problem when I’m trying it with the TeachBench.
Does anybody have an idea on what the problem is?
Thanks in advance!
alw