opencv 显示摄像头+fps #include #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <stdlib.h> #include <iostream> using namespace cv; using namespace std; void main() { Mat frame; VideoCapture capture(0); double fps; char str[5]; namedWindow("webCam"); ...
FPS = 1/ (Processing time for this frame) 由于FPS 将始终是整数,我们将 FPS 转换为整数,然后将其类型转换为字符串,因为使用cv2.putText() 在帧上显示字符串将很容易、更快捷。现在借助cv2.putText() 方法,我们将在此帧上打印 FPS,然后在cv2.imshow()function 的帮助下显示此帧。 代码:上述方法的Python...