My goal is the following: I want detect and decode a QR-Code from an Input image in Unity. So far I have a implementation using zxing which works fine. However, I want to compare the detection with the opencv qr detector. Since I have worked in the past with EmguCV on a WPF project, I wanted to try it out for this problem.
My Problem is, I get the input image from my camera as Color32[]
array:
Color32[] textureData = usedCamera.GetPixels32();
According to the documentation the QRCodeDetector
class in EmguCV needs a IInputArray
interface as argument, so for example a Mat
or Point array I guess.
Question is, how can I transform the Color32[]
array in a fast way (without looping over the pixels).
I tried to start from this question here (with the c++ code written in c#, since I use EmguCV instead of OpenCV), however I don't manage to use Pointers in C#, since I get the following error:
Pointers and fixed size buffers may only be used in an unsafe context
Any help in order to make this conversion is much appreciated. The key for this is to be fast, since I do the detection frame by frame in my application (therefore tracking the qr-code).