I'm trying to run a simple OpenCV python script that uses the samples/python2/facedetect.py example, but instead of running in a loop, I just want it to detect a face, and then write the image.
Essentially, I changed cv2.imshow to cv2.imwrite, and it worked fine on Windows.
When I try the same thing on Linux (Debian), I get Xwindows errors like:
import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9007.
from: can't read /var/mail/video
from: can't read /var/mail/common
./facedetect.py: line 7: syntax error near unexpected token `('
./facedetect.py: line 7: `def detect(img, cascade):'
I don't want any windows to be drawn, all I want is for the code to open a jpg, detect the face, and write a new jpg. Does OpenCV require X windows? I went through the code, but was unable to identify a specific line of code that needed X windows.