Image analysis issue error in writepng

15 visualizaciones (últimos 30 días)
Puneet Paul
Puneet Paul el 24 de Ag. de 2020
Editada: Pratheek Punchathody el 3 de Sept. de 2020
Hi,
I am trying to analyse batch of images, but I am getting the error highlighted below. Each time I launch the app, it shows little mor progress than the previous run. And then suddenly the app stops, until launched again. Can someone please help. Thanks in advance
Error using pngwritec
PNG library failed: Could not open file..
Error in writepng (line 280)
pngwritec(data, map, filename, colortype, bitdepth, ...
Error in imwrite (line 559)
feval(fmt_s.write, data, map, filename, paramPairs{:});
Error in Seed_Extractor/LaunchButtonPushed (line 277)
imwrite(SeedImg,Filename3);
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 382)
Error while evaluating Button PrivateButtonPushedFcn.

Respuestas (1)

Pratheek Punchathody
Pratheek Punchathody el 3 de Sept. de 2020
Editada: Pratheek Punchathody el 3 de Sept. de 2020
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.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by