Debian Codegraph @

common/detector/white_rectangle_detector.go

raw symbols SCIP
1 package detectorscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/
2
3 import (
4 "github.com/makiuchi-d/gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/"
5 "github.com/makiuchi-d/gozxing/common/utilscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/util`/"
6 )
7
8 const (
9 whiteRectangleDetector_INIT_SIZEscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_INIT_SIZE. = 10
10 whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR. = 1
11 )
12
13 // WhiteRectangleDetector Detects a candidate barcode-like rectangular region within an image.
14 // It starts around the center of the image, increases the size of the candidate
15 // region until it finds a white rectangular region. By keeping track of the
16 // last black points it encountered, it determines the corners of the barcode.
17 type WhiteRectangleDetectorscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector# struct {
18 imagescip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#image. *gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.BitMatrixscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/BitMatrix#
19 heightscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#height. int
20 widthscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#width. int
21 leftInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#leftInit. int
22 rightInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#rightInit. int
23 downInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#downInit. int
24 upInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#upInit. int
25 }
26
27 func NewWhiteRectangleDetectorFromImagescip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/NewWhiteRectangleDetectorFromImage().(image *gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.BitMatrixscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/BitMatrix#) (*WhiteRectangleDetectorscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#, error) {
28 return NewWhiteRectangleDetectorscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/NewWhiteRectangleDetector().(
29 image, whiteRectangleDetector_INIT_SIZEscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_INIT_SIZE., image.GetWidthscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/BitMatrix#GetWidth().()/2, image.GetHeightscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/BitMatrix#GetHeight().()/2)
30 }
31
32 // NewWhiteRectangleDetector new WhiteRectangleDetector
33 // @param image barcode image to find a rectangle in
34 // @param initSize initial size of search area around center
35 // @param x x position of search center
36 // @param y y position of search center
37 // @throws NotFoundException if image is too small to accommodate {@code initSize}
38 func NewWhiteRectangleDetectorscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/NewWhiteRectangleDetector().(image *gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.BitMatrixscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/BitMatrix#, initSize, x, y int) (*WhiteRectangleDetectorscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#, error) {
39 halfsize := initSize / 2
40 d := &WhiteRectangleDetectorscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#{
41 imagescip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#image.: image,
42 heightscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#height.: image.GetHeightscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/BitMatrix#GetHeight().(),
43 widthscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#width.: image.GetWidthscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/BitMatrix#GetWidth().(),
44 leftInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#leftInit.: x - halfsize,
45 rightInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#rightInit.: x + halfsize,
46 upInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#upInit.: y - halfsize,
47 downInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#downInit.: y + halfsize,
48 }
49 if d.upInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#upInit. < 0 || d.leftInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#leftInit. < 0 || d.downInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#downInit. >= d.heightscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#height. || d.rightInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#rightInit. >= d.widthscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#width. {
50 return nil, gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewNotFoundExceptionscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewNotFoundException().()
51 }
52 return d, nil
53 }
54
55 // Detect Detects a candidate barcode-like rectangular region within an image.
56 // It starts around the center of the image, increases the size of the candidate
57 // region until it finds a white rectangular region.
58 //
59 // @return {@link ResultPoint}[] describing the corners of the rectangular
60 // region. The first and last points are opposed on the diagonal, as
61 // are the second and third. The first point will be the topmost
62 // point and the last, the bottommost. The second point will be
63 // leftmost and the third, the rightmost
64 // @throws NotFoundException if no Data Matrix Code can be found
65 //
66 func (this *WhiteRectangleDetectorscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#) Detectscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#Detect().() ([]gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.ResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#, error) {
67 left := this.leftInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#leftInit.
68 right := this.rightInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#rightInit.
69 up := this.upInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#upInit.
70 down := this.downInitscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#downInit.
71 sizeExceeded := false
72 aBlackPointFoundOnBorder := true
73
74 atLeastOneBlackPointFoundOnRight := false
75 atLeastOneBlackPointFoundOnBottom := false
76 atLeastOneBlackPointFoundOnLeft := false
77 atLeastOneBlackPointFoundOnTop := false
78
79 for aBlackPointFoundOnBorder {
80
81 aBlackPointFoundOnBorder = false
82
83 // .....
84 // . |
85 // .....
86 rightBorderNotWhite := true
87 for (rightBorderNotWhite || !atLeastOneBlackPointFoundOnRight) && right < this.widthscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#width. {
88 rightBorderNotWhite = this.containsBlackPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#containsBlackPoint().(up, down, right, false)
89 if rightBorderNotWhite {
90 right++
91 aBlackPointFoundOnBorder = true
92 atLeastOneBlackPointFoundOnRight = true
93 } else if !atLeastOneBlackPointFoundOnRight {
94 right++
95 }
96 }
97
98 if right >= this.widthscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#width. {
99 sizeExceeded = true
100 break
101 }
102
103 // .....
104 // . .
105 // .___.
106 bottomBorderNotWhite := true
107 for (bottomBorderNotWhite || !atLeastOneBlackPointFoundOnBottom) && down < this.heightscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#height. {
108 bottomBorderNotWhite = this.containsBlackPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#containsBlackPoint().(left, right, down, true)
109 if bottomBorderNotWhite {
110 down++
111 aBlackPointFoundOnBorder = true
112 atLeastOneBlackPointFoundOnBottom = true
113 } else if !atLeastOneBlackPointFoundOnBottom {
114 down++
115 }
116 }
117
118 if down >= this.heightscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#height. {
119 sizeExceeded = true
120 break
121 }
122
123 // .....
124 // | .
125 // .....
126 leftBorderNotWhite := true
127 for (leftBorderNotWhite || !atLeastOneBlackPointFoundOnLeft) && left >= 0 {
128 leftBorderNotWhite = this.containsBlackPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#containsBlackPoint().(up, down, left, false)
129 if leftBorderNotWhite {
130 left--
131 aBlackPointFoundOnBorder = true
132 atLeastOneBlackPointFoundOnLeft = true
133 } else if !atLeastOneBlackPointFoundOnLeft {
134 left--
135 }
136 }
137
138 if left < 0 {
139 sizeExceeded = true
140 break
141 }
142
143 // .___.
144 // . .
145 // .....
146 topBorderNotWhite := true
147 for (topBorderNotWhite || !atLeastOneBlackPointFoundOnTop) && up >= 0 {
148 topBorderNotWhite = this.containsBlackPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#containsBlackPoint().(left, right, up, true)
149 if topBorderNotWhite {
150 up--
151 aBlackPointFoundOnBorder = true
152 atLeastOneBlackPointFoundOnTop = true
153 } else if !atLeastOneBlackPointFoundOnTop {
154 up--
155 }
156 }
157
158 if up < 0 {
159 sizeExceeded = true
160 break
161 }
162
163 }
164
165 if !sizeExceeded {
166
167 maxSize := right - left
168
169 var z gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.ResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#
170 for i := 1; z == nil && i < maxSize; i++ {
171 z = this.getBlackPointOnSegmentscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#getBlackPointOnSegment().(left, down-i, left+i, down)
172 }
173
174 if z == nil {
175 return nil, gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewNotFoundExceptionscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewNotFoundException().("no black point on left-down")
176 }
177
178 var t gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.ResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#
179 //go down right
180 for i := 1; t == nil && i < maxSize; i++ {
181 t = this.getBlackPointOnSegmentscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#getBlackPointOnSegment().(left, up+i, left+i, up)
182 }
183
184 if t == nil {
185 return nil, gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewNotFoundExceptionscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewNotFoundException().("no black point on left-up")
186 }
187
188 var x gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.ResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#
189 //go down left
190 for i := 1; x == nil && i < maxSize; i++ {
191 x = this.getBlackPointOnSegmentscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#getBlackPointOnSegment().(right, up+i, right-i, up)
192 }
193
194 if x == nil {
195 return nil, gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewNotFoundExceptionscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewNotFoundException().("no black point on right-up")
196 }
197
198 var y gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.ResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#
199 //go up left
200 for i := 1; y == nil && i < maxSize; i++ {
201 y = this.getBlackPointOnSegmentscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#getBlackPointOnSegment().(right, down-i, right-i, down)
202 }
203
204 if y == nil {
205 return nil, gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewNotFoundExceptionscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewNotFoundException().("no black point on right-down")
206 }
207
208 return this.centerEdgesscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#centerEdges().(y, z, x, t), nil
209 }
210
211 return nil, gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewNotFoundExceptionscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewNotFoundException().()
212 }
213
214 func (this *WhiteRectangleDetectorscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#) getBlackPointOnSegmentscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#getBlackPointOnSegment().(aX, aY, bX, bY int) gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.ResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint# {
215 dist := utilscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/util`/.MathUtils_Roundscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/util`/MathUtils_Round().(utilscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/util`/.MathUtils_DistanceIntscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/util`/MathUtils_DistanceInt().(aX, aY, bX, bY))
216 xStep := float64(bX-aX) / float64(dist)
217 yStep := float64(bY-aY) / float64(dist)
218
219 for i := 0; i < dist; i++ {
220 x := utilscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/util`/.MathUtils_Roundscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/util`/MathUtils_Round().(float64(aX) + float64(i)*xStep)
221 y := utilscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/util`/.MathUtils_Roundscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/util`/MathUtils_Round().(float64(aY) + float64(i)*yStep)
222 if this.imagescip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#image..Getscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/BitMatrix#Get().(x, y) {
223 return gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewResultPoint().(float64(x), float64(y))
224 }
225 }
226 return nil
227 }
228
229 // centerEdges recenters the points of a constant distance towards the center
230 //
231 // @param y bottom most point
232 // @param z left most point
233 // @param x right most point
234 // @param t top most point
235 // @return {@link ResultPoint}[] describing the corners of the rectangular
236 // region. The first and last points are opposed on the diagonal, as
237 // are the second and third. The first point will be the topmost
238 // point and the last, the bottommost. The second point will be
239 // leftmost and the third, the rightmost
240 //
241 func (this *WhiteRectangleDetectorscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#) centerEdgesscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#centerEdges().(y, z, x, t gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.ResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#) []gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.ResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint# {
242
243 //
244 // t t
245 // z x
246 // x OR z
247 // y y
248 //
249
250 yi := y.GetXscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#GetX.()
251 yj := y.GetYscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#GetY.()
252 zi := z.GetXscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#GetX.()
253 zj := z.GetYscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#GetY.()
254 xi := x.GetXscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#GetX.()
255 xj := x.GetYscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#GetY.()
256 ti := t.GetXscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#GetX.()
257 tj := t.GetYscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#GetY.()
258
259 if yi < float64(this.widthscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#width.)/2.0 {
260 return []gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.ResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#{
261 gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewResultPoint().(ti-whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR., tj+whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR.),
262 gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewResultPoint().(zi+whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR., zj+whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR.),
263 gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewResultPoint().(xi-whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR., xj-whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR.),
264 gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewResultPoint().(yi+whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR., yj-whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR.),
265 }
266 } else {
267 return []gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.ResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/ResultPoint#{
268 gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewResultPoint().(ti+whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR., tj+whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR.),
269 gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewResultPoint().(zi+whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR., zj-whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR.),
270 gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewResultPoint().(xi-whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR., xj+whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR.),
271 gozxingscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/.NewResultPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/NewResultPoint().(yi-whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR., yj-whiteRectangleDetector_CORRscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/whiteRectangleDetector_CORR.),
272 }
273 }
274 }
275
276 // containsBlackPoint Determines whether a segment contains a black point
277 //
278 // @param a min value of the scanned coordinate
279 // @param b max value of the scanned coordinate
280 // @param fixed value of fixed coordinate
281 // @param horizontal set to true if scan must be horizontal, false if vertical
282 // @return true if a black point has been found, else false.
283 //
284 func (this *WhiteRectangleDetectorscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#) containsBlackPointscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#containsBlackPoint().(a, b, fixed int, horizontal bool) bool {
285
286 if horizontal {
287 for x := a; x <= b; x++ {
288 if this.imagescip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#image..Getscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/BitMatrix#Get().(x, fixed) {
289 return true
290 }
291 }
292 } else {
293 for y := a; y <= b; y++ {
294 if this.imagescip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing/common/detector`/WhiteRectangleDetector#image..Getscip-go gomod github.com/makiuchi-d/gozxing . `github.com/makiuchi-d/gozxing`/BitMatrix#Get().(fixed, y) {
295 return true
296 }
297 }
298 }
299
300 return false
301 }