summary refs log blame commit diff stats
path: root/opencv/code/a13.py
blob: 3afdf1acf60f1b4354be04c89879cd5109de6494 (plain) (tree)
1
2
3
4
5
6
7
8
9








                                                                                
import cv2

image = cv2.imread("1i.png", cv2.IMREAD_GRAYSCALE)

threshold_values = [50, 100, 150]

for i, threshold in enumerate(threshold_values, start=1):
    _, segmented_image = cv2.threshold(image, threshold, 255, cv2.THRESH_BINARY)
    cv2.imwrite(f"13.{i}.jpg", segmented_image)