Which Pi are you using?
Pi 3B+ connected to a proper monitor. I've also got a Pi 2 connected to a 7" screen. They both have cameras attached.
You might be interested in some of these libraries:
https://github.com/graphics32/graphics32
Maybe that's a better route. I think that's what I'm asking for advice on - which route?
The message I'm getting seems to be that I have to use Bitmap.Canvas at some point because that's the native Lazarus format. But Bitmap.Canvas operations are slow.
To do stuff faster, I should either:
1. write my own code to operate on Bitmap.RawData.
2. convert the Bitmap into OpenCV pIplImage then use OpenCV to do things with the pIplImage and also write my own code to directly work with pIplImage.ImageData.
3. convert the Bitmap into graphics32 format - whatever that is - and write my own code to directly work with graphics32 raw data
But I have to choose one of them. I shouldn't mix them. I shouldn't, for instance, do some processing with OpenCV then convert to Bitmap to run my own code then go back to OpenCV to do more processing there.
Once I choose a format, I should stick to it.
I've worked in Computer Vision and AI and OpenCV seems to be the place people go to for all the old favourites.
So I think I should choose OpenCV. Is that sensible?
https://asphyre.net/products/pxl
http://packages.lazarus-ide.org/pl_OpenGLES.zip
Interesting.
They both look good for rendering and games - which may be of interest in the future. Cross-platform is nice in theory but I don't need it.
Can I mix-and-match with, say, OpenCV?
PXL has a lot of very useful non-graphics stuff. Thanks.
https://wiki.freepascal.org/BGRABitmap
Same question: Can I mix-and-match?
I feel like I have to choose a path and stick to it. Maybe I'm wrong.
And aren't Bitmaps already 4-bytes per pixel? What's the 4th byte if it's not Alpha?
Bitmap.RawImage.Description.BitsPerPixel = 32
So what does BGRABitmap do that TBitmap doesn't? It has effects that aren't available with a standard canvas. I don't see why a new data type is needed. Does the Alpha channel of TBitmap not work?
https://wiki.freepascal.org/Fast_direct_pixel_access
That's a useful summary. It would have saved me some time as I spent yesterday working it all out for myself.
I was writing code to do a 3x3 convolution using TBitmap.Rawdata with pointer arithmetic; or treating TBitmap.Rawdata as a big 'array of byte' and using indexing; or using OpenCV cvSmooth; or using cvFilter2D; or using pIplImage.ImageData.
The results aren't all in yet but so far, the good news is that they're all run at similar speed. Lazarus is a few percent slower than OpenCV. Perhaps the gcc compiler produces better code than FreePascal or perhaps my code could be tighter.
As I say, I feel like I have to choose a path and stick to it.
Peter