Xml
1.xml.etree.elementtree.parse is very time-consuming.
You should avoid repeating parse the same file in your code, and put it in memory to swap time in space.
2. XML node assignment operations and copy.deepcopy are not the same
If the new node is assigned directly to a node using the equal sign, the operation on the new node also affects the original node. However, the current node is not affected if you manipulate the new nodes after Copy.deepcopy. Np.random.normal
We usually use this function of numpy to produce Gaussian random numbers, but this function is time-consuming, for the generation of a 4000*3000*3 matrix, the time will be 1s, the alternative method for the temporary unknown size-end problem
The size end refers primarily to the order in which the bytes are stored. High byte at high, low byte in position is small end, vice versa. The small end facilitates the transformation and so on, the big Terminal facilitates the judgment positive and negative. OpenCV while reading the video, with the FFmpeg, in ffmpeg video YUV converted to RGB, in addition to directly using the coefficient matrix, but also to do optimization, including the horizontal direction of the size change, in this step the size of the data storage is different, the direct impact is the color mismatch.