Mil学习之 MimArith 图片逻辑运算

Posted Thomas会写字

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mil学习之 MimArith 图片逻辑运算相关的知识,希望对你有一定的参考价值。

计算两个图片的加减,最大最小、与或非等等

MimArith 模块

示例图片与操作,可以用来提取ROI

// 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;
         MIL_ID MilSystem = MIL.M_NULL;
         MIL_ID 无标题2 = MIL.M_NULL;
         MIL_ID Image = MIL.M_NULL;
         MIL_ID MimArithdestination = 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.MbufClone(无标题2, MIL.M_DEFAULT, MIL.M_DEFAULT, MIL.M_DEFAULT, MIL.M_DEFAULT, MIL.M_DEFAULT, MIL.M_DEFAULT, ref MimArithdestination);

         MIL.MbufClone(无标题2, MilSystem, MIL.M_DEFAULT, MIL.M_DEFAULT, MIL.M_DEFAULT, MIL.M_DEFAULT, MIL.M_DEFAULT, ref Image);
         MIL.MgraArcFill(MIL.M_DEFAULT, Image, 512.0, 410.0, 350.0, 350.0, 0.0, 360.0);
         MIL.MimArith(无标题2, Image, MimArithdestination, MIL.M_AND);

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

         MIL.MbufFree(Image);
         MIL.MbufFree(MimArithdestination);
         MIL.MbufFree(无标题2);
         MIL.MsysFree(MilSystem);
         MIL.MappFree(MilApplication);
         }
      }
   }

以上是关于Mil学习之 MimArith 图片逻辑运算的主要内容,如果未能解决你的问题,请参考以下文章

Mil学习之图片的ROI获取及半透膜掩膜效果着色

Mil学习之McalFixture

Mil学习之 多相机图像均一性校正

Mil学习之Mcal

Mil学习之Mim的简单操作

Mil学习之显示鼠标交互交互绘图交互Mask