Hi
As per my understanding there might be different scenarios where you will get this kind of errors.
These are the following things which you could follow and check,
- Check whether the current directory is same as the folder where you want to “imwrite()” the png images.
- If suppose you are analysing the batch of images and rewriting the analysed image on the same image then, it might be such that “imwrite()” is not done yet before the next analysis is initiated. Do check by adding a “pause()” and give certain delay for the compiler to complete the writing operation before starting the next processing on the same image (since you are doing batch processing of images)
- Please do check if this error occurs when you are doing analysis of single image. If the error occurs when you are processing a single image, then specify the full path of the directory and name to save the image. The error might be possibly because of the directory path. Do check this link
- Specify a full path and name to save the image. Also look for "fullfile()" documentation for more details on specifying the directory folder.
