Use the capture method from capture_context.

Instead of the function imageproc.capture.