Skip to content

This project contains algorithm for optical image stabilisation or Digital Gimbal using optical flow and obtaining rotation angle using the rigid transform between two consecutive video frame. First version contains the script for a raspberry pi with a raspberry pi camera.

Notifications You must be signed in to change notification settings

Mohit505Git/Digital-Gimbal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Digital-Gimbal

This project contains algorithm for optical Image Stabilisation or Digital Gimbal using optical flow and obtaining rotation angle using the rigid transform between two consecutive video frame. First version contains the script for a raspberry pi with a raspberry pi camera.

Digital gimbal for rotation about z axis for a raspberry pi using a raspberry pi camera.

I was inspired to work on this project mainly because of the application and the need for digital image stabilisation on aerial robotics platforms. A mechanical gimbal is a very bulky and redundant solution for the above purpose. Also, mechanical gimbals are hard to mount on small platforms and consume power, this power can be otherwise used to enhance the flight time of the drone. Moreover this algorthim depend uses only optical flow thus no external IMU or gyro is required.

Prerequisites and Installing

  1. One must have a raspberry pi and a raspberry pi camera attached to it (I would recommend version 2 of the camera for best results)
  2. Also install Opencv, numpy, imutils, as essential modules for the raspberry pi camera.
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import cv2
 
# initialize the camera and grab a reference to the raw camera capture
camera = PiCamera()
rawCapture = PiRGBArray(camera)
 
# allow the camera to warmup
time.sleep(0.1)
 
# grab an image from the camera
camera.capture(rawCapture, format="bgr")
image = rawCapture.array
 
# display the image on screen and wait for a keypress
cv2.imshow("Image", image)
cv2.waitKey(0)

Important

Camera framerate parameter value depends upon the frequency of the artificial lighting, in my case it was 50hz and 49 worked fine. Check the frequency for your conutry.

camera.framerate = 49

That's all You will see the stabilised image of "Stab" window.

Have a nice day.

For more knowlegde, search the functions used in opencv docs.

Author

  • Mohit Singh

About

This project contains algorithm for optical image stabilisation or Digital Gimbal using optical flow and obtaining rotation angle using the rigid transform between two consecutive video frame. First version contains the script for a raspberry pi with a raspberry pi camera.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages