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.61k stars 359 forks source link

Parameters to specify in reference_project.json for a smooth run of the *.js in the Webplotdigitizer node_examples repository. #185

Open rodricfanou opened 4 years ago

rodricfanou commented 4 years ago

Hi Ankit,

I uploaded the reference_project.json and the image I used for testing the batch_process.js. test_files.zip

As you suggested, the reference_project.json contains a modified version of the output when getting the data through the web tool and thus all the calibration keys needed to serialise the image. However, while running the batch_process.js, we always bumped in this error:

[ { _dim: undefined, _dataPoints: [ [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object] ], _connections: [], _selections: [], _hasMetadata: true, _mkeys: [ 'Label' ], name: 'Default Dataset', variableNames: [ 'x', 'y' ] } ] TypeError: Cannot read property '_delX' of undefined at appendData (/.../WebPlotDigitizer/app/node-module/wpd-4.2/wpd_node.js:2844:67) at wpd.BarExtractionAlgo.run (/Users/Roderick/Desktop/Projects/WebPlotDigitizer/app/node-module/wpd-4.2/wpd_node.js:2884:21) at digitizeImage (/.../WebPlotDigitizer/node_examples/batch_process.js:40:32) at jimp.read.then.img (/.../WebPlotDigitizer/node_examples/batch_process.js:74:69) TypeError: Cannot read property '_delX' of undefined at appendData (/.../WebPlotDigitizer/app/node-module/wpd-4.2/wpd_node.js:2844:67) at wpd.BarExtractionAlgo.run (/Users/Roderick/Desktop/Projects/WebPlotDigitizer/app/node-module/wpd-4.2/wpd_node.js:2884:21) at digitizeImage (/.../WebPlotDigitizer/node_examples/batch_process.js:40:32) at jimp.read.then.img (/.../WebPlotDigitizer/node_examples/batch_process.js:74:69)

No keys of the reference_project.json is entitled/provides "dim". As a result "dim" is undefined (and it could be another parameter); I think that's one of the reasons why we encounter the error "Cannot read property '_delX' of undefined". Is there any way you can transmit us:

1- a working version of the reference_project.json for the type of mrtg graph attached? or 2- a template of a working reference_project.json for the images in the GitHub repository? or 3- a pointer to all the calibration keys the file reference_project.json may contain (their format+ definition) for the tool to function properly with nodejs?

Please do not close the ticket before we finish debugging :) Thanks in advance.

mbruyere commented 4 years ago

Hi all,

I am having the same issue.

[ { _dim: undefined, _dataPoints: [], _connections: [], _selections: [], _hasMetadata: false, _mkeys: [ 'Label' ], name: 'Default Dataset', variableNames: [ 'x', 'y' ] } ] Line 29

TypeError: Cannot read property '_delX' of undefined at appendData (/Users/Roderick/Desktop/Projects/WebPlotDigitizer/app/node-module/wpd-4.2/wpd_node.js:2844:67) at wpd.BarExtractionAlgo.run (/Users/Roderick/Desktop/Projects/WebPlotDigitizer/app/node-module/wpd-4.2/wpd_node.js:2884:21) at digitizeImage (/Users/Roderick/Desktop/Projects/WebPlotDigitizer/node_examples/batch_process.js:42:32) at jimp.read.then.img (/Users/Roderick/Desktop/Projects/WebPlotDigitizer/node_examples/batch_process.js:76:69) TypeError: Cannot read property '_delX' of undefined at appendData (/Users/Roderick/Desktop/Projects/WebPlotDigitizer/app/node-module/wpd-4.2/wpd_node.js:2844:67) at wpd.BarExtractionAlgo.run (/Users/Roderick/Desktop/Projects/WebPlotDigitizer/app/node-module/wpd-4.2/wpd_node.js:2884:21) at digitizeImage (/Users/Roderick/Desktop/Projects/WebPlotDigitizer/node_examples/batch_process.js:42:32) at jimp.read.then.img (/Users/Roderick/Desktop/Projects/WebPlotDigitizer/node_examples/batch_process.js:76:69)

This is a minimum file config serialize() { return this._wasRun ? { algoType: "AveragingWindowWithStepSizeAlgo", xmin: this._xmin, delx: this._delx, xmax: this._xmax, ymin: this._ymin, ymax: this._ymax, lineWidth: this._lineWidth } : null;

Will like to get some guidance Thx