Multiple Marker Detection Windows Phone 7.5

Jan 29, 2013 at 1:30 PM
Edited Jan 29, 2013 at 1:32 PM

Hi Guys,

I have multiple marker detection working on windows phone 7.5 using the projection sample as a reference. The problem i am having is if there is only one marker in view it will always default to the same image no matter what marker is being detected.

Other then that it works perfectly, can anyone give me any hints?

 

Thanks

Paul

Coordinator
Jan 29, 2013 at 2:37 PM

You need to check the Confidence property of the DetectionResult class, it'll how good the pattern detection is. See the XML comment of the property and also 3rd my reply here: http://slartoolkit.codeplex.com/discussions/243160

 

- Rene

Jan 29, 2013 at 3:07 PM

Thanks for the reply. 

I added in the confidence check and now it doesn't display the image at all however it is recognizing the marker as the SLAR marker with a confidence of over 0.5 it seems to always want to use the same image if there is only one marker in view. I think it has something to do with the list and the L marker being stored in both 0 and 1 index.

 

Where i think the problem is:

 

private void ApplyTransformations(DetectionResults detectedResults)
        {
           

            //Find L marker in results and transform object 
            var resultL = detectedResults.Where(r => r.Marker == markerL).FirstOrDefault();
            if (resultL == null)
            {
                resultL = detectedResults[0];
            }
            else if (resultL.Confidence > 0.5)
            {
                ApplyTransformation(NeedleImg, resultL.Transformation);
                this.NeedleImg.Visibility = System.Windows.Visibility.Visible;
            }
            // Find SLAR marker in results and apply transformation
            if (detectedResults.Count > 1)
            {
                var resultSlar = detectedResults.Where(r => r.Marker == markerSlar).FirstOrDefault();
                if (resultSlar == null)
                {
                    resultSlar = detectedResults[1];
                }
                else if (resultSlar.Confidence > 0.4)
                {
                    ApplyTransformation(LungsImg, resultSlar.Transformation);
                    this.LungsImg.Visibility = System.Windows.Visibility.Visible;
                }
            }

 

Thanks for the help