using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using static SmartScanner.IDViewerDefines; using System.IO; using System.Drawing; namespace SmartScanner { class IDViewerSDK2 { [DllImport("yolov8_ov_infer.dll", EntryPoint = "CreateDetector_CPU", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr CreateDetector_CPU(); [DllImport("yolov8_ov_infer.dll", EntryPoint = "InitializeDetector_CPU", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern bool InitializeDetector_CPU(IntPtr m_yolov8, string device_char, string model_path_char); [DllImport("yolov8_ov_infer.dll", EntryPoint = "PredictDetector_CPU", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern void PredictDetector_CPU(IntPtr m_yolov8, byte[] image_batch, float[] x1_ptr, float[] y1_ptr, float[] x2_ptr, float[] y2_ptr, float[] prob_ptr, int[] class_ptr, int[] num_boxes, int buffer_size, int width, int height, int batch_size, float conf_thresh, float nms_thres, int is_Saved, int sequence); [DllImport("yolov8_ov_infer.dll", EntryPoint = "DisposeDetector_CPU", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern void DisposeDetector_CPU(IntPtr m_yolov8); [DllImport("yolov8_ov_infer.dll", EntryPoint = "ConvertSingletoThreeChannels", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern void ConvertSingletoThreeChannels(IntPtr m_yolov8, byte[] input, int width, int height, byte[] output); //OPT提供的C++SDK [DllImport("optSDK.dll", EntryPoint = "IDImage_Create", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr IDImage_Create(); [DllImport("IDViewerSDK.dll", EntryPoint = "IDImage", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern long IDImage(byte[] srcImageData, int step, int rows, int cols, int channel, IDImageType depth); [DllImport("IDViewerSDK.dll", EntryPoint = "captureImage", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern long captureImage(IntPtr image); } }