PLEASE READ:

  • this tutorial assumes that the Dragonfly Java App has been already setup following the instructions available starting from this page.
  • before proceeding please be aware that the the FOV (field of view) of the standard smartphone cameras is typically narrow and this means that the Dragonfly engine cannot detect a large amount of features in the scene. This could causes the Dragonfly engine to get lost if the device moves too fast or if the device makes pure YAW rotations.

Your smartphone or tablet can easily be used as a wireless remote camera for Dragonfly streaming a video over WiFi or LTE using a third-party application.

1 – Setup the streaming App

First of all you need to ensure that your smartphone is accessible from the machine running the Dragonfly Java App (they need to be both on the same local network).

1.1 – IP webcam – on Android

  1. Download the IP Webcam App from the Google Play store at this link.
  2. Open the App and click on VIDEO PREFERENCES and select a VIDEO RESOLUTION of 640 x 480. Set the QUALITY parameter to 70 (or a closer value)!
  3. Go back to the main settings screen and under AUDIO MODE select DISABLE.
  4. Scroll down and click ENABLE THE SERVER.
  5. The app should display the camera preview and provide you with an URL of the video feed. Take note of the IP and port assigned to your device and go to section 2.

1.2 – Live-Reporter – on iOS

  1. Download the Live-Reporter Security Camera App on the App Store at this link at this link.
  2. Open the App and Allow the permissions required.
  3. Change the default settings of the app to these settings:
    • Camera Setup 640 x 480;
    • Framerate 30fps;
    • Encode Quality Medium;
    • Key Frame 1sec.
  4. Take note of the IP (and default port – usually 554) assigned to your device starting with rtsp and go to section 2.

2 – Make the video stream available to the Dragonfly Java App

  1. If not already done please setup the Dragonfly Java App following carefully the instructions available starting from this page.
  2. Launch the Dragonfly Java App.
  3. Click on the Configuration tab:
    1. set the CAM_SOURCE parameter to the following string (where ip_of_your_device is the local IP address assigned to your smartphone provided by the 2 Apps described above):
      1. on Android:

        gstreamer:souphttpsrc is-live=true location=http://ip_of_your_device:8080/video ! decodebin ! videoconvert ! appsink sync=false
      2. on iOS:

        gstreamer:rtspsrc location=rtsp://ip_of_your_device:554 latency=0 buffer-mode=auto ! rtph264depay ! avdec_h264 ! videoconvert ! appsink sync=false
    2. set the CAM IMAGE WIDTH and HEIGHT to 640 x 480.
  4. Click on Save and Restart.

3 – Calibration of the camera

  1. Click on the Calibration tab of the Dragonfly Java App.
  2. Download the calibration pattern at this link.
  3. Open it on the screen of your PC or print it out on an A4 or Letter paper and place it on a plain table/desk or stick the calibration pattern on a cardboard cover. Do not perform the calibration with wobbly paper in your hand. Those results are unusable.
  4. Measure the distance in millimeters (NO inches no centimeters!) of the HDIST line visible inside the calibration pattern.
  5. Configure the distance just measured inside the field HDIST.
  6. Select 640 x 480 as Video Resolution of your camera from the drop down menu.
  7. Do not enable the Fisheye Lens. Leave the assisted mode enabled.
  8. Start the calibration by clicking on START.
  9. The server presents you a  pulsating color pattern overlay, surrounded by a black frame with a positioning indicator in the top-left corner.
  10. If you hold your calibration pattern plate into the camera, you should see the black dots being connected by colored lines.
  11. Your challenge is now to match the pattern displayed on the screen with your calibration pattern plate. The snapshots are made automatically.
  12. It doesn’t matter whether you move the camera over the calibration pattern or the calibration pattern in front of the camera.
  13. The server will present at least 21 poses, which all need to be matched. TIP: if it helps you to coordinate your movements, you can have the image displayed mirrored by clicking on the button Flip View.
  14. After you have finally made it, the server automatically start the computation of the calibration parameters of your camera and will be notified once this process is finished.
  15. At the end of the calibration process:
    • click on the Download button and download the JSON calibration file generated by the calibration tool.
    • place the JSON calibration file inside the config folder of the Dragonfly Java App (cd dragonfly_linux/application/data/config/).
    • set the CAM_CALIBRATION_FILE parameter under the Configuration tab to the name of the JSON calibration file placed inside the config folder.
    • Click on Save and Restart.

Your device can now be used as a remote camera for Dragonfly. All the information about the Dragonfly Java App can be found inside this page.