• How to realize face recognition verification through Python


    This article mainly introduces how to realize face recognition verification through python. The example code is introduced in detail, which has certain reference learning value for everyone’s study or work. Friends in need can refer to it Code directly, this case is based on https://github.com/caibojian/face_ Login modified, recognition rate is not very good, sometimes blocked […]

  • Python opencv bilinear interpolation example


    I will not say much nonsense, directly on the code! #coding=utf-8 import cv2 import numpy as np Bilinear interpolation img = cv2.imread(‘timg.jpeg’, cv2.CV_LOAD_IMAGE_GRAYSCALE) # load the gray image cv2.imwrite(‘img.jpg’, img) h, w = img.shape[:2] # shrink to half of the original a1 = np.array([[0.5, 0, 0], [0, 0.5, 0]], np.float32) d1 = cv2.warpAffine(img, a1, (w, […]

  • Examples of image channel separation and merging in Python


    I will not say much nonsense, directly on the code! import cv2 img = cv2.imread(“1.jpg”) b. G, r = CV2. Split (IMG) ා separation function Merged = CV2. Merge ([b, G, R]) ා merge function cv2.imshow(‘image’,img) cv2.imshow(“Blue 1”, b) cv2.imshow(“Green 1”, g) cv2.imshow(“Red 1”, r) cv2.imshow(“merged 1”, merged) cv2.waitKey(0) cv2.destroyAllWindows() The above example of image […]

  • Positive and negative calculation of Gaussian projection in Python


    Using Python to achieve our colleagues C + + Gauss projection forward and backward calculation, the actual run through, available. #!/ usr/bin/python # -*- coding:utf-8 -*- import math def LatLon2XY(latitude, longitude): a = 6378137.0 # b = 6356752.3142 # c = 6399593.6258 # alpha = 1 / 298.257223563 e2 = 0.0066943799013 # epep = 0.00673949674227 […]

  • Details of Python operating MySQL database instance [installation, connection, addition, deletion, modification, query, etc.]


    This paper describes how Python operates MySQL database. For your reference, the details are as follows: 1. Installation There are many libraries to connect to MySQL database through python. Here we use the official MySQL connector / Python library. Its official website is: https://dev.mysql.com/doc/connector-python/en/ 。 Install through the PIP command: pip install mysql-connector-python The latest […]

  • Implementation of speech recognition code based on Python


    This article mainly introduces how to realize voice input recognition through python. The example code is introduced in detail, which has certain reference learning value for everyone’s study or work. Friends in need can refer to it 1、 Introduction 1. The first step is to save the recording locally 2. Call Baidu speech recognition SDK […]

  • Python implementation of image vertical projection example


    Python + opencv direct code import cv2 import numpy as np from matplotlib import pyplot as plt from PIL import Image IMG = CV2. Imread (‘0002. JPG ‘) ා read the image and replace it with an operational array GrayImage=cv2.cvtColor(img,cv2.COLOR_ Bgr2gray) ා convert BGR image to grayscale image ret,thresh1=cv2.threshold(GrayImage,130,255,cv2.THRESH_ Binary) ා binarize the image (130255) […]

  • Notes on learning Python regular expression grammar


    Regular expression describes a pattern of string matching, which can be used to check whether a string contains a seed string, replace the matched substring, or extract the substring that meets certain conditions from a string. Python has added the re module since version 1.5, which provides Perl style regular expression patterns. Re module enables […]

  • Analysis of Baidu OCR image recognition process based on Python


    This article mainly introduces the python implementation of Baidu OCR image recognition process analysis, the article through the example code introduction is very detailed, for everyone’s study or work has a certain reference learning value, need friends can refer to The code is as follows import base64 import requests class CodeDemo: def __init__(self,AK,SK,code_url,img_path): self.AK=AK self.SK=SK […]

  • Examples of IOU calculation in Python computer vision


    Where x1, Y1; X2, Y2 represent the center points of the two rectangular frames respectively def calcIOU(x1, y1, w1, h1, x2, y2, w2, h2): if((abs(x1 – x2) < ((w1 + w2)/ 2.0)) and (abs(y1-y2) < ((h1 + h2)/2.0))): left = max((x1 – (w1 / 2.0)), (x2 – (w2 / 2.0))) upper = max((y1 – (h1 […]

  • Method of IP proxy configuration for Python 3 scratch crawler framework


    What is scratch? Scrapy is an application framework for crawling website data and extracting structural data. It is famous and powerful. The so-called framework is a project template which has been integrated with various functions (high-performance, asynchronous download, queue, distribution, parsing, persistence, etc.) and has strong universality. For the learning of framework, the focus is […]

  • Solve the problem of coordinate transformation of Python GDAL projection


    To convert the xian80 geographic coordinate system to a projected coordinate system: xian1980 = “”” GEOGCS[“GCS_Xian_1980”, DATUM[“Xian_1980”, SPHEROID[“Xian_1980”,6378140.0,298.257]], PRIMEM[“Greenwich”,0.0], UNIT[“Degree”,0.0174532925199433]]””” prjreference = ‘PROJCS[“Xian_1980_3_Degree_GK_Zone_37”,GEOGCS[“GCS_Xian_1980”,DATUM[“D_Xian_1980”,SPHEROID[“Xian_1980”,6378140.0,298.257]],PRIMEM[“Greenwich”,0.0],UNIT[“Degree”,0.0174532925199433]],PROJECTION[“Gauss_Kruger”],PARAMETER[“False_Easting”,37500000.0],PARAMETER[“False_Northing”,0.0],PARAMETER[“Central_Meridian”,111.0],PARAMETER[“Scale_Factor”,1.0],PARAMETER[“Latitude_Of_Origin”,0.0],UNIT[“Meter”,1.0]]’ Error will be reported after conversion: latlong = transform.TransformPoint(x,y) File “/usr/lib/python3/dist-packages/osgeo/osr.py”, line 711, in TransformPoint return _osr.CoordinateTransformation_TransformPoint(self, *args) NotImplementedError: Wrong number or type of arguments for overloaded function ‘CoordinateTransformation_TransformPoint’. Possible C/C++ prototypes […]