MCPcopy Create free account
hub / github.com/devilsen/CZXing / zxingDecode

Method zxingDecode

czxing/src/main/cpp/DecodeScheduler.cpp:187–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187std::vector<ScanResult> DecodeScheduler::zxingDecode(const cv::Mat& mat)
188{
189 LOGE("start zxing decode")
190
191 ZXing::ImageView imageView(mat.data, mat.cols, mat.rows, ZXing::ImageFormat::Lum);
192 ZXing::Result result = ZXing::ReadBarcode(imageView, m_formatHints);
193 if (result.isValid()) {
194 LOGE("zxing decode success, result data = %s", result.text().c_str())
195 std::vector<ScanResult> vector;
196
197 int zxingFormatIndex = static_cast<int>(result.format());
198 auto format = static_cast<CodeFormat>(zxingFormatIndex);
199
200 ZXing::Position position = result.position();
201 int width = abs(position.bottomRight().x - position.topLeft().x);
202 int height = abs(position.bottomRight().y - position.topLeft().y);
203 CodeRect codeRect(position.topLeft().x, position.topLeft().y, width, height);
204
205 ScanResult scanResult(format, result.text(), codeRect);
206 vector.push_back(scanResult);
207 return vector;
208 }
209 return m_defaultResult;
210}
211
212double DecodeScheduler::detectBrightness(jbyte* bytes, int width, int height)
213{

Callers

nothing calls this directly

Calls 8

ReadBarcodeFunction · 0.85
absFunction · 0.50
isValidMethod · 0.45
textMethod · 0.45
formatMethod · 0.45
bottomRightMethod · 0.45
topLeftMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected