opencvsharp icon indicating copy to clipboard operation
opencvsharp copied to clipboard

Cv2.RandShuffle() throws System.AccessViolationException

Open yan97xh opened this issue 3 years ago • 0 comments

Summary of your issue

when i use the Cv2.RandShuffle() , it throws System.AccessViolationException . But , the other methods in Cv2 are used normally.

Environment

win 10
opencvsharp4 4.5.5.20211231 vs2015/vs2019

Example code:

                Mat src = new Mat(2, 3, MatType.CV_8UC1);
                    src.Set<byte>(0, 0, 1);
                    src.Set<byte>(0, 1, 2);
                    src.Set<byte>(0, 2, 3);
                    src.Set<byte>(1, 0, 5);
                    src.Set<byte>(1, 1, 8);
                    src.Set<byte>(1, 2, 10);
                    Cv2.RandShuffle(src, 1);

Output:

System.AccessViolationException:“尝试读取或写入受保护的内存。这通常指示其他内存已损坏。”

yan97xh avatar Apr 13 '22 07:04 yan97xh