Giter Site home page Giter Site logo

scivision / pibayer Goto Github PK

View Code? Open in Web Editor NEW
17.0 5.0 4.0 79 KB

Acquire RAW Bayer-masked images with Raspberry Pi camera (before demosaicking) in Python

License: MIT License

Python 100.00%
raspberry-pi raspberry-pi-camera python bayer-mask tiff hdf5 geoscience

pibayer's Introduction

Raspicam raw Bayer mask pixels

PyPi Download stats

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

apt install python3-numpy

python3 -m pip install -e .

Running the self-test must be done on a Raspberry Pi with camera module:

python3 -m pip install -e .[tests]

python3 -m pytest

To install advanced (HDF5, NetCDF4) image writing libraries:

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:
    apt install libatlas-dev

Examples

Setting of exposure time manually (seconds) is mandatory to avoid mistakes in experiments.

RAW live video display

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


ValueError: cannot save to a group with the scipy.io.netcdf backend

is fixed by:

apt install libnetcdf-dev

pip install netcdf4

pibayer's People

Contributors

scivision avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pibayer's Issues

Error: __init__() got an unexpected keyword argument 'output_dims'

Hello, Please your help when I tried to run "python3.6 getrawimage.py 0.01 output.tif", there is an error that I couldn't solve:


press Ctrl C to end program
camera startup gain autocal
auto AWB gains were 0.90234375 1.4453125
Traceback (most recent call last):
File "getrawimage.py", line 32, in
img = bayerseq(p.numimg, p.exposure)
File "/home/pi/Desktop/Multiespectral/raspicam-raw-bayer-master/pibayer/init.py", line 30, in bayerseq
r,c = getparams(cam)
File "/home/pi/Desktop/Multiespectral/raspicam-raw-bayer-master/pibayer/init.py", line 162, in getparams
img = grabframe(c)
File "/home/pi/Desktop/Multiespectral/raspicam-raw-bayer-master/pibayer/init.py", line 234, in grabframe
with picamera.array.PiBayerArray(cam, output_dims=2) as S:
TypeError: init() got an unexpected keyword argument 'output_dims'


Do you know what I can do to let this code runs?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.