-1

I'm attempting to capture a webimage from OPENCV v4.0 using a 240v LED lightsource to illuminate the field. As I'm based in Australia our mains power is 50hz and running Ubuntu 18.04

The logitech C270 webcam appears to be limited to 20fps and I am struggling to get a clean image as once the LED is on, horizontal banding scrolls down the image in the display window.

I have attempted to use v4l2-ctl to change the powerline frequency from 60hz to 50hz to no avail. The banding doesn't occur when the illumination source is a standard fluro light.

A sample of the image can be seen here: https://i.stack.imgur.com/HOgf0.jpg

Many thanks for any hints or tips. Very much appreciated and hope you are all safe and well during this hectic time.

From a code perspective I'm not doing anything fancy:

import numpy as np
import cv2

cap = cv2.VideoCapture(0)

cap.set(cv2.CAP_PROP_FRAME_WIDTH, 800)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 600)



while(True):
    # Capture frame-by-frame
    ret, frame = cap.read()

    # Our operations on the frame come here
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    # Display the resulting frame
    #cv2.imshow('frame',gray)
    cv2.imshow('frame',frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()

V4ltc export can be seen below: https://i.stack.imgur.com/fPmtG.jpg

Adam G
  • 1
  • 2

1 Answers1

0

Turns out that there is no solution for this as this particular webcam maxes out at 30fps due to it's age and the LED has a frequency of 50hz in Australia.

Moving to a raspberry pi camera allows the fps to be set to 50 thus solving the issue.

Adam G
  • 1
  • 2