ConfidenceImage.cs 720 B

12345678910111213141516171819202122232425
  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. namespace bbiwarg.Images
  11. {
  12. public class ConfidenceImage
  13. {
  14. public Image<Gray, Int16> Image { get; private set; }
  15. public Image<Gray, byte> Mask { get; private set; }
  16. public ConfidenceImage(IntPtr rawConfidenceData, int width, int height)
  17. {
  18. Image = new Image<Gray, Int16>(width, height, width * 2, rawConfidenceData);
  19. Mask = (Image.ThresholdBinary(new Gray(Parameters.ConfidenceImageMinThreshold), new Gray(1))).Convert<Gray, byte>();
  20. }
  21. }
  22. }