E
E
eegmak2021-03-28 18:47:28
OpenCV
eegmak, 2021-03-28 18:47:28

How to get rid of huge opencv lag on pc without graphics card?

I connect to the ip-camera like this:

url='rtsp://192.168.1.80:8080/h264_ulaw.sdp'
cap = cv2.VideoCapture(url)

and in an endless loop
ret, frame = cap.read()
crop_frame = frame[5:220, 5:220]

I use this function for dominant color over crop_frame:
def unique_count_app(a):
    colors, count = np.unique(a.reshape(-1,a.shape[-1]), axis=0, return_counts=True)
    return colors[count.argmax()]

I set the camera resolution to 320/240, still a huge delay.
Does the numpai function really count the dominant color?
Is it possible to process not all frames in a row from the ip camera stream, but skip half and take only real-time frames?
You need at least 1 frame per second fps, how to get rid of the delay?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
U235U235, 2021-04-04
@eegmak

Is it possible to use the middle color instead of the dominant color in your problem? This would make everything much easier.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question