public static int RecognizeImg(
     out CarDataStruct answer,
     Emgu.CV.Mat img,
     string fileName)
 {
     return(CarModelRecognize.RecognizeImgCpp(
                out answer,
                img,
                fileName,
                -1));
 }
 public static int RecognizeImageByteArr(
     out CarDataStruct answer,
     byte[] buf,
     long bufLen,
     string fileName)
 {
     // Console.WriteLine("CarModelSdk_NetCore.RecognizeImageByteArrCpp()");
     return(CarModelRecognize.RecognizeImageByteArrCpp(
                out answer,
                buf,
                bufLen,
                fileName,
                -1));
 }
        public static string RecognizeFile(
            out CarDataStruct answer,
            string fileName)
        {
            var res = CarModelRecognize.RecognizeFileCpp(
                out answer,
                fileName,
                -1);

            string file_name = System.Text.Encoding.UTF8.GetString(answer.FileFullName);

            int pos = file_name.IndexOf(":");

            if (pos >= 1)
            {
                file_name = file_name.Substring(pos - 1, file_name.Length - pos + 1);
            }

            return(file_name);
        }
Пример #4
0
        public CarData(CarDataStruct answer)
        {
            var sizeName = System.Array.IndexOf(answer.Name, (byte)0);

            Name = System.Text.Encoding.UTF8.GetString(answer.Name, 0, sizeName < 0 ? 255 : sizeName);

            var sizeMark = System.Array.IndexOf(answer.Mark, (byte)0);

            Mark = System.Text.Encoding.UTF8.GetString(answer.Mark, 0, sizeMark < 0 ? 255 : sizeMark);

            var sizeModl = System.Array.IndexOf(answer.Modl, (byte)0);

            Modl = System.Text.Encoding.UTF8.GetString(answer.Modl, 0, sizeModl < 0 ? 255 : sizeModl);

            var sizeGenr = System.Array.IndexOf(answer.Genr, (byte)0);

            Genr = System.Text.Encoding.UTF8.GetString(answer.Genr, 0, sizeGenr < 0 ? 255 : sizeGenr);

            var sizeProbMarkStr = System.Array.IndexOf(answer.MarkProbStr, (byte)0);

            MarkProbStr = System.Text.Encoding.UTF8.GetString(answer.MarkProbStr, 0, sizeProbMarkStr < 0 ? 255 : sizeProbMarkStr);


            var sizeType = System.Array.IndexOf(answer.Type, (byte)0);

            Mark = System.Text.Encoding.UTF8.GetString(answer.Type, 0, sizeType < 0 ? 255 : sizeType);

            var sizeSide = System.Array.IndexOf(answer.Side, (byte)0);

            Modl = System.Text.Encoding.UTF8.GetString(answer.Side, 0, sizeSide < 0 ? 255 : sizeSide);

            var sizeProbTypeStr = System.Array.IndexOf(answer.TypeProbStr, (byte)0);

            TypeProbStr = System.Text.Encoding.UTF8.GetString(answer.TypeProbStr, 0, sizeProbTypeStr < 0 ? 255 : sizeProbTypeStr);


            var sizeFileFullName = System.Array.IndexOf(answer.FileFullName, (byte)0);

            FileFullName = System.Text.Encoding.UTF8.GetString(answer.FileFullName, 0, sizeFileFullName < 0 ? 255 : sizeFileFullName);
        }
Пример #5
0
 public static extern int RecognizeFileCpp(
     out CarDataStruct answer,
     string fileName,
     int mode);
Пример #6
0
 public unsafe static extern int RecognizeImageByteArrCpp(
     out CarDataStruct answer,
     byte[] buf,
     long bufLen,
     string fileName,
     int mode);
Пример #7
0
 public unsafe static extern int RecognizeImgCpp(
     out CarDataStruct answer,
     Emgu.CV.Mat img,
     string fileName,
     int mode);