View: 10570|Reply: 7

Orange Pi PC camera

[Copy link]

1

threads

2

posts

31

credits

Novice

Rank: 1

credits
31
Published in 2015-12-22 01:04:48 | Show all floors |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
Published in 2015-12-22 02:09:49 | Show all floors
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| Published in 2015-12-22 19:45:13 | Show all floors
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
Published in 2015-12-22 20:13:16 | Show all floors
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
Published in 2016-1-7 07:54:26 | Show all floors
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
Published in 2016-1-8 02:39:31 | Show all floors
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
Published in 2017-12-21 02:25:52 | Show all floors
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
Published in 2017-12-21 02:26:21 | Show all floors
What is with this money that keeps showing up?
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list