bool detect(InputArray img, OutputArray points) const;
string decode(InputArray img, InputArray points, OutputArray straight_qrcode = noArray()) const;
string detectAndDecode(InputArray img,
OutputArray points=noArray(),
OutputArray straight_qrcode = noArray()) const;
// + curved
bool detectMulti(InputArray img, OutputArray points) const;
bool decodeMulti(InputArray img,
InputArray points,
vector<string>& decoded_info,
OutputArrayOfArrays straight_qrcode = noArray()) const;
bool detectAndDecodeMulti(InputArray img,
vector<string>& decoded_info,
OutputArray points = noArray(),
OutputArrayOfArrays straight_qrcode = noArray()) const;
bool detect(InputArray img, OutputArray points) const;
bool decode(InputArray img,
InputArray points,
vector<string> &decoded_info,
vector<BarcodeType> &decoded_type) const;
bool detectAndDecode(InputArray img,
vector<string> &decoded_info,
vector<BarcodeType> &decoded_type,
OutputArray points = noArray()) const;
vector<string> detectAndDecode(InputArray img, OutputArrayOfArrays points = noArray());
void detectMarkers(InputArray image, OutputArrayOfArrays corners, OutputArray ids,
OutputArrayOfArrays rejectedImgPoints = noArray()) const;
void detectBoard(InputArray image,
OutputArray charucoCorners,
OutputArray charucoIds,
InputOutputArrayOfArrays markerCorners = noArray(),
InputOutputArray markerIds = noArray()) const;
void detectDiamonds(InputArray image,
OutputArrayOfArrays diamondCorners,
OutputArray diamondIds,
InputOutputArrayOfArrays markerCorners = noArray(),
InputOutputArrayOfArrays markerIds = noArray()) const;
bool findChessboardCorners(InputArray image, Size patternSize, OutputArray corners,
int flags = CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE );
struct CodeResult
{
string text; // can it by byte array?
code_type type; // bar, qr, Data Matrix, JAB, Aztec
code_subtype subtype; // combine with previous? needed?
vector<Point> location; // 4 points, should it be vector?
};
vector<CodeResult> detect(InputArray img);
vector<CodeResult> detectAndDecode(InputArray img);
void decode(InputArray img, vector<CodeResult> & results);
struct CodeResults
{
// Java-style iterator
void next();
bool isDone();
// Data
string getText();
code_type getType();
code_subtype getSubtype();
vector<Point> getLocation();
// add more fields preserving API/ABI(?) compatibility
};
struct ICodeDetector
{
CodeResults detect(InputArray img) = 0;
CodeResults detectAndDecode(InputArray img) = 0;
void decode(InputArray img, CodeResults & results) = 0;
// advanced?
void refine(InputArray img, CodeResults & results, Ptr<IRefiner> refiner);
};
struct ICodeDecoder {}; // separate interface for decoding? refining?
Inverse (looks strange?):
Ptr<BarcodeDetector> det = makeBarcodeDetector();
CodeResults res;
res.detect(det);