You have to check ImageMagick documentation to find the exact algorithms used but here is a rough guess:
-g ...................... convert document to grayscale before enhancing
That would be either cv::cvtColor
with BGR2GRAY
conversion or even better, load directly your image in grayscale with cv::imread(filename,CV_LOAD_IMAGE_GRAYSCALE)
-e .... enhance ......... enhance image brightness before cleaning;
choices are: none, stretch or normalize;
default=none
Since you choosed "none", that would be nothing. Otherwise, use cv::equalizeHist
(tutorial).
-f .... filtersize ...... size of filter used to clean background;
integer>0; default=15
-o .... offset .......... offset of filter in percent used to reduce noise;
integer>=0; default=5
My guess for the two latter parameters is cv::adaptiveThreshold
with -f
corresponding the the blockSize
param in OpenCV and -o
to the constant C
. The actual adaptive thresholding methode (gaussian or mean) is what you need to check in ImageMagick documentation