Jump to content
Sign in to follow this  
tooz

[Tinker Board 2S][Tinker Board] stkcam, a simple python tool to preview/ take pics with csi camera

Recommended Posts

hello all, 

my colleague has come up with a little python library called stkcam, that can be used to either to see the live preview of the mipi csi camera, or to take a picture with the mipi csi camera 

pypi: https://pypi.org/project/stkcam/

github: https://github.com/harryliou/stkcam

so far it's supported on tinker board (r2.0) & tinker board 2s (debian 10, debian 11)

here's a little how-to:

##setting up tinker board/ tinker board 2s

use tinker-config to change the csi overlay:

sudo tinker-config
//select 5 Interfacing Options
//select F1 Camera 
//select 0 IMX219 //or 1 OV5647 for Raspberry Camera V1
//click Ok, finish, and reboot

fhrFRtZ.png

install pip3 for python3 and stkcam: 

sudo apt get update
sudo apt-get upgrade
sudo apt-get install python3-pip
pip3 install stkcam

 ##using stkcam for mipi csi camera live preview:

python3
import stkcam
from stkcam import TKCam, CamType
cam = TKCam(CamType.IMX219)
cam.preview()

ZLcCuKY.png

**if you'd like to take a photo using the library, please finish the process first -- exiting by ctrl + d twice)

##using stkcam to take a photo with mipi csi camera:

python3
import stkcam
from stkcam import TKCam, CamType
cam = TKCam(CamType.IMX219)
cam.take_image('/home/linaro/Desktop/image.jpg') # image path

 

feel free to give it a try and let us know 

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...