Skip to content

Commit 38dc81d

Browse files
Update intensity_based_segmentation.py
1 parent 2030b33 commit 38dc81d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

computer_vision/intensity_based_segmentation.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Source:"https://www.ijcse.com/docs/IJCSE11-02-03-117.pdf"
1+
# Source: "https://www.ijcse.com/docs/IJCSE11-02-03-117.pdf"
2+
23
# Importing necessary libraries
34
import numpy as np
45
from PIL import Image
@@ -18,7 +19,9 @@ def segment_image(image: np.ndarray, thresholds: list[int]) -> np.ndarray:
1819
Example:
1920
>>> img = np.array([[80, 120, 180], [40, 90, 150], [20, 60, 100]])
2021
>>> segment_image(img, [50, 100, 150])
21-
array([[1, 2, 3], [0, 1, 2], [0, 1, 1]])
22+
array([[1, 2, 3],
23+
[0, 1, 2],
24+
[0, 1, 1]])
2225
"""
2326
# Initialize segmented array with zeros
2427
segmented = np.zeros_like(image, dtype=np.int32)

0 commit comments

Comments
 (0)