Happy Friday everyone.
Based on my success with using a simple open source program called SSOCR to do very accurate optical character recognition of seven segment numerical digits, I thought it would be good opportunity to create my first node. The instructions for creating nodes are clear enough and I can probably get through them. My question though is if there might be an 'optimal' way to approach this. Here is what I know from the above SSOCR page:
- ssocr is available as C source code
- ssocr runs on Linux, Mac (requires a library), FreeBSD, and Windows (using Cygwin)
- ssocr runs on command line with the syntax ssocr [OPTION]... [COMMAND]... IMAGE where there are dozens of options and dozens of commands. I envision these are parameters that one could set in the node's settings.
- The image that SSOCR reads is a file (.png, .jpg, and perhaps others) on a storage location that can be accessed by the program, but when run in Node-RED, I envision the image coming via a flow as an input to the node.
Here's where I am wading into deep waters.... Can a program like the above can be run in a 'wrapper' (if that's the right term) within Node-RED and never require the user to install SSOCR?
Does anyone who has created nodes see any issues with a plan like this?
inputs to the node: image or buffer
parameters to adjust (just a few of the many)
-T, --iter-threshold use iterative thresholding method
-n, --number-pixels=# number of pixels needed to recognize a segment
-N, --min-segment=SIZE minimum width and height of a segment
-i, --ignore-pixels=# number of pixels ignored when searching digit
-M, --min-char-dims=WxH minimum width and height of a character/digit
-d, --number-digits=RNG number of digits in image (-1 for auto,
positive number, or positive range)
-r, --one-ratio=# height/width ratio to recognize a 'one'
-m, --minus-ratio=# width/height ratio to recognize a minus sign
commands to send (only a few of many)
remove_isolated --> remove isolated pixels
make_mono --> make image monochrome
grayscale --> transform image to grayscale
invert --> make inverted monochrome image
gray_stretch T1 T2 --> stretch luminance values from [T1,T2] to [0,255] (use --adjust-gray for percentages)