Skip to content

Commit 9bffc66

Browse files
committed
Doc of PCLines
1 parent d2c5124 commit 9bffc66

1 file changed

Lines changed: 19 additions & 21 deletions

File tree

pclines/accumulator.py

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,14 @@
11
"""
2-
PCLines transform for line detection
3-
4-
This package implements the method from
5-
Dubska et al, PCLines - Line detection with parallel coordinates, CVPR 2011
6-
7-
8-
Module
9-
------
10-
The module provides a high-level function for line detection in image
11-
and also low-level functions for
2+
The module provides the class PCLines with "low level" functions for
123
* accumulation of observations to PCLines space,
134
* point mapping from PCLines space to homogeneous lines
145
that can be used to construct a custom PCLines transform of user-defined
15-
edge points.
16-
17-
18-
See also
19-
--------
20-
* pclines.accumulate
21-
* pclines.find_peaks
22-
* pclines.line_parameters
6+
edge points (observations).
237
248
259
References
2610
----------
2711
[1] Dubska et al, PCLines - Line detection with parallel coordinates, CVPR 2011
28-
29-
3012
"""
3113

3214

@@ -167,17 +149,21 @@ def __init__(self, bbox, d=256):
167149

168150
@property
169151
def origin(self):
152+
""" The origin of the bounding box of the observations """
170153
return self.bbox[:2]
171154

172155
@property
173156
def input_shape(self):
157+
""" Size of the bounding box """
174158
return self.bbox[2:]
175159

176160
@property
177161
def scale(self):
162+
""" Larger side of the bounding box """
178163
return max(self.input_shape)
179164

180165
def clear(self):
166+
""" Set the accumulator to 0 """
181167
self.A[:] = 0
182168

183169
def transform(self, x):
@@ -219,10 +205,22 @@ def inverse(self, l):
219205
return lines
220206

221207
def valid_points(self, p):
208+
""" Check if the points fits the accumulator """
222209
return np.all(np.logical_and(p>=0, p<self.d), axis=1)
223210

224211
def insert(self, x, weight=None):
225-
"""
212+
""" Insert observations x to the accumulator
213+
214+
Inputs
215+
------
216+
x : ndarray
217+
(N,2) observations
218+
weights : ndarray or None
219+
Weight of each observation in accumulator (defaults to 1 in None)
220+
221+
Notes
222+
-----
223+
Any observation outside the bounding box is ignored.
226224
"""
227225
p = self.transform(x)
228226
n = p.shape[0]

0 commit comments

Comments
 (0)