Recent

Author Topic: Rules of fast image processing  (Read 1121 times)

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 633
Re: Rules of fast image processing
« Reply #15 on: June 19, 2019, 08:30:20 pm »
Just see it as a pipeline and do it step by step. Because the output of the previous step often defines what to do next.

Start by trying to get raw bitmaps out of the camera. You can do that with an API (easiest), through the Linux driver (harder), see if you can find out how the GPU communicates with it (hard) or by looking what chips are inside the camera, who produced it and see if you can find out how it works (very hard).

The output of that step probably decides the next step to take. And during the process you learned how it works.

avra

  • Hero Member
  • *****
  • Posts: 1570
    • Additional info
Re: Rules of fast image processing
« Reply #16 on: June 19, 2019, 08:42:13 pm »
Without exploring all those libraries you can't tell what would be the best fit. One lib or a mix of libs, you will decide based on specific use case.

Since you are interested in your own image processing, Graphics32 will probably impress you the most with it's speed. For some of the examples it's hard to believe they are CPU only and no GPU.

PXL is advertised to be able to do V4L2 video/image capturing on Pi using onboard and USB cameras, and OpenGL ES rendering with and without X server, including drawing to bitmaps. You should check out if there are any lags and if not maybe do everything with it.

You might also want to take a look at Vampire Imaging lib:
http://galfar.vevb.net/imaging/doc/imaging.html
https://bitbucket.org/avra/ct4laz/downloads/pl_vampyreimaging.zip

and a very impressive CrossBot lib:
https://www.getlazarus.org/forums/viewtopic.php?f=18&t=40
https://www.getlazarus.org/forums/viewtopic.php?f=18&t=37
https://www.getlazarus.org/forums/viewtopic.php?f=18&t=35
https://www.getlazarus.org/learn/tutorials/examples/imageshop/
https://github.com/sysrpl/ImageShop
https://github.com/sysrpl/Cross.Codebot

I am sure you will find a fit.

p.s.: I don't know if all mentioned libs can run on Pi.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

PeterBalch

  • New member
  • *
  • Posts: 14
Re: Rules of fast image processing
« Reply #17 on: June 22, 2019, 04:35:39 pm »
Quote
You might also want to take a look at Vampire Imaging lib:
and a very impressive CrossBot lib:

Thanks, that all looks like good stuff.

For the moment I'll stick with OpenCV and when I want to write my own image processing code I'll mess directly with the bytes in pIplImage.ImageData.

It turns out that doing things to pIplImage.ImageData is slightly faster than to TBitmap.Rawdata as pIplImage pixels are 3 bytes wide whereas TBitmap pixels are 4 bytes wide.

However I've just hit a bug in calling cvLine. I guess I'll start a new thread.

Peter