private void CreateAnalyzer() { // Create an MLFrame by using the bitmap. Bitmap originBitmap = BitmapFactory.DecodeResource(this.Resources, Resource.Drawable.skeleton_image); // Gets the targeted width / height, only portrait. int maxHeight = ((View)previewView.Parent).Height; int targetWidth = ((View)previewView.Parent).Width; // Determine how much to scale down the image float scaleFactor = Math.Max( (float)originBitmap.Width / (float)targetWidth, (float)originBitmap.Height / (float)maxHeight); Bitmap resizedBitmap = Bitmap.CreateScaledBitmap( originBitmap, (int)(originBitmap.Width / scaleFactor), (int)(originBitmap.Height / scaleFactor), true); mFrame = new MLFrame.Creator().SetBitmap(resizedBitmap).Create(); analyzer = MLSkeletonAnalyzerFactory.Instance.SkeletonAnalyzer; }
/// <summary> /// Create analyzer /// </summary> private void CreateSkeletonAnalyzer() { this.analyzer = MLSkeletonAnalyzerFactory.Instance.SkeletonAnalyzer; this.analyzer.SetTransactor(new SkeletonAnalyzerTransactor(this, this.graphicOverlay)); }