normalize(src, dst, 255, 0, NORM_MINMAX);
NORM_MINMAX: Array values are shifted or scaled to a specified range. Linear normalization is commonly used.
NORM_INF: the definition of this type has not been found. according to the corresponding item of OpenCV 1, it may be the C- norm (the maximum absolute value) of the normalized array.
NORM_L1 : L1-norm of normalized array (sum of absolute values)
NORM_L2: the (euclidean) L2- norm of the normalized array
One, Simple Code code directly, it is still relatively simple to understand, os is simple, control power is relatively small, subprocess can obtain the corresponding cmd output, which is convenient for further analysis of operation results #import os #os.system("c:\\sam.bat") import subprocess cmd = 'cmd.exe c:\\sam.bat' p = subprocess.Popen("cmd.exe /c" + "c:\\sam.bat abc", stdout=subprocess.PIPE, stderr=subprocess.STDOUT) curline = p.stdout.readline() while(curline != b''): print(curline) curline = p.stdout.readline() p.wait() print(p.returncode) attach sam.bat file: echo
1. ProblemsExecute python file, how do we get the input parameters at the terminal, we can use sys.argv, not unfamiliar before 2, code#!/usr/bin/python import sys if __name__ == '__main__': first = sys.argv[0:] print first second = sys.argv[1:] print second name = sys.argv age = sys.argv print "name is:" + name print "age is:"+ age 要记得导入sys哈 3, operation effect./test.py chenzixuan 2 ['./test.py', 'chenzixuan',
is summarized as: a group of numbers are converted into a soft normalization result with a sum of 1 and each number between 0 and 1.
on softmax function in logistic regression
is used to soften the output value and reduce the difference between the values.
is used to normalize a group of values to 0 ~ 1, and the sum is 1.
using sys.argv in pycharm is to get the parameters input by the terminal.
sys.argv is a list of data, and like the list [ 0 ], [ 1 ] respectively obtains the first and second parameters entered in the terminal
For example: Run manage.py in the terminal
-> python 3 manage.py hello
sys.argv --> manage.py
sys.argv [ 1 ]-> hello
ps: Some online said sys.argv is the path, others said it is all the data, actually run it is not ah
This article mainly introduces the usage of sys.argv parameter in python, and analyzes the function, definition and use skills of sys.argv parameter in python with examples. For friends who need it, please refer to the following:
This article gives an example of the usage of sys.argv parameter in python.I would like to share it with you for your reference.The specific analysis is as follows:
In the process of learning python, I have been unable to understand the meaning of sys.
If you want to execute N files (you don't need to run one by one), you can put the files to be executed in the same folder, and then enter the following script in one file. import os lst = os.listdir(os.getcwd()) # 获取当前目录下所有的文件名 for c in lst: if os.path.isfile(c) and c.endswith('.py') and c.find("run")== -1: #判断文
Batch processing can be used with many programming languages, which can not only supplement the effect of programming languages, but also improve the programming efficiency. Batch processing can also be used with python, and python does not criticize file suffixes. As long as the program contains correct python code, it can be interpreted and executed by Python interpreter!
Batch and python are programmed with the file name py.bat and the code is as follows:
In depth learning, in order to avoid Overfitting, we usually need to input enough data. If the data ratio is small, we can carry out geometric transformation on the original image data, change the position of image pixels and ensure that the features remain unchanged.
Rotation/reflection: randomly rotate the image by a certain angle;Changing the orientation of image content; flip: Flip the image horizontally or vertically; zoom: Enlarges or reduces the image according to a certain proportion; shift: shift the image in a certain way on the image plane;
element classification and characteristics:
1. Block level elements:
in html < div >, < p >, < h1 >, < form >, < ul > and < li > are block-level elements.Setting display:block is to display elements as block-level elements.Characteristics of block-level elements:
(1) Each block-level element starts from a new row, and the following elements also start from another row;(A block-level element has an exclusive row)
(2), element height, width, row height and top and bottom margin can be set;