## 2 Theoretical Background
### Classical and Fuzzy Hough Transforms
The third step is implementing the Non-maximum Suppression (NMS) approach to check if the pixels are part of the local maxima, and if not, they are put down to zero. Two hysteresis high and low thresholds are computed in the final step. Every edge point with a gradient value greater than the higher threshold is identified as a strong edge, whereas the edge points whose gradient values fall below the lower threshold are eliminated. The connectivity of the residual edge points which have gradient values between the low and high thresholds is tested: the examined point is considered as an edge pixel only if at least one of the neighboring pixels is a strong edge pixel [48]. ## 3 Practical Application of the Proposed Method

### Edge Detection Methods--Application, Evaluation, and Selection

For these tasks, several processing steps were carried out. They are sequentially summarized below together with the illustrated figures and plots. Three publicly available colonoscopy image databases, CVC-Clinic [9], CVC-Colon [42], and ETIS-Larib [34] are used. 1. Cutting off the black frame surrounding all original images to reduce unnecessary information. 2. Removing the colonoscope's light reflections: The colonoscope light's reflections (and consequently their contours) were removed from all the databases' images as a step towards reducing the number of redundant edge pixels (Figure 4b). The histogram of the image pixel intensities was used as the basis for the reflection removal step. Briefly, we cut out the histogram's highest (and lowest) intensity peaks, and then the pixel intensities were re-normalized to the original [0 to 255] domain. A \"white mask\" was created using the pixels that made up the histogram's highest peak. Similar to the procedure described in [49], the \"white mask\" was extended and smoothened into the neighboring pixels. 3. Extracting polyp contour: For each of the ground truth masks (Figure 4c), the contour was defined (Figure 4d). The number of pixels that make up the polyp mask contour was calculated for later use in the evaluation process. 4. Generating the \"ring mask\" for the colorectal polyp contour: In many cases of the manually drawn masks, the edges of the polyp's contour are not completely visible, either because the polyp is located in the area of bowel folds, or it is covered with impurities. Moreover, reasons related to the human fatigue or error can also affect the drawing accuracy of the colorectal polyp mask. These are the main reasons why it was necessary to extend the contour of the manually drawn database mask to a finite width ring which is proportional to the size of the examined image. The previously extracted contour was extended into a ring (Figure 4e). To do that, we selected the first \(x\) nearest pixels of the entire contour as a width of the ring mask. As the databases images are with different sizes, we used different ring mask widths based on the database images size (they are \(x=3\) for CVC-Clinic database [9], \(x=5\) for CVC-Colon database [42], and \(x=10\) for ETIS-Larib database [34]). 5. Calculating the gradient magnitude for each of the studied samples, like in (Figure 4f). 6. Detecting polyp edges: Canny, Prewitt, Roberts, and Sobel techniques were applied as four different edge detection methods (Figure 5a,c,e,g respectively). By employing this edge detection operation, it becomes possible to decrease the time required for the following pre-processing steps and offers a comparatively consistent data source that tolerates geometric and environmental variations while performing the Hough transform calculations. The total number of edge pixels resulting from each filtering technique for all the images of the three databases was calculated and plotted in Figure 6.
7. Finding the gradient-weighted edges: The edge filtered images (Figure 5a,c,e,g) were multiplied by the gradient magnitude output (Figure 4f).