0

I have a Logitech C170 and I want to capture an image using PyQt5 that runs on Raspberry Pi 3.

I created a function that will be called to when a button is clicked,

    cmd = 'fswebcam -S 15 blood.png'
    p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
    out, err = p.communicate()

But nothing happens when I click the button so I have tried following this but I get errors on the imshow.

But when I try and directly type this into the terminal:

fswebcam -S 15 blood.png

It does capture. I have tried running other terminal commands inside PyQt5 and they worked fine, I wonder why this time, it does not.

Is there any other way to capture an image when a pushButton is clicked? or is there something I am missing?

eibersji
  • 1,218
  • 4
  • 29
  • 52
  • What is the error message? – eyllanesc Apr 14 '18 at 04:07
  • based on the question that I linked, the code there is cam = cv2.VideoCapture(1), it gives me an error of "VIDEOIO ERROR: V4L: index 1 is not correct!" so I changed it to cv2.VideoCapture(0) and proceeded to imshow and it gives me an error once again, "WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ally.Bus was not provided by any .service files" – eibersji Apr 14 '18 at 04:17

0 Answers0