Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect bitmap with IntPtr #171

Open
fgilde opened this issue Feb 20, 2021 · 0 comments
Open

Detect bitmap with IntPtr #171

fgilde opened this issue Feb 20, 2021 · 0 comments

Comments

@fgilde
Copy link

fgilde commented Feb 20, 2021

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 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant