automeris-io / WebPlotDigitizer

Computer vision assisted tool to extract numerical data from plot images.
https://automeris.io
GNU Affero General Public License v3.0
2.63k stars 363 forks source link

Working with several images w/ different scales produces calculation error #326

Closed jgfroque closed 1 month ago

jgfroque commented 4 months ago

First of all I would like to thank the author for this exceptional piece of work! I've started using this online app yesterday and when processing 3 images with diferent scales and extracting data with algorithm "X Step w/ Interpolation", the following happened:

1- Calibrated and processed 1 data line from Image 1 (Ymin = 0 ; Ymax = 6) 2- Calibrated and processed 6 data line from Image 2 (Ymin = 0 ; Ymax = 8) 3- Calibrated and processed 6 data line from Image 3 (Ymin = 0 ; Ymax = 10) 4- Got back to Image 1 and processed the remaining 5 data lines 5- Exported All data to .csv file 6- When I analysed the exported data, I've realized that the last 5 points, extracted on step 4, were out of range for Image 1 7- Got back to app and tryed different approaches, concluding that application uses the highest value of all images on Y axis to perform the interpolation or even for "Averaging Window" algorithm on those data lines 8- When equalizing all Ymax values to Image 1 (Ymax = 6), with "Tweak Calibration" window, the extracted data from Image 1 was back to its real/normal values. Dataset 1 for Image 1 allways kept the correct values. The wpd.json file shows that the last analyzed 5 data lines where referenced/saved to Image 3 but the app lists it under Image 1 Datasets (where they were actually created).

Assuming it's a bug, I hope this description can help to solve it, unless different systems produces different results. Attaching project: 133E2023_2ºC 133E2023_4ºC 133E2023_6ºC info.json wpd.json

ankitrohatgi commented 4 months ago

Thanks for reporting this! Will look into this soon and get back to you.

ankitrohatgi commented 4 months ago

Got back to app and tryed different approaches, concluding that application uses the highest value of all images on Y axis to perform the interpolation or even for "Averaging Window" algorithm on those data lines

This should not be the case - the algorithm should use the entire image or whatever region was defined using the mask. You should not have to rescale the calibration to make the algorithm work :( I'll try a few things to see if this can be reproduced.

ankitrohatgi commented 4 months ago

I was able to reproduce this issue with just 2 images and image axes! Looks like the UI holds on to a reference of the last axes added and when you go back to the first image and add a dataset it assigns the wrong axes to the dataset. A workaround would be to manually change the axes to the correct one after adding the dataset.

I am attaching the project from my own trial for my reference: bug_project.json

Thank you for sharing all the details! It would have been much harder to track this down otherwise.

ankitrohatgi commented 4 months ago

This is fixed in V5 btw: https://automeris.io/posts/

jgfroque commented 4 months ago

Thank you very much for the immediate reply.