Module: image_segmentation¶
This module provides the implementation of the DoDBSCANImageSegmentationTask
class
used to perform the image segmentation Task
The algorithm in of the task is implemented by the do_image_segmentation()
Classes and Inheritance Structure¶
Summary¶
DetectionInputProducts (image_array, masked) |
|
DoImageSegmentationTask ([name, func, ...]) |
Class that implements the image segmentation Task |
Module API¶
-
class
DoImageSegmentationTask
(name='image_segmentation', func=<function do_image_segmentation>, parser=None, process=None)[source]¶ Bases:
asterism.pipeline_manager.analysis_tasks.AnalysisTask
Class that implements the image segmentation Task
user guide: DoImageSegmentation
Methods
add_par
(name, \*\*kwargs)get_par_value
(name)list_parameters
()run
([extra_message])set_par
(name, \*\*kwargs)set_pars_from_parser
(args, argv, args_dict)start_message
([extra_message])stop_message
()
-
build_detection_input_prod_list
(image, bkg_th=None, max_image_size=None, min_sub_stamp_size=25, use_only_central_sub_stamp=False)[source]¶
-
dbscan_binned_segmentation
(image_array, K, Eps, bkg_th=None, K_pix=False, masked=None, verbose=False)[source]¶
-
dbscan_unbinned_segmentation
(image_array, K, Eps, bkg_th=None, K_pix=False, masked=None, verbose=False)[source]¶
-
do_image_segmentation
(image, bkg_threshold, method='dbscan_binned', dbscan_eps=1.0, K=1.5, K_pix=False, max_image_size=1000000.0, min_sub_stamp_size=25, verbose=False, plot=False, input_seg_map=None, seg_map_bkg_val=0, image_id=None, use_only_central_sub_stamp=False)[source]¶ Task function to perform image segmentation
user guide: DoImageSegmentation
Parameters: image :
Image
objectthe image used to estimate the bkg
method : string
segmentation method among : ‘dbscan’,’dbscan_binned’,’connected’
bkg_threshold : float
value of the background threshold
dbscan_eps : float
radius of the dbscan scanning brush
K : float
sets the segmentation threshold as K*bkg_threshold
K_pix : bool
if True, total flux in the dbscan bursh is divided by the number of pixels in the brush, and the compared to K*bkg_threshold
dbscan_buffer_size : float
max_image_size : int
if is not None, the image is segmented in substamps
min_sub_stamp_size : int
the minimum substamp size to perform segmentation
verbose : bool
plot_dbscan : bool
input_seg_map : 2dim numpy array
segmentation map
seg_map_bkg_val : int (default 0)
value for the bkg pixel in the seg map
image_id : int
use_only_central_sub_stamp : bool
Returns: src_cl_list : list
list of cluster sources
K : float
th value used for the detection
selected_coords : numpy 2dim array
array storing in the first column the x, and in the second column the y of the coordinates of the input image that were not masked