1

I am interested in image processing with Pi camera.

My intentions are as follows:

  1. To fetch an image of 64 x 64 resolution at 60 fps in a buffer one by one continuously.
  2. Process each image in real time.

It would be kind if anyone guides me through this.

I have written below code so far which is still incomplete.

import time
import picamera
import picamera.array

frames = 60
use_video_port=True
splitter_port=0
resize=None

with picamera.PiCamera(sensor_mode=7, resolution = (64,64), framerate = 120) as camera:
    with picamera.array.PiRGBArray(camera) as output:
        with camera._encoders_lock:
            camera_port, output_port = camera._get_ports(use_video_port, splitter_port)
            format = camera._get_image_format(output, 'rgb')

            if use_video_port:
                encoder = camera._get_image_encoder(camera_port, output_port, 'rgb', resize)
                camera._encoders[splitter_port] = encoder

            try:
                if use_video_port:
                    encoder.start(output)
                    encoder.wait()
            """"
            Process the image in output here
            """"
            finally:
                encoder.close()
                with self._encoders_lock:
                    if use_video_port:
                        del self._encoders[splitter_port]  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.