Method DetectRegions
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
DetectRegions(InputArray, ERFilter, ERFilter)
Extracts text regions from an image, as contours.
public static Point[][] DetectRegions(InputArray image, ERFilter erFilter1, ERFilter erFilter2)
Parameters
imageInputArraySource image where text blocks need to be extracted from. Should be CV_8UC3 (color).
erFilter1ERFilterExtremal Region Filter for the 1st stage classifier of the N&M algorithm.
erFilter2ERFilterExtremal Region Filter for the 2nd stage classifier of the N&M algorithm.
Returns
- Point[][]
The detected text region contours.
DetectRegions(InputArray, ERFilter, ERFilter, ErGroupingModes, string, float)
Extracts text regions from an image, grouped as rectangular text blocks.
public static Rect[] DetectRegions(InputArray image, ERFilter erFilter1, ERFilter erFilter2, ErGroupingModes method = ErGroupingModes.OrientationHoriz, string filename = "", float minProbability = 0.5)
Parameters
imageInputArraySource image where text blocks need to be extracted from. Should be CV_8UC3 (color).
erFilter1ERFilterExtremal Region Filter for the 1st stage classifier of the N&M algorithm.
erFilter2ERFilterExtremal Region Filter for the 2nd stage classifier of the N&M algorithm.
methodErGroupingModesGrouping method.
filenamestringThe XML or YAML file with the classifier model (e.g. trained_classifier_erGrouping.xml). Only used when the grouping method is ErGroupingModes.OrientationAny.
minProbabilityfloatThe minimum probability for accepting a group. Only used when the grouping method is ErGroupingModes.OrientationAny.
Returns
- Rect[]
Output list of rectangle blocks with text.