shimat / opencvsharp

OpenCV wrapper for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hi I have a problem Exception Info: System.AccessViolationException at OpenCvSharp.Internal.NativeMethods.core_Mat_copyTo_toMat1(IntPtr, IntPtr)

dedeemre00 opened this issue · comments

commented

Summary of your issue

Environment

Write your environment.

What did you do when you faced the problem?

Write here

Example code:

        private void ustKameraVeri()
        {

            if (plcBaglanti)
            {
                try
                {


                    int parcaNo = siemens.UstKameraParcaNo;
                    mUst[parcaNo] = new Mat();
                    try
                    {
                        kameraUst.foto.CopyTo(mUst[parcaNo]);

                    }
                    catch (Exception ex)
                    {
                        LogMessage($" üst kamera foto kopyalama{ex.Message}- {ex.StackTrace}");
                        olculemeyensayı++;
                        return;
                    }
                    sayac =siemens.toplamParca;


                    Thread thread = new Thread(() => otomatikOlcum(parcaNo));
                    thread.Start();

                    if (mUst[parcaNo] != null & mAlt[parcaNo] != null & mYan[parcaNo] != null)
                    {
                        if (!mUst[parcaNo].Empty() & !mAlt[parcaNo].Empty() & !mYan[parcaNo].Empty())
                        {
                            matUst = mUst[parcaNo];
                            matAlt = mAlt[parcaNo];
                            matYan = mYan[parcaNo];
                        }
                    }
                }
                catch (Exception ex)
                {
                    LogMessage($"Üst Kamera veri alınamadı: {ex.Message}");

                }

            }

        }

Output:

paste your output

What did you intend to be?