You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
imread() didn't close the image file sometime #12342
I have a program where I read an image file (e.g. from a webcam), crop a face (if any) and save the cropped face into a new image file. The program will then delete the original image file. Here's the code:
Problem is, sometime the image is not properly closed. This cause the program to throw this error: The process cannot access the file because it is being used by another process
opencv-python version: 3.4.2.17
OS: Windows 7
Python version: 2.7.15
@karlphillip The best solution for the issue is to find commit that fixes the problem, but I'm not sure if it's possible for this particular case. Also the issue can be caused not by OpenCV itself, but antivirus software and search indexer process. I observed such issues with CI before. I think we can close the ticket till somebody reports the same problems.
Activity
alalek commentedon Aug 30, 2018
Please provide minimal and complete reproducer (eliminate CascadeClassifier and camera access at least).
akmalmzamri commentedon Aug 30, 2018
This code will occasionally reproduce the error:
tataganesh commentedon Jan 24, 2020
@akmalhakimi1991 Could you post the complete error stacktrace?
karlphillip commentedon Feb 2, 2020
I would like to investigate this.
karlphillip commentedon Feb 3, 2020
The result of my investigation is that this issue is no longer reproducible with the latest OpenCV on Windows 10:
The source codes used for testing are available here:
test_source_codes.zip
The output of
getBuildInformation()on both applications is the same:karlphillip commentedon Feb 4, 2020
@asmorkalov I believe this issue can be closed. Is there anything else you would like me to do?
asmorkalov commentedon Feb 5, 2020
@karlphillip The best solution for the issue is to find commit that fixes the problem, but I'm not sure if it's possible for this particular case. Also the issue can be caused not by OpenCV itself, but antivirus software and search indexer process. I observed such issues with CI before. I think we can close the ticket till somebody reports the same problems.