Image segmentation
Image segmentation
import cv2
import numpy as np
import matplotlib.pyplot as plt
# Convert to grayscale
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # Converts the image to grayscale (OpenCV uses
BGR by default)
# np.column_stack(np.where(edges > 0)) extracts the coordinates (i.e., x, y points) of all non-zero
pixels (edges).
edge_points = np.column_stack(np.where(edges > 0))
#out Put