When making image processing, I used three modules OS, PIL, CV2. I encountered a bug who plagued one morning, I investigated several resource monitor ~~~, bug as follows:

1. First of all, I need to handle the target image into the format I need with PIL.
2. Get the newly generated image of the newly generated image to be used for subsequent use
3. The new image is not saved in the library, directly delete
new_url = "D:···537fd8cb01c4004d62c473661672abbc1623211844.8764274.jpeg"
old_url = "D:····537fd8cb01c4004d62c473661672abbc.jpeg"
img = cv2.VideoCapture(new_url)
width = int(img.get(cv2.CAP_PROP_FRAME_WIDTH))
img.release()
cv2.destroyAllWindows()
with open(resize_img, 'rb') as f:
……
# Related business logic omitted ...
if new_url != old_url:
if os.path.exists(new_url):
os.remove(new_url)
After the investigation, the BUG appears because the CV2 module displays the image object, I didn't turn it off, and the next side I deleted the unsturned image, the last process did not end, and the error was executed
# Close resolution
img.release()
cv2.destroyAllWindows() # Destroy the designated window
The pit of yourself is completed ...
How many milliseconds are currently in the video: Temp1 = Cap.get (cv2.cap_prop_pos_msec)
High video: temp2 = cap.get (cv2.cap_prop_frame_height)
Video width: temp3 = cap.get (cv2.cap_prop_frame_width)
Video frame rate: temp4 = cap.get (cv2.cap_prop_fps)
Video encoding method: TEMP5 = cap.get (cv2.cap_prop_fourcc)
Video total frame number: TEMP6 = Cap.get (cv2.cap_prop_frame_count)
I don't know which version begins, AS is always prompts the following errors, A simple solution: Switch toTerminal Window, direct inputgradlew -stop ,AgainbuildIt can be running normally....
It is because the other machine is running with the same user name, so can't run?...
When installing the python package with xgboost, the following error may occur: Because the terminal under Window is or the GBK encoding is displayed, the PIP source code is also modified. Open C: \ P...
Problem Description Kafka deployed in the Windows environment is hung after running for a period of time. View loglogs/server.log Discover the following errors: reason When the consumer's offset log i...
Today, the website deployed with IIS cannot be started locally. The default port of https is 443. In order to avoid the port starting with 4 on the local computer, I tried to use port 555, and the pro...
Environment: kafka_2.11-1.1.0, win7_64, java8 Phenomenon: automatically stops after 30 seconds of startup, reported [another program is using this file, the process cannot be accessed] It can be seen ...
Regarding the idea when compiling idea: Another program is using this file and the process cannot be accessed. Problem repair record First report the original text: Error:Maven Resources Compiler: Fai...
Article catalog Problem 2. Code example 3. Reason 4. Solve Problem Python Flask Logging Log Reports An error "Another program is using this file, the process cannot be accessed" 2. Code exam...
Article catalog First, error information Second, the solution First, error information FLUTTER Mixed Development Project: In the Android project, embed the flutter page, accidentally run the Flutter p...
Use Exifread to find a picture date, rename the file, and another program is using this file, the process is unacceptable. Error prompt appears: Traceback (most recent call last): File "C:...