Skip to content

Commit

Permalink
Two simple fixes to We Char QR Code module:
Browse files Browse the repository at this point in the history
- decodemgr.cpp: fix messed: width <--> height
- unicomblock.cpp: fix wrong type at sizeof(...)
  • Loading branch information
ylatkin committed Mar 15, 2024
1 parent bf95e79 commit d75a1c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/wechat_qrcode/src/decodermgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int DecoderMgr::decodeImage(cv::Mat src, bool use_nn_detector, vector<string>& r
decode_hints_.setUseNNDetector(use_nn_detector);

Ref<ImgSource> source;
qbarUicomBlock_ = new UnicomBlock(width, height);
qbarUicomBlock_ = new UnicomBlock(height, width);

// Four Binarizers
int tryBinarizeTime = 4;
Expand Down Expand Up @@ -89,4 +89,4 @@ vector<Ref<Result>> DecoderMgr::Decode(Ref<BinaryBitmap> image, DecodeHints hint
return reader_->decode(image, hints);
}
} // namespace wechat_qrcode
} // namespace cv
} // namespace cv
2 changes: 1 addition & 1 deletion modules/wechat_qrcode/src/zxing/common/unicomblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void UnicomBlock::Init() {

void UnicomBlock::Reset(Ref<BitMatrix> poImage) {
m_poImage = poImage;
memset(&m_vcIndex[0], 0, m_vcIndex.size() * sizeof(short));
memset(&m_vcIndex[0], 0, m_vcIndex.size() * sizeof(m_vcIndex[0]));
m_iNowIdx = 0;
}

Expand Down

0 comments on commit d75a1c3

Please sign in to comment.