本文整理汇总了C++中BitMatrix::display方法的典型用法代码示例。如果您正苦于以下问题:C++ BitMatrix::display方法的具体用法?C++ BitMatrix::display怎么用?C++ BitMatrix::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitMatrix
的用法示例。
在下文中一共展示了BitMatrix::display方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decode
void QRcodeReader::decode() {
Binarizer binarizer(img);
img = binarizer.getBlackMatrix();
if (more) {
imshow("original", rgbImg);
imshow("test",img);
waitKey(0);
printf("**************************************************************\n");
printf("Begin detection to find the three finder pattern centers:\n");
}
Finder finder = Finder(img);
FinderResult fr = finder.find();
if (more) {
printf("\n");
printf("Three finder pattern centers:\n");
FinderPoint bL = fr.getBottomLeft();
FinderPoint tL = fr.getTopLeft();
FinderPoint tR = fr.getTopRight();
printf("bottomLeft: (%f, %f)\n", bL.getX(), bL.getY());
printf("topLeft: (%f, %f)\n", tL.getX(), tL.getY());
printf("topRight: (%f, %f)\n", tR.getX(), tR.getY());
Point2f p1 = Point2f(bL.getX(), bL.getY());
circle(rgbImg, p1, 3, Scalar(0,255,0));
Point2f p2 = Point2f(tL.getX(), tL.getY());
circle(rgbImg, p2, 3, Scalar(0,255,0));
Point2f p3 = Point2f(tR.getX(), tR.getY());
circle(rgbImg, p3, 3, Scalar(0,255,0));
imshow("original", rgbImg);
waitKey(0);
}
Detector detector = Detector(img);
DetectorResult detectorResult = detector.processFinderPatternInfo(fr);
if (more) {
vector<FinderPoint> patternPoints = detectorResult.getResultPoints();
BitMatrix bits = detectorResult.getBits();
printf("\n");
printf("Module Size: %f\n", detectorResult.getModuleSize());
printf("Dimension: %d\n", detectorResult.getDimension());
printf("Alignment Pattern : (%f, %f)\n", patternPoints[3].getX(), patternPoints[3].getY());
Point2f p4 = Point2f(patternPoints[3].getX(), patternPoints[3].getY());
circle(rgbImg, p4, 3, Scalar(0,255,0));
imshow("original", rgbImg);
waitKey(0);
printf("\n");
printf("The bit matrix:\n");
bits.display();
printf("\nDetection Done!\n");
printf("**************************************************************\n");
waitKey(0);
}
Decoder decoder = Decoder(detectorResult);
DecoderResult decoderResult = decoder.decode();
if (more) {
printf("Decode:\n");
printf("version : %d\n", decoderResult.getVersion());
printf("Error correct level : %d\n", decoderResult.getEcLevel());
vector<char> resultBytes = decoderResult.getResultBytes();
printf("Data bytes: ");
for (int i = 0; i < resultBytes.size(); ++i) {
printf("%d ",resultBytes[i]);
}
printf("\n");
string result = decoderResult.getResultText();
printf("%s\n", result.c_str());
waitKey(0);
}
else {
string result = decoderResult.getResultText();
printf("%s\n", result.c_str());
}
}