mrgk21 / ROV2019

Work repo for ROV 2019
0 stars 1 forks source link

Camera and joystick via the same ethernet cable #10

Open RasikaShejul opened 5 years ago

RasikaShejul commented 5 years ago

1) IP VANDALPROOF CAMERA DS-2CD2120F-I HIKVISION datasheet: https://shopdelta.eu/ip-vandalproof-camera-ds-2cd2120f-i-onvif-1080p-2-8-mm-hikvision_l2_p8857.html 2) USB camera https://bluerobotics.com/store/sensors-sonars-cameras/cameras/cam-usb-low-light-r1/

testing these 2

mrgk21 commented 5 years ago

Work flow:

  1. See camera feed on raspi
  2. See camera feed on raspi using python
  3. Send camera stream on a web page
  4. Access camera feed via network (not localhost)
  5. Create webpage on a different port for joystick COMs
  6. Process data of joystick on raspi + live camera stream
  7. Send data to arduino + live camera stream
  8. Confirm arduino side response + live camera stream 30fps

1. & 3. & 4. Streaming cam on the browser [DONE]

Jul 20 15:02:49 raspberrypi systemd[1]: Starting LSB: Start Motion detection... Jul 20 15:02:49 raspberrypi motion[3721]: Starting motion detection daemon: motion. Jul 20 15:02:49 raspberrypi systemd[1]: Started LSB: Start Motion detection. Jul 20 15:02:50 raspberrypi motion[3733]: [0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf Jul 20 15:02:50 raspberrypi motion[3733]: [0:motion] [NTC] [ALL] motion_startup: Motion 4.0 Started Jul 20 15:02:50 raspberrypi motion[3733]: [0:motion] [NTC] [ALL] motion_startup: Logging to file (/var/log/motion/motion.log)


+ motion.conf changes:
```bash
daemon on # enable running the process in background
v4l2_palette 8 # select mjpeg encoding
tunerdevice /dev/tuner0 # Not using this feature [REMOVED]
width 1280
height 720
framerate 100 # max frames possible
netcam_keepalive on # does not refresh connection on every http request 
stream_maxrate 100 # max framerate on browser streaming
stream_localhost off # can access stream from a remote host

# changing this improved my data rate by 53% (currently 200KB/s)
threshold 920000 # threshold above which motion is detected, kept as 1280 * 720 aprox

# changin inthis improved the performance further by 150% (currently 500KB/s). I am getting a smooth 720p video with minimal stuttering but with high latency (around 750ms)
noise_level 920000 # noise is detected is 1280 * 720 pixels change... basically never
noise_tune off

lightswitch 100 # ignore 100% pixels of light intensity changes
output_pictures off # picture are not stored after motion is detected
mask_file /etc/motion/black-mask.pgm # adds a black mask to each video frame. Frame with a black mask is not processed. I added a completely black mask

Result: The camera works fine @720p with acceptable framerates (20-25ish) Edited files: motion-config-files.zip

I think that the raspi can run one more USB camera in parallel. Are there any available for testing? @vedangasDARKNINJA @RasikaShejul