We present an efficient run-based two-scan algorithm for labeling connected components in a binary image. Unlike conventional label-equivalence-based algorithms, which resolve label equivalences between provisional labels, our algorithm resolves label equivalences between provisional label sets. At any time, all provisional labels that are assigned to a connected component are combined in a set, and the smallest label is used as the representative label. The corresponding relation of a provisional label and its representative label is recorded in a table. Whenever different connected components are found to be connected, all provisional label sets concerned with these connected components are merged together, and the smallest provisional label is taken as the representative label. When the first scan is finished, all provisional labels that were assigned to each connected component in the given image will have a unique representative label. During the second scan, we need only to replace each provisional label by its representative label. Experimental results on various types of images demonstrate that our algorithm outperforms all conventional labeling algorithms.
Whenever one wants to distinguish, recognize, and/or measure objects (connected components) in binary images, labeling is required. This paper presents two efficient label-equivalence-based connected-component labeling algorithms for 3-D binary images. One is voxel based and the other is run based. For the voxel-based one, we present an efficient method of deciding the order for checking voxels in the mask. For the run-based one, instead of assigning each foreground voxel, we assign each run a provisional label. Moreover, we use run data to label foreground voxels without scanning any background voxel in the second scan. Experimental results have demonstrated that our voxel-based algorithm is efficient for 3-D binary images with complicated connected components, that our run-based one is efficient for those with simple connected components, and that both are much more efficient than conventional 3-D labeling algorithms.
1 May 2013 in Journal of Computer Science and Technology
Accurate detection of Obstructive Sleep Apnea (OSA) with a single-lead electrocardiogram (ECG) signal is highly desirable for timely treating of OSA patients. However, due to the variance of apneas in appearance and size in ECG signals, it is still a very challenging task to obtain an accurate OSA apnea detection. To address this problem, this paper presents a time frequency information fusion based CNN-Transformer model (TFFormer) for OSA detection with Single-lead ECG. In which, a module consisting of a deep residual shrinkage module, a multi-scale convolutional attention module (MSCA), and a multi-layer convolution module is developed for time-frequency feature extraction. The purpose of this operation is to extract rich features from a short length of ECG signal sequences with a low computation cost. For time-frequency information fusion, to reduce its computation cost, a gated self-attention based adaptive pruning time-frequency information fusion module is developed to prune the redundant tokens. With the attention based adaptive pruning time-frequency information fusion module(APTFFA), the TFFormer is constructed for data parallel processing and long-distance modeling. Compared with the best model in the comparative method, the accuracy of the proposed method was improved by 0.18% in the segmented case, and the mean absolute error was reduced by 0.25 per-recorded case, which demonstrates that the TFFormer model has better OSA detection performance and could provide a convenient and accurate solution for clinical OSA detection.