OpenCV
void1024
这个作者很懒,什么都没留下…
展开
-
学习OpenCV(0_4_trackbar)
#%%import numpy as npimport cv2 as cvdef nothing(): passimg = np.zeros((300, 512, 3), np.uint8)cv.namedWindow('image')cv.createTrackbar('R', 'image', 0, 255, nothing)cv.createTrackbar('G', 'image', 0, 255, nothing)cv.createTrackbar('B', 'i.原创 2021-04-11 21:09:13 · 128 阅读 · 0 评论 -
学习OpenCV(0_3_mouse_handling)
#%%import cv2 as cvevents = [i for i in dir(cv) if 'EVENT' in i]print(events[:5])#%% mdPart 2#%%import numpy as npimport cv2 as cvimg = np.zeros((512, 512, 3), np.uint8)# mouse callback functiondef draw_circle(event, x, y, flags, param).原创 2021-04-11 21:06:18 · 92 阅读 · 0 评论 -
学习OpenCV(0_2_drawing_functions)
#%%import numpy as npimport cv2 as cvimport matplotlib.pyplot as plt# Create a black imageimg = np.zeros((224, 224, 3), dtype=np.uint8)plt.imshow(img)plt.show()# Draw a diagonal blue line with thickness of 5 pxcv.line(img, (0,0), (223, 223),.原创 2021-04-11 21:03:58 · 90 阅读 · 0 评论 -
学习OpenCV(0_1_video_display)
import numpy as npimport cv2 as cvcap = cv.VideoCapture(0)ret = cap.set(cv.CAP_PROP_FRAME_WIDTH, 640)ret = cap.set(cv.CAP_PROP_FRAME_HEIGHT, 480)print('Width : {}'.format(cap.get(cv.CAP_PROP_FRAME_WIDTH)))print('Height : {}'.format(cap.get(cv.C.原创 2021-04-11 21:00:20 · 132 阅读 · 0 评论 -
学习OpenCV(0_0_display_image)
import cv2 as cvimport sysimport matplotlib.pyplot as plt# default color format: BGRimg = cv.imread('starry_night.jpg', )if img is None: print('Find Nothing')else: print('Successfully load Image!') print('Display original Image!').原创 2021-04-11 20:57:15 · 187 阅读 · 0 评论 -
OpenCV入门(1)---新建一个OpenCV项目
系统为Ubuntu16.04。IDE为Clion 2018.3.4。OpenCV版本为3.4.6。新建一个C++项目。修改CMakeLists.txt内容如下:cmake_minimum_required(VERSION 3.13)project(untitled3)set(CMAKE_CXX_STANDARD 14)find_package(OpenCV REQUIRED...原创 2019-08-14 18:42:38 · 1629 阅读 · 0 评论 -
OpenCV Mat创建方式
(1)使用Mat构造函数#include <iostream>#include <opencv2/opencv.hpp>using namespace std;using namespace cv;int main() { Mat mat(3, 2, CV_8UC3, Scalar(0, 0, 255)); cout << "m...原创 2019-09-10 17:10:12 · 119 阅读 · 0 评论