Mil学习之 MimStatCalculate 图片信息统计

 统计图片的数据信息

MimStatCalculate 模块

// This code was generated by MIL CoPilot 10.40.881
// on Thursday, August 19, 2021
// Compiling and running generated code will require :
// MIL 10 with Service Pack 4

using System;
using System.Text;
using Matrox.MatroxImagingLibrary;

namespace MilCoPilot_Untitled
   {
   class Program
      {
      private const string IMAGE_FILE = @"C:\Users\kakie\Desktop\无标题2.bmp";

      static void Main(string[] args)
         {
         MIL_ID MilApplication = MIL.M_NULL;
         double StatMean = 0.0;
         MIL_ID MilSystem = MIL.M_NULL;
         MIL_ID 无标题2 = MIL.M_NULL;
         MIL_ID ProcessingContext = MIL.M_NULL;
         MIL_ID StatResult = MIL.M_NULL;

         MIL.MappAlloc(MIL.M_NULL, MIL.M_DEFAULT, ref MilApplication);
         MIL.MsysAlloc(MIL.M_DEFAULT, "M_SYSTEM_HOST", MIL.M_DEFAULT, MIL.M_DEFAULT, ref MilSystem);
         MIL.MbufImport(IMAGE_FILE, MIL.M_DEFAULT, MIL.M_RESTORE + MIL.M_NO_GRAB + MIL.M_NO_COMPRESS, MilSystem, ref 无标题2);

         MIL.MimAlloc(MilSystem, MIL.M_STATISTICS_CONTEXT, MIL.M_DEFAULT, ref ProcessingContext);
         MIL.MimAllocResult(MilSystem, MIL.M_DEFAULT, MIL.M_STATISTICS_RESULT, ref StatResult);
         MIL.MimControl(ProcessingContext, MIL.M_STAT_MEAN, MIL.M_ENABLE);
         MIL.MimStatCalculate(ProcessingContext, 无标题2, StatResult, MIL.M_DEFAULT);
         MIL.MimGetResult(StatResult, MIL.M_STAT_MEAN, ref StatMean);

         Console.WriteLine("Press <ENTER> to continue");
         Console.ReadKey();

         MIL.MimFree(StatResult);
         MIL.MimFree(ProcessingContext);
         MIL.MbufFree(无标题2);
         MIL.MsysFree(MilSystem);
         MIL.MappFree(MilApplication);
         }
      }
   }

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值