https://github.com/scivision/pibayer
Acquire RAW Bayer-masked images with Raspberry Pi camera (before demosaicking) in Python
https://github.com/scivision/pibayer
bayer-mask geoscience hdf5 python raspberry-pi raspberry-pi-camera tiff
Last synced: 3 months ago
JSON representation
Acquire RAW Bayer-masked images with Raspberry Pi camera (before demosaicking) in Python
- Host: GitHub
- URL: https://github.com/scivision/pibayer
- Owner: scivision
- License: mit
- Archived: true
- Created: 2015-11-27T04:15:19.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2021-12-29T05:25:59.000Z (over 3 years ago)
- Last Synced: 2025-03-16T23:36:03.876Z (4 months ago)
- Topics: bayer-mask, geoscience, hdf5, python, raspberry-pi, raspberry-pi-camera, tiff
- Language: Python
- Homepage:
- Size: 77.1 KB
- Stars: 17
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Raspicam raw Bayer mask pixels
[](http://pepy.tech/project/pibayer)
Acquire RAW Bayer-masked images with Raspberry Pi camera (before demosaicking).
Writes HDF5, NetCDF or TIFF compressed image stacks.Install directly on the Raspberry Pi
```sh
apt install python3-numpypython3 -m pip install -e .
```Running the self-test must be done on a Raspberry Pi with camera module:
```sh
python3 -m pip install -e .[tests]python3 -m pytest
```To install advanced (HDF5, NetCDF4) image writing libraries:
```sh
apt install python3-netcdf4 python3-h5py
```## Tips
* Avoid MMAL errors: `raspi-config` → Advanced Options → Memory Split should be 128 MB, not 64 MB.
* Fix error "ImportError: libf77blas.so.3: cannot open shared object file: No such file or directory" by:
```sh
apt install libatlas-dev
```## Examples
Setting of exposure time manually (seconds) is mandatory to avoid mistakes in experiments.
### RAW live video display
```sh
python getrawimage.py 0.01 -a
```### Dump image stack to disk
* NetCDF: `./getrawimage.py 0.01 output.nc`
* HDF5: `./getrawimage.py 0.01 output.h5`
* TIFF: `./getrawimage.py 0.01 output.tif`## Command-Line Options
* `-a` GPU-based preview, for aiming camera (fast)
* `-p` use Matplotlib for slow, live (10 seconds per frame) display
* `-8` output 8-bit array instead of default 10-bit array## Notes
[Constraints on exposure time](http://picamera.readthedocs.io/en/latest/fov.html#camera-modes)
---
> ValueError: cannot save to a group with the scipy.io.netcdf backend
is fixed by:
```sh
apt install libnetcdf-devpip install netcdf4
```