seg1d.Segmenter.segment¶
-
Segmenter.
segment
()[source]¶ Method to run the segmentation algorithm on the current Segmenter instance
Parameters: - None
Returns: - 3 x n array
segments of form
[start of segment,end of segment,correlation score]
Examples
This example is the same as the main
Segmenter
class as it is the interface method.>>> import numpy as np >>> import seg1d >>> >>> #Make an instance of the segmenter >>> s = seg1d.Segmenter() >>> >>> #retrieve the sample reference, target, and weight data >>> s.r,s.t,s.w = seg1d.sampleData() >>> >>> #set the parameters >>> s.minW,s.maxW,s.step = 70, 150, 1 >>> >>> np.around(s.segment(),7) array([[207. , 240. , 0.9124224], [342. , 381. , 0.8801901], [ 72. , 112. , 0.8776795]])