beriev

  • *
  • 11
usb webcam use in CC3D,it is possible?
« on: October 05, 2016, 07:12:58 am »
hi,sorry for my english,I am using the translator.

I wanted to use a laptop webcam usb with CC3D controller for use in FPV, the webcam of this type are small and little weight ideal for use in FPV, they are not ideal in image but could serve even for projects,https://es.aliexpress.com/item/Short-design-passport-bag-holder-multifunctional-storage-bag-purse-travel-receipt-bill-bag-clutch-novelty-household/1757697506.html, some are HD, it is possible to implement the GCS, support for these cameras through any of the ports CC3D?, these webcam work like any USB 5V (Pin 1: VCC (+5 V) Pin 2: Data- , Pin 3: Data +, Pin 4GND), some even 3.3V, the connectors are 5-6 or 7 cable depending on whether the camera includes a microphone or not, the problem is that the FPV cameras are analog and these webcam are digital, I guess you have to make a conversion digital-analog through the controller itself or software, even I guess it would have to adapt the controller of the camera itself that was used by the controller, seeking information I found OpenCV that is used to aceder the webcam itself  http://acodigo.blogspot.com/2013/06/acceso-la-webcam.html, not if this is feasible for what we want to use, or have to use other methods, I am not an expert in programming, I've forgotten everything he learned in school but I would like to do it and if necessary get back to program

Mateusz

  • *
  • 808
Re: usb webcam use in CC3D,it is possible?
« Reply #1 on: October 05, 2016, 08:25:48 am »
Hi Beriev,

I wanted to use a laptop webcam usb with CC3D controller for use in FPV, the webcam of this type are small and little weight ideal for use in FPV

Laptop web-cameras as you already noticed are digital, they have horrible latency. They're usually completely useless for flying FPV, that's why most people still fly with low resolution analog cameras, that's the reason for it. You can't use HD cameras (few exceptions) for flying and web-camera not designed for that purpose will definitely have impractical latency.

it is possible to implement the GCS, support for these cameras through any of the ports CC3D?

No, CC3D is just a flight-controller, it has not enough memory to handle complex operations on video streams. The advantage of flight-controller is that it's fast and real-time.
For video processing you don't need real-time and you could use additional computer.

Like

You can then process video on NanoPi Neo with OpenCV and Python running on GNU/Linux.

beriev

  • *
  • 11
Re: usb webcam use in CC3D,it is possible?
« Reply #2 on: October 05, 2016, 02:58:07 pm »
Ok,thanks Mateusz  for clearing my doubts

Re: usb webcam use in CC3D,it is possible?
« Reply #3 on: October 13, 2016, 01:31:16 am »
Think you haven't really understood what FPV configurations really are or how they usually work. But let me clarify it for you a bit so it's less confusing for you. I remember my self when I was new in the hobby and didn't understand that so many different functions on the multicopters are totally separate systems that work independently of each other.

FPV link is such a thing, it has usually nothing to do with the flight controler board(CC3D for example). Its simply a separate camera and video transmitter on the machine. The only case they communicate in some way is if you use an OSD(On Screen Display) device on the machine, its usually a separate component that takes information from the flight controller and adds it on the screen as it pass through from the camera to the video transmitter.

Hope you understand.

There are other examples of independent separate system many people mistake for integrated with the flight controller. A brushless gimbal is usually a separate system on the machine with its own controller board that works on its own with its own gyros to feel the movements of the machine and compensate by moving the camera.

jcg1541

  • **
  • 78
    • Phones, Networks, And The Red Pill
Re: usb webcam use in CC3D,it is possible?
« Reply #4 on: February 16, 2018, 06:24:28 pm »
I have the raspberry pi zero w with camera planned to face download, in the attached picture, the pi zero sees CC3D on its USB port,
[email protected]:~$ lsusb
Bus 001 Device 002: ID 20a0:415b Clay Logic CopterControl
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[email protected]:~$
. I am also trying to get a opencv optical flow program for the pi zero to trim the helicopter in-flight to eliminate drifting.

I know a few PhD's out there that will sell their pi zero code. But, I want it for free  ;D.

Re: usb webcam use in CC3D,it is possible?
« Reply #5 on: February 16, 2018, 09:18:31 pm »
This is a subject that I am very interested in and have researched over the years with plans to eventually do something that acts like a GPS + IMU but uses vision.

The problem with simple optical flow is that looking straight down can look a lot like drifting to the left and banking left so that the downward view looks (to the right) at the same location.

You really need a full SLAM or similar algorithm (or stereo vision) so you know the bank angle and distance too.  Even if you use the CC3D attitude so you know the bank angle, you still don't know the distance, you could be 1m above the ground or 100m so you don't know how far you have to move to hover directly over the location.  That is even a problem with mono SLAM.

Here are some very interesting algorithms I ran across a couple years ago so they might not be the best.  They should give some ideas and show what is possible.
https://vision.in.tum.de/research/vslam/lsdslam
https://vision.in.tum.de/research/vslam/dso
DSO code is more accurate, but requires better camera.  LSD is less accurate, but has loop closure.

Good luck and let us know if you get something working!