So, there's this program called gocr that reads numbers and letters and it works great! But what I need it to do, is read a portion of an image, so I made my own program that extracts that portion and makes a new "image" (in the memory) out of it. Now, gocr can take an image from stdin instead of from a file (it says so in the man page), and I would like to use that option because it seems it would be a lot faster. But I don't know how to do this..
So what I need is to execute gocr from my program, pass a image from my struct to his stdin and set his argument to let him know to read it from the stdin (from terminal that argument would be gocr -i -), then read his stdout back into my program.
Oh, and... it's all running on Ubuntu, I dunno if that makes a difference..
How would I do that?