The following functions are often used , We can package it into a module , Use it to reduce the amount of code , Later, some common functions can also be put into this module
We can write one imutils.py file
#imutils.py import cv2 import numpy as np import matplotlib.pyplot as plt def
show(image): # display picture plt.imshow(image) plt.axis('off')# Axis is not displayed plt.show() def
imread(image): # Read picture image = cv2.imread(image) image = cv2.cvtColor(image,cv2.
COLOR_BGR2RGB) return image <> be careful :cv2.COLOR_BGR2RGB
cv2 The default is BGR order , and Matplotlib The library order is RGB, So conversion is needed

call imutils modular , Read stored in “D:/OpenCV image processing /” Picture below , In this case, Chinese can appear in the absolute path .
from imutils import * # Set working path import os # Import os modular os.chdir('D:/OpenCV image processing /')

Technology
©2019-2020 Toolsou All rights reserved,
Send love - A little romance for programmers VHDL—— Design of frequency divider Python Implementation of Hanoi Tower code It's over , Starting salary 30khtml+css+js Make a simple website home page QQ Login interface implementation Hill sorting of sorting algorithm ——c++ realization 【 Wechat applet learning 】 Netease music cloud code page implementation details Resume the 13th session python Blue Bridge Cup 2022 Solution to the 13th Blue Bridge Cup ( whole )