Pi4J / pi4j-example-components

Apache License 2.0
9 stars 6 forks source link

Pulling pixel data from Camera class #66

Closed SWSpratlin closed 1 month ago

SWSpratlin commented 1 month ago

Is there a way to access the raw pixel data from the Camera class? I know the class is just using libcamera-vid and libcaamera-still, but I'd love to be able to pull the pixel data and handle that directly. Is that way out of the scope of this library? Is there some wacky piping I can do to access that data? I don't need a live preview, just a 1D array of pixel values.

eitch commented 1 month ago

Hi @SWSpratlin that won't be possible, as, if you look at the implementation, the class only calls external commands using bash, so there is no data in Java's memory space which we could expose.

SWSpratlin commented 1 month ago

Thanks for the reply! Turns out pulling camera pixel data via Java is a bigger ask than I had initially imagined, especially after Pi moved to libcamera for their camera handling.

Is this a feature that Pi4J would be interested in pursuing?

FDelporte commented 1 month ago

@SWSpratlin Pi4J focuses on the GPIO-pins, so I don't think we should expand the functionality to the camera. But it still is a good idea for a separate project ;-)