This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Camera with Tinker Board
#1
Hi all,

I have been working on face detection application using OpenCV on Raspberry Pi with Raspberry Pi camera v2.1 attached to CSI port.  It works great.  The only issue is that it is slow.  OpenCV is a little too computational for Raspberry Pi.

So I decided to give Tinker Board a try.  Being more powerful than Raspberry Pi and pin-compatible with it, it was a no brainer.  Or so I thought.

It turns out that there is extremely minimal support for attaching camera on Tinker Board CSI.  I have got the OpenCV built and running, and it is very promising as far as face detection speed on downloaded photos, but unfortunately I haven't been able to figure out a way to use the camera to take pictures in Python.

All I found is the following page:
https://tinkerboarding.co.uk/wiki/index....CSI_camera

And I have tried the capture part of it and it works.  It does create 5 images from the camera.  But the images are in raw format, the lighting is horrible (I know that is the camera sensor issue, but in raspberry pi it probably gets post-processed and the images turn out to be just fine), the images are upside down, and there is no way to adjust all this.

Also I have no idea what API in python should I use in order to capture the images from the camera.  I can't make a system call to dumpsys because it is slow and kills the whole idea of using Tinker Board.  Besides it appears like dumpsys is some kind of tuning utility and hence of course can't be used for my purpose.

Has anybody ever worked with camera on Tinker Board who can help me out here?

Any help will be appreciated.

Thanks.
Reply
#2
Update: I dug out two old webcams and tried to use them with the Tinker Board, and that did not work either. All mplayer shows is a green screen for /dev/video0, and on the console it keeps on printing "select timeout".

I guess it is a wrong board for camera applications. It is a wonderful board, but it is unfortunate that there is minimal to no support for camera.
Reply
#3
Similar experience.  I have opencv applications developed on Raspberry pi 3.   Planned to run on Tinker board for its faster speed.   However, open the csi camera fails with the following message.  Failed over the time on v1.4, v1.6, and v1.9 beta with error message:


Unable to stop the stream: Device or resource busy
Cannot open the video cam
Reply
#4
CSI drivers don't seem to have appeared, but you can still use USB cameras:

e.g. using cheese or guvcview

Code:
sudo apt-get update && sudo apt get install cheese guvcview

the following gives me 4x live windows of 4 webcams simultaneously:
Code:
for i in 0 1 2 3 ; do  guvcview -d /dev/video$i -g none & done


Or python:

Code:
import cv2
cap1 = cv2.VideoCapture(0)

while True:
    _,cam1 = cap1.read()
    cv2.imshow("Cam1",cam1)

    if cv2.waitKey(1) == ord('q'):
        break
cap1.release()
cv2.destroyAllWindow
Reply
#5
(08-09-2017, 12:02 PM)Mikerr Wrote: CSI drivers don't seem to have appeared,  but you can still use USB cameras:

e.g. using cheese or guvcview

Code:
sudo apt-get update && sudo apt get install cheese guvcview

the following gives me 4x live windows of 4 webcams simultaneously:
Code:
for i in 0 1 2 3 ; do  guvcview -d /dev/video$i -g none & done


Or python:  

Code:
import cv2
cap1 = cv2.VideoCapture(0)

while True:
   _,cam1 = cap1.read()
   cv2.imshow("Cam1",cam1)

   if cv2.waitKey(1) == ord('q'):
       break
cap1.release()
cv2.destroyAllWindow

Thanks for the sharing. May I know what's the frame rate for this webcam setup? I would expect it to be slower than rpi camera module
Reply
#6
For the above I was getting > 10fps for the 4 cameras simultaneously at 640x480 - a lot depends on the usb cameras themselves and format streamed in (mpeg/mjpeg etc)

USB cams were a mix of old ones I had lying around: Logitech 9000 pro, microsoft lifecam nx6000
Reply
#7
New release of tinkerOS 2.0 now includes "proper" support for CSI attached cameras OV5647 and IMX219 (pi camera v1 and v2),
they now come up as /dev/video0 so standard linux video software should now work with them (e.g. guvcview as above)

Camera documentation:
http://dlcdnet.asus.com/pub/ASUS/mb/Linu...170821.pdf

tinkerOS 2.0:
https://tinkerboarding.co.uk/forum/thread-558.html
Reply
#8
(08-22-2017, 03:07 PM)Mikerr Wrote: New release of tinkerOS 2.0 now includes "proper" support for CSI attached cameras OV5647 and IMX219 (pi camera v1 and v2),
they now come up as /dev/video0 so standard linux video software should now work with them (e.g. guvcview as above)

Camera documentation:
http://dlcdnet.asus.com/pub/ASUS/mb/Linu...170821.pdf

tinkerOS 2.0:
https://tinkerboarding.co.uk/forum/thread-558.html
Hi,
First of all, thanks for whatever work you are putting into this.    
I was able to use v4l2src with the gstreamer pipelines shown in the document, but what about generic v4l2 controls?
For example: 
v4l2-ctl --get-fmt-video -d /dev/video0
    VIDIOC_G_FMT: failed: Bad address
v4l2-ctl --list-formats-out -d /dev/video0
    ioctl: VIDIOC_ENUM_FMT

Using custom code, it appears that most ioctl calls (VIDIOC_QUERYCTRL, VIDIOC_G_PARM, VIDIOC_G_FMT etc..) fail with "Inappropriate ioctl for device" or "Bad address".  Is there more v4l2 driver work planned for Tinkerboard?  I'd *love* to be able to upgrade from Pi to this.
Thanks,
Ed

(11-28-2017, 12:38 PM)edsut Wrote:
(08-22-2017, 03:07 PM)Mikerr Wrote: New release of tinkerOS 2.0 now includes "proper" support for CSI attached cameras OV5647 and IMX219 (pi camera v1 and v2),
they now come up as /dev/video0 so standard linux video software should now work with them (e.g. guvcview as above)

Camera documentation:
http://dlcdnet.asus.com/pub/ASUS/mb/Linu...170821.pdf

tinkerOS 2.0:
https://tinkerboarding.co.uk/forum/thread-558.html
Hi,
First of all, thanks for whatever work you are putting into this.    
I was able to use v4l2src with the gstreamer pipelines shown in the document, but what about generic v4l2 controls?
For example: 
v4l2-ctl --get-fmt-video -d /dev/video0
    VIDIOC_G_FMT: failed: Bad address
v4l2-ctl --list-formats-out -d /dev/video0
    ioctl: VIDIOC_ENUM_FMT

Using custom code, it appears that most ioctl calls (VIDIOC_QUERYCTRL, VIDIOC_G_PARM, VIDIOC_G_FMT etc..) fail with "Inappropriate ioctl for device" or "Bad address".  Is there more v4l2 driver work planned for Tinkerboard?  I'd *love* to be able to upgrade from Pi to this.
Thanks,
Ed
Note, I am running with 2.01, and using a version 2.1 Pi camera.
Reply
#9
There is newer code at
https://tinkerboarding.co.uk/wiki/index....CSI-camera
Reply
#10
Again, thanks for you work on this.

I am running Version 9 Stretch, and really wanna use the internal camera,
but my application needs v4l2 controls to work.
Is there any chance that this is in the pipeline?
I am limited to using an external (USB) camera otherwise; 
which basically means I have to fall back to a Pi3.
Would prefer to use TinkerBoard with internal camera...

If there is something I can do to help, point me there...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)