التنبيهات التالية ظهرت :
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 864 - File: showthread.php PHP 7.4.33 (Linux)
File Line Function
/showthread.php 864 errorHandler->error



تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
مشكلة في تحويل كود من #c الي vb.net
#1
السلام عليكم
احاول تحويل هذا الكود
وبعد التحويل اصبح الكود
ولكن يظهر هذا الخطأ


الكود قبل التحويل
كود :
var output = detectionNet.Forward();

                        //Analyze the test results
                        var detectionMat = new Mat(output.Size(2), output.Size(3), MatType.CV_32F, output.Ptr(0));
                        for (int i = 0; i < detectionMat.Rows; i++)
                        {
                            float confidence = detectionMat.At<float>(i, 2);

                            if (confidence > 0.60)
                            {
                                int classid = (int)detectionMat.At<float>(i, 1);
                                //Judging the type of recognition, this application scenario only displays the recognized person, improving processing efficiency//if (classid <this.labelNames.Length && (classid == 1 || classid != 1))
                                //if (classid <this.labelNames.Length && (classid == 1))
                                if (classid < this.labelNames.Length && (classid == 1))
                                {
                                    int x1 = (int)(detectionMat.At<float>(i, 3) * frameWidth);
                                    int y1 = (int)(detectionMat.At<float>(i, 4) * frameHeight);
                                    int x2 = (int)(detectionMat.At<float>(i, 5) * frameWidth);
                                    int y2 = (int)(detectionMat.At<float>(i, 6) * frameHeight);

الكود بعد التحويل

كود :
Dim output = detectionNet.Forward()

                        'Analyze the test results
                        Dim detectionMat = New Mat(output.Size(2), output.Size(3), MatType.CV_32F, output.Ptr(0))
                        For i As Integer = 0 To detectionMat.Rows - 1
                            Dim confidence As Single = detectionMat.At(Of Single)(i, 2)

                            If confidence > 0.60 Then
                                Dim classid As Integer = CInt(Fix(detectionMat.At(Of Single)(i, 1)))
                                'Judging the type of recognition, this application scenario only displays the recognized person, improving processing efficiency//if (classid <this.labelNames.Length && (classid == 1 || classid != 1))
                                'if (classid <this.labelNames.Length && (classid == 1))
                                If classid < Me.labelNames.Length AndAlso (classid = 1) Then
                                    Dim x1 As Integer = CInt(Fix(detectionMat.At(Of Single)(i, 3) * frameWidth))
                                    Dim y1 As Integer = CInt(Fix(detectionMat.At(Of Single)(i, 4) * frameHeight))
                                    Dim x2 As Integer = CInt(Fix(detectionMat.At(Of Single)(i, 5) * frameWidth))
                                    Dim y2 As Integer = CInt(Fix(detectionMat.At(Of Single)(i, 6) * frameHeight))
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
مشكلة في تحويل كود من #c الي vb.net - بواسطة الماجيك مسعد - 27-09-21, 01:01 AM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم