문제

I want to use two cameras for my raspberry pi. So I want to know camera index number of each cameras. So what is the way to find the camera index no in raspbian OS?(The index numbers use to make camera object in Simple CV)

도움이 되었습니까?

해결책

From what I can tell, referencing the book Practical Computer Vision with Simple CV...

On Linux, all peripheral devices have a file created for them in the /dev directory. For cameras, the file names start with video and end with the camera ID, such as /dev/video0 and /dev/video1 . The number at the end equals the camera ID.

And as far as telling which camera number goes to which device (also from the book)...

from SimpleCV import Camera

# First attached camera
cam0 = Camera(0)

# Second attached camera
cam1 = Camera(1)

# Show a picture from the first camera
img0 = cam0.getImage()
img0.drawText("I am Camera ID 0")
img0.show()

# Show a picture from the first camera
img1 = cam1.getImage()
img1.drawText("I am Camera ID 1")
img1.show()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top