Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 6019|Reply: 7

Orange Pi PC camera

[Copy link]

1

Threads

2

Posts

31

Credits

Novice

Rank: 1

Credits
31
Post time 2015-12-22 01:04:48 | Show all posts |Read mode
Edited by daniferrito at 2015-12-22 01:06

I'm trying to set up the orange pi camera to use it with OpenCV, but i can't seem to be able to make it behave.

Following the steps at http://www.cnx-software.com/2015 ... -linux-with-motion/ i can get the camera to output to a web page, so i know the camera works and the Orange Pi Pc is able to read from it. However, if i try to open the camera in OpenCV, it behaves as if there was no camera at all.

The lines i use to see if the camera is there are the following (in python):

import cv2
cap = cv2.VideoCapture(0)
cap.isOpened()

And the isOpened() returns false. Trying to read from the camera just returns null (not even a black image)

What do i need to set up so OpenCV can find the camera and interact with it?

Edit: I'm using Raspbian as the image, but i can use any image that is necessary to get the camera and OpenCV to interact with each other.

8

Threads

55

Posts

252

Credits

Intermediate member

Rank: 3Rank: 3

Credits
252
Post time 2015-12-22 02:09:49 | Show all posts
I am not OpenCV user or Python programmer but this may help you find a solution:

Look at video_v4l2.py sample and check if it works the way you need.
"VideoCapture sample showcasing  some features of the Video4Linux2 backend

Sample shows how VideoCapture class can be used to control parameters
of a webcam such as focus or framerate.
Also the sample provides an example how to access raw images delivered
by the hardware to get a grayscale image in a very efficient fashion."


Be aware that not all programs that use V4l2 to grab images works with the current camera module due to incomplete v4l2 interface.
You can try a USB camera that might have a complete V4L2 interface.

Please, post your progress, seems to be an interesting subject.

1

Threads

2

Posts

31

Credits

Novice

Rank: 1

Credits
31
 Author| Post time 2015-12-22 19:45:13 | Show all posts
Edited by daniferrito at 2015-12-22 19:46

The code is for python, but i intend to do it in c++. Python is just easier to test quickly. The python implementation uses c++ on its backend, so if i can get it to work with one, the other one will work as well.

Could you link me to a page where i can find that video_v4l3.py sample? I cant find it anywhere.

I cant just get another camera. If it was just an one of, i wouldnt mind geting an usb camera that works easily, but for the project i need about 20 to 30 orange pis each with its own camera, so the price is really important.

8

Threads

55

Posts

252

Credits

Intermediate member

Rank: 3Rank: 3

Credits
252
Post time 2015-12-22 20:13:16 | Show all posts
daniferrito replied at 2015-12-22 08:45
The code is for python, but i intend to do it in c++. Python is just easier to test quickly. The pyt ...

It is in Latest OpenCV source code release.

0

Threads

1

Posts

14

Credits

Novice

Rank: 1

Credits
14
Post time 2016-1-7 07:54:26 | Show all posts
Anybody ever notice that the gc2035 image is horizotal fliped.
So items that are on the right side show up on the left side in the image.
Any easy fix?

8

Threads

55

Posts

252

Credits

Intermediate member

Rank: 3Rank: 3

Credits
252
Post time 2016-1-8 02:39:31 | Show all posts
Edited by @lex at 2016-1-8 10:05

Try editing script.bin and change:
vip_dev0_hflip: flip in horizontal direction 0:disable 1:enable

1

Threads

5

Posts

39

Credits

Novice

Rank: 1

Credits
39
Post time 2017-12-21 02:25:52 | Show all posts
I have 2 cameras and I've been finding that a cheep usb camera works better then then the ones ment for the PI's including the raspberry.
I have about 14 - 16 PI's of almost them all. other then H2 computers.

1

Threads

5

Posts

39

Credits

Novice

Rank: 1

Credits
39
Post time 2017-12-21 02:26:21 | Show all posts
What is with this money that keeps showing up?
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2020-11-29 09:20 GMT+8 , Processed in 0.029327 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list