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,
VUE+Canvas Achieve desktop Pinball brick elimination games C/C++ Memory model 2019PHP Interview questions ( Continuously updated )PHPspringboot2 Separation of front and rear platforms ,token Put in header Pit for verification Vue SpringBoot conduct Excel download element-ui Step on pit record 45 The 12-year-old programmer was turned down , Is the workplace wrong ?Python Web frame Pandas Fundamentals of statistical analysis _ data processing (DataFrame Common operations )Java Misunderstanding —— Method overloading is a manifestation of polymorphism ?