Alturos.Yolo icon indicating copy to clipboard operation
Alturos.Yolo copied to clipboard

Detect bitmap with IntPtr

Open fgilde opened this issue 4 years ago • 0 comments

Hi,.. I use your wrapper for yolo image detection and I want to detect an bitmap with an IntPtr because conerting to byteArray has a big time issue for my app.

But I always receive null because your wrapper catches the original Exception. Maybe somebody can help me.

My code looks like this.

` public static IEnumerable<YoloItem> Detect(this YoloWrapper yolo, Bitmap img) {

        BitmapData bmpData = img.LockBits(new Rectangle(0, 0, img.Width, img.Height), ImageLockMode.ReadOnly, img.PixelFormat);   
        var size = img.Height * img.Width * 4;

        var res = yolo.Detect(bmpData.Scan0, size);

        img.UnlockBits(bmpData);

        return res;
 }

`

It would be great if somebody can help what I can do to do detection as fast as possible

fgilde avatar Feb 20 '21 12:02 fgilde