From d7410500e002d64856e7423ea66cd0016fffe975 Mon Sep 17 00:00:00 2001 From: Lluis Gomez-Bigorda Date: Tue, 9 Jun 2015 16:24:36 +0200 Subject: [PATCH] Fix for Bug #3633: do away with "quads [2][3] = 255;" The four lowest bits in each quads[i][j] correspond to the 2x2 binary patterns Q_1, Q_2, Q_3 in the NM paper [1] (see in page 4 at the end of first column). Q_1 and Q_2 have four patterns, while Q_3 has only two. --- modules/text/src/erfilter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/text/src/erfilter.cpp b/modules/text/src/erfilter.cpp index 3d5388f80..b5f58b76c 100644 --- a/modules/text/src/erfilter.cpp +++ b/modules/text/src/erfilter.cpp @@ -287,7 +287,11 @@ void ERFilterNM::er_tree_extract( InputArray image ) quads[1][3] = (1<<3)|(1<<2)|(1<<1); quads[2][0] = (1<<2)|(1<<1); quads[2][1] = (1<<3)|(1); - quads[2][3] = 255; + // quads[2][2] and quads[2][3] are never used so no need to initialize them. + // The four lowest bits in each quads[i][j] correspond to the 2x2 binary patterns + // Q_1, Q_2, Q_3 in the Neumann and Matas CVPR 2012 paper + // (see in page 4 at the end of first column). + // Q_1 and Q_2 have four patterns, while Q_3 has only two. // masks to know if a pixel is accessible and if it has been already added to some region