Laex / Delphi-OpenCV-Class

Experimental Delphi binding for OpenCV 4.XX
Apache License 2.0
87 stars 26 forks source link

imdecode missing #20

Closed shineworld closed 1 year ago

shineworld commented 2 years ago

Hi Laex, Usually, with OpenCV, I use Python but primary I'm a Delphi programmer. I'm testing Delphi-OpenCV-Class with an IP camera that returns MJPEG (JPEG) frames. I can't use VideoCapture because the camera uses a proprietary UDP flow to return frames. In Delphi-OpenCV-Class I was not able to find the cv::imdecode implementation to convert JPEG flow of bytes to TMat object,

Can you add it so I can continue to debug the library? Unfortunately, my skills on so complex porting are not enough to try to modify the library by myself :(

Thank you for your support.

shineworld commented 2 years ago

I've tried to change the library to support imdecode, at least one of 2 ways. Seems to work but I'm not sure it is well done because I don't know enough about your library.

https://github.com/shineworld/Delphi-OpenCV-Class/commit/5b446f14c1b2ab8c5083db516c134470c33a4172

Image (JPEG) received from UDP with the proprietary protocol are read, translated to TMat monodimensional array, decoded from JPEG to a tree-dimensional array, and showed native (left) and after some filters (right).

image

Laex commented 1 year ago

Thanks