ConfidenceImage.cs 828 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using bbiwarg.Images;
  7. using bbiwarg.Output;
  8. using Emgu.CV;
  9. using Emgu.CV.Structure;
  10. using bbiwarg.Utility;
  11. namespace bbiwarg.Images
  12. {
  13. public class ConfidenceImage
  14. {
  15. public ImageSize Size { get; private set; }
  16. public Image<Gray, Int16> Image { get; private set; }
  17. public Image<Gray, byte> Mask { get; private set; }
  18. public ConfidenceImage(IntPtr rawConfidenceData, ImageSize size)
  19. {
  20. Size = size;
  21. Image = new Image<Gray, Int16>(Size.Width, Size.Height, size.Width * 2, rawConfidenceData);
  22. Mask = (Image.ThresholdBinary(new Gray(Parameters.ConfidenceImageMinThreshold), new Gray(1))).Convert<Gray, byte>();
  23. }
  24. }
  25. }