27-09-21, 01:01 AM
السلام عليكم
احاول تحويل هذا الكود
وبعد التحويل اصبح الكود
ولكن يظهر هذا الخطأ
![[صورة مرفقة: 628996481.jpg]](https://www9.0zz0.com/2021/09/26/21/628996481.jpg)
الكود قبل التحويل
الكود بعد التحويل
احاول تحويل هذا الكود
وبعد التحويل اصبح الكود
ولكن يظهر هذا الخطأ
![[صورة مرفقة: 628996481.jpg]](https://www9.0zz0.com/2021/09/26/21/628996481.jpg)
الكود قبل التحويل
كود :
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))