??? ??, ?? ?? ??? ???? ???? ?? ?? ???? ?? ? ?? ??? ??? ?? ?????. ?? ?? ??, ??? ??, ??? ??? ??? ?? ?? ???? ???? ??? ???. ??? ??? ????? ???? ??? ? ????? ?????? OpenCV(cv2)? ????? ???? ??? ?? ??? ?????.
? ??????? ? ?? ?? ?? ??? ??? ???????.
- ?? ?? ?? – ??? ??? ?? ? ?????.
- ?? ???? – ??? ??? ???? ? ?????.
- K-?? ?? ?? – ????? ??? ??? ??????? ? ??????.
? ????? ???? ????? ??? ?? ?? ?? ??? ???? ?? ???? ?? ? ?? ??? ???????. ????? GitHub ????? ??? ???? ?? ?? ???? ????? ? ????.
?? ??? ?? ?? ?? ??
?? ?? ??? ???? ??? ???? ?????? ??? ?????. ?? ?? ??? ??? ??? ?? ?? ??? ???? ?????. ? ??? ?? ???? ???? "?? ????" ???? ?????. OpenCV? ???? ??? ???????.
?: ?? ????? ???? ??
???? ???? ????, ?? ?? ??? ??? ??? ?????.
import cv2 import numpy as np import matplotlib.pyplot as plt files = sorted(glob("SAT*.png")) #Get png files print(len(files)) img=cv2.imread(files[0]) use_image= img[0:600,700:1300] gray = cv2.cvtColor(use_image, cv2.COLOR_BGR2GRAY) #Stadard values min_val = 100 max_val = 200 # Apply Canny Edge Detection edges = cv2.Canny(gray, min_val, max_val) #edges = cv2.Canny(gray, min_val, max_val,apertureSize=5,L2gradient = True ) False # Show the result plt.figure(figsize=(15, 5)) plt.subplot(131), plt.imshow(cv2.cvtColor(use_image, cv2.COLOR_BGR2RGB)) plt.title('Original Image'), plt.axis('off') plt.subplot(132), plt.imshow(gray, cmap='gray') plt.title('Grayscale Image'), plt.axis('off') plt.subplot(133), plt.imshow(edges, cmap='gray') plt.title('Canny Edges'), plt.axis('off') plt.show()
?? ?????? ?? ??? ?? ?? ??? ??? ???? ?????. ??? ???? ????? ?? ?? ??? ???????. ??? min_val ? max_val? ??? ??? ??? ?? ?? ?????.
???? ?? ??? ????? ?? ???? ????? ?? ??? ????? ???? ?? ? ????. ?? ????? ???(cv2.equalizeHist()) ? ??? ??(cv2.GaussianBlur())? ???? ??? ? ????.
use_image= img[0:600,700:1300] gray = cv2.cvtColor(use_image, cv2.COLOR_BGR2GRAY) gray_og = gray.copy() gray = cv2.equalizeHist(gray) gray = cv2.GaussianBlur(gray, (9, 9),1) plt.figure(figsize=(15, 5)) plt.subplot(121), plt.imshow(gray, cmap='gray') plt.title('Grayscale Image') plt.subplot(122) _= plt.hist(gray.ravel(), 256, [0,256],label="Equalized") _ = plt.hist(gray_og.ravel(), 256, [0,256],label="Original",histtype='step') plt.legend() plt.title('Grayscale Histogram')
??? ???? ?? ??? ??? ?? ???? ???? ?? Canny Edge ?? ????? ?? ?? ?? ????? ???? ? ??? ???.
????? ????? ??? ?????. ?? ??? ???? ?? ????? ????? ???? ??????.
# Edges to contours contours, hierarchy = cv2.findContours(edges, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) # Calculate contour areas areas = [cv2.contourArea(contour) for contour in contours] # Normalize areas for the colormap normalized_areas = np.array(areas) if normalized_areas.max() > 0: normalized_areas = normalized_areas / normalized_areas.max() # Create a colormap cmap = plt.cm.jet # Plot the contours with the color map plt.figure(figsize=(10, 10)) plt.subplot(1,2,1) plt.imshow(gray, cmap='gray', alpha=0.5) # Display the grayscale image in the background mask = np.zeros_like(use_image) for contour, norm_area in zip(contours, normalized_areas): color = cmap(norm_area) # Map the normalized area to a color color = [int(c*255) for c in color[:3]] cv2.drawContours(mask, [contour], -1, color,-1 ) # Draw contours on the image plt.subplot(1,2,2)
? ??? ??? ??? ?? ??? ???? ???? ?? ?????. ? ???? ??? ?? ??? ?????, ??? ??? ?? ????? ???? ? ??? ???. ??? ? ???? ?? ???? ??? ?? ????? ?? ????. ?? ??? ?? ???? ??? ?? ??? ?? ??? ??? ? ????.
???? ?? ??? ??? Canny Edge ??? ????? ?? ??? ???? ??? ??? ???. ??? ??? ? ???? ???? ???? ? ?? ? ?????. ???? K-?? ?????? ???? ???? ???? ???? ??? ???? ?? ?? ??? ???????.
KMean ?????
K-?? ?????? ??? ??? ????? ????? ??? ???? ?? ???? ????, ?? ???? ???? ???? ???? ? ?? ??????. OpenCV? cv2.kmeans ??? ? ????? ????? ?? ??, ?? ?? ?? ??? ??? ?? ??? ???? ? ?? ????.
? ????? K-Means Clustering? ???? ?? ?? ???? ??? ??? ???? ?????.
????? ???? RGB ?? K-?? ?????? ???? ? ??? ??? ???? ?????.
import cv2 import numpy as np import matplotlib.pyplot as plt files = sorted(glob("SAT*.png")) #Get png files print(len(files)) img=cv2.imread(files[0]) use_image= img[0:600,700:1300] gray = cv2.cvtColor(use_image, cv2.COLOR_BGR2GRAY) #Stadard values min_val = 100 max_val = 200 # Apply Canny Edge Detection edges = cv2.Canny(gray, min_val, max_val) #edges = cv2.Canny(gray, min_val, max_val,apertureSize=5,L2gradient = True ) False # Show the result plt.figure(figsize=(15, 5)) plt.subplot(131), plt.imshow(cv2.cvtColor(use_image, cv2.COLOR_BGR2RGB)) plt.title('Original Image'), plt.axis('off') plt.subplot(132), plt.imshow(gray, cmap='gray') plt.title('Grayscale Image'), plt.axis('off') plt.subplot(133), plt.imshow(edges, cmap='gray') plt.title('Canny Edges'), plt.axis('off') plt.show()
??? ?????? ??? ?? ??? ??? ???? ???? ????. ??? ???? ??? ?? ??? ?? ????? ????? ??? ??? ? ????.
???? ??? ? ???? ????? ??? ?? K-??? ???? ?? ??? ??? ??? ? ????.
use_image= img[0:600,700:1300] gray = cv2.cvtColor(use_image, cv2.COLOR_BGR2GRAY) gray_og = gray.copy() gray = cv2.equalizeHist(gray) gray = cv2.GaussianBlur(gray, (9, 9),1) plt.figure(figsize=(15, 5)) plt.subplot(121), plt.imshow(gray, cmap='gray') plt.title('Grayscale Image') plt.subplot(122) _= plt.hist(gray.ravel(), 256, [0,256],label="Equalized") _ = plt.hist(gray_og.ravel(), 256, [0,256],label="Original",histtype='step') plt.legend() plt.title('Grayscale Histogram')
??? ???? ?? ????? ? ?????? ???? ???? ??? ??? ????? ? ??? ?? ???.
?? ??? ? ? ???? ?? matplotlib plt.fill_between;? ???? ??? ???? ??? ?? ?? ?? ? ????.
# Edges to contours contours, hierarchy = cv2.findContours(edges, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) # Calculate contour areas areas = [cv2.contourArea(contour) for contour in contours] # Normalize areas for the colormap normalized_areas = np.array(areas) if normalized_areas.max() > 0: normalized_areas = normalized_areas / normalized_areas.max() # Create a colormap cmap = plt.cm.jet # Plot the contours with the color map plt.figure(figsize=(10, 10)) plt.subplot(1,2,1) plt.imshow(gray, cmap='gray', alpha=0.5) # Display the grayscale image in the background mask = np.zeros_like(use_image) for contour, norm_area in zip(contours, normalized_areas): color = cmap(norm_area) # Map the normalized area to a color color = [int(c*255) for c in color[:3]] cv2.drawContours(mask, [contour], -1, color,-1 ) # Draw contours on the image plt.subplot(1,2,2)
? ???? ???? ?? ??? ?? RGB ?? ?? ???? ????? ?? ??? ??? ? ????. ?? ? ?? ??? ????? ??? ??? ? ????.
???? ?(K)? ??? ? ??? ????. K? ??? ?? ???? ??? ????, ?? ???? ? ?? ???? ?????. ??? ?? ?? K ?? ??? ? ????.
import cv2 import numpy as np import matplotlib.pyplot as plt files = sorted(glob("SAT*.png")) #Get png files print(len(files)) img=cv2.imread(files[0]) use_image= img[0:600,700:1300] gray = cv2.cvtColor(use_image, cv2.COLOR_BGR2GRAY) #Stadard values min_val = 100 max_val = 200 # Apply Canny Edge Detection edges = cv2.Canny(gray, min_val, max_val) #edges = cv2.Canny(gray, min_val, max_val,apertureSize=5,L2gradient = True ) False # Show the result plt.figure(figsize=(15, 5)) plt.subplot(131), plt.imshow(cv2.cvtColor(use_image, cv2.COLOR_BGR2RGB)) plt.title('Original Image'), plt.axis('off') plt.subplot(132), plt.imshow(gray, cmap='gray') plt.title('Grayscale Image'), plt.axis('off') plt.subplot(133), plt.imshow(edges, cmap='gray') plt.title('Canny Edges'), plt.axis('off') plt.show()
??? K ?? ?? ????? ??? ????? ??? ??? ??? ?????.
??? K ?(?: 2-3): ??? ??? ?? ???? ????? ?? ?? ??? ?????.
?K ?? ????(?: 12-15): ? ????? ?????? ???? ???? ???? ???? ???? ????.
K-?? ?????? ?? ???? ???? ???? ???? ??? ?????. ??? ??? ??? ?? ???? ?? ?? ??? ?????. ??? ??? K? ??, ?? ???? ??, ??? ???? ?? ?????. ???? ??? ??? ???? ??? ??? ???? ???? ?? ????? ???????.
?? ??
?? ????? ??? ?? ??? ??? ????? ??? ?????. ? ??? ??? ?? ?? ??? ???? "???"? "???"? ????? ?????. ?? ??? ?????? ????? ??? ??? ??? ??? ? ????. ?? ??? ??? ???? ? ?? ????? ? ??, ?? ??, ??? ?? ??? ?? ??? ????? ??? ?????.
? ?? ??? ???? ????? ??? ??? ?? ?? ????? ???? ????.
use_image= img[0:600,700:1300] gray = cv2.cvtColor(use_image, cv2.COLOR_BGR2GRAY) gray_og = gray.copy() gray = cv2.equalizeHist(gray) gray = cv2.GaussianBlur(gray, (9, 9),1) plt.figure(figsize=(15, 5)) plt.subplot(121), plt.imshow(gray, cmap='gray') plt.title('Grayscale Image') plt.subplot(122) _= plt.hist(gray.ravel(), 256, [0,256],label="Equalized") _ = plt.hist(gray_og.ravel(), 256, [0,256],label="Original",histtype='step') plt.legend() plt.title('Grayscale Histogram')
??? ??? ??? ?? ?? ??? ?? ???? ? ????.
# Edges to contours contours, hierarchy = cv2.findContours(edges, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) # Calculate contour areas areas = [cv2.contourArea(contour) for contour in contours] # Normalize areas for the colormap normalized_areas = np.array(areas) if normalized_areas.max() > 0: normalized_areas = normalized_areas / normalized_areas.max() # Create a colormap cmap = plt.cm.jet # Plot the contours with the color map plt.figure(figsize=(10, 10)) plt.subplot(1,2,1) plt.imshow(gray, cmap='gray', alpha=0.5) # Display the grayscale image in the background mask = np.zeros_like(use_image) for contour, norm_area in zip(contours, normalized_areas): color = cmap(norm_area) # Map the normalized area to a color color = [int(c*255) for c in color[:3]] cv2.drawContours(mask, [contour], -1, color,-1 ) # Draw contours on the image plt.subplot(1,2,2)
????? ??? ??? ????? ???? ?? ??? ??? ??? ????. ? ???? ?? ??? ???? ??????. ??? ????? ??? ??? ??, ??? ??, ???? ??? ?? ??? ??? ?? ?????.
????? ??? ?? ??? ?? ??? ?? ?? ???? ???? ??? ?? ??? ? ????. ?? ?? ??? ????.
# Kmean color segmentation use_image= img[0:600,700:1300] #use_image = cv2.medianBlur(use_image, 15) # Reshape image for k-means pixel_values = use_image.reshape((-1, 3)) if len(use_image.shape) == 3 else use_image.reshape((-1, 1)) pixel_values = np.float32(pixel_values) criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 10, 1.0) K = 3 attempts=10 ret,label,center=cv2.kmeans(pixel_values,K,None,criteria,attempts,cv2.KMEANS_PP_CENTERS) centers = np.uint8(center) segmented_data = centers[label.flatten()] segmented_image = segmented_data.reshape(use_image.shape) plt.figure(figsize=(10, 6)) plt.subplot(1,2,1),plt.imshow(use_image[:,:,::-1]) plt.title("RGB View") plt.subplot(1,2,2),plt.imshow(segmented_image[:,:,[2,1,0]]) plt.title(f"Kmean Segmented Image K={K}")
??? ??? ?? ? ?? ??? ???? ???? ??? ????? ???? ? ????.
?? ????? ??? ?? ??? ??? ??? ??? ??? ????? ?????. ??? ??? ???? ?? ?? ??? ?? ??? ???? ????? ??? ? ????. ??? ?? ??? ??? ???? ?? ? ???? ?? ????.
??
???? ??? ??? ?? ???, ??? ?? ??? ??? ???? ??? ? ?? ??? ?????. ? ??????? ?? ???? ??, K-?? ?????, ?? ??????? ? ?? ??? ?? ??? ????? ?? ?? ??????? ?? ???????. ???? ?? ?? ?? ???? ?? ?? ????? ? ?? ?? ??? ????? ??? ??? ?? ??? ???? OpenCV? ???? ?????.
?? ??? ??????? ? ?? ??? ???? ??? ?? ??? ??? ???. ?? ?? ??? ?? ??? ?? ???? ??????
? ??? [Python-CV??? ?? : Canny Edge, Watershed ? K-Means ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











?? ????? (DP)? ??? ??? ? ??? ?? ??? ??? ??? ? ??? ??? ?? ??? ???? ??? ????? ??????. ? ?? ?? ??? ????. 1. ??? (??) : ??? ?? ??? ???? ??? ???? ?? ??? ??????. 2. ??? (?) : ?? ???? ???? ????? ?????. ???? ???, ?? ?? ?? ?? ??/?? ?, ??? ??? ?? ?? ?? ??? ??? ????? ?????. ?????? ????? ?? ???? ?? ??? ? ???, ?? ??? ???? ?? ?? ??? ???? ??? ???? ????? ???? ???????.

Python? ?? ??? ???? ?????? ????, ????? ? ?? ??????? ???? ? ??? ??? ???? ?? ??? ?????. ?? TCP ??? ????? Socket.Socket ()? ???? ??? ??? ?? ? ??? ????? .listen ()? ???? ??? ?? .accept ()? ?? ????? ??? ???????. TCP ?????? ????? ?? ??? ??? ??? ????? .connect ()? ?? ? ?? .sendall ()? ???? ???? ??? .recv ()? ?? ??? ??????. ?? ?????? ????? 1. ??? : ??? ??? ? ???? ??? ? ????. 2. ??? I/O : ?? ??, Asyncio ?????? ? ??? ??? ?? ? ? ????. ???? ? ?

Python List ????? ?? ?? ??? [Start : End : Step] ??? ????? ??? ???? ????. 1. ?? ????? ?? ??? ?? [start : end : step]???. ??? ?? ??? (??), ?? ? ??? (???? ??)?? ??? ?? ?????. 2. ????? ???? 0?? ????? ???? ????? ??? ??? ???? ????? ??? 1? ??????. 3. my_list [: n]? ???? ? ?? n ??? ?? my_list [-n :]? ???? ??? n ??? ????. 4. My_List [:: 2]? ?? ??? ?? ?? ??? ???? ??? ??? ?? ?? ?? ??? ???? ? ????. 5. ???? ???? ? ???? ???? ????

Python? DateTime ??? ?? ?? ? ?? ?? ?? ??? ?? ? ? ????. 1. DateTime.now ()? ?? ?? ??? ??? ?? ? ??? ?? .date () ? .time ()? ?? ? ? ????. 2. DateTime (? = 2025, ? = 12, ? = 25, ?? = 18, ? = 30)? ?? ?? ?? ? ?? ??? ???? ?? ? ? ????. 3. .strftime ()? ???? ???? ???? ??????. ???? ??? %y, %m, %d, %h, %m ? %s; strptime ()? ???? ???? datetime ??? ?? ??????. 4. ?? ??? Timedelta? ??????

???? Python ?? ?? ?????? ?? ????, "??? ?????, ?? ??"? ???? ??? ??? ??? ?? ??? ?????. 1. ???? ?? ? ??? ?? ?????. ?? ???? ?? ??? ???? ??? ? ? ????. ?? ??, Spoke () ?? ???? ??? ??? ?? ??? ?? ????? ?? ??? ??? ????. 2. ???? ?? ???? ??? ??? ?????? Draw () ???? ???? ????? ?? ???? ?? ??? ???? ??? ???? ?? ?? ?? ??? ????? ?? ?? ????? ?? ?????. 3. Python ?? ???? ???????. ?? ???? ??? ???? ?? ???? ??? ????? ??? ?? ???? ??? ???? ????. ??? ??? ??? ???? ? ??? "?? ??"??????. 4. ???? ? ???? ?? ??? ?????

"?????, ??!" ????? Python?? ??? ?? ???? ????.? ?? ?? ??? ???? ?? ??? ???? ???? ??? ???? ? ?????. 1. ?? ?? ?? ( "Hello, World!")? ?? ????, ?? ? ??? ???? ???? ?????. 2. ?? ???? Python ??, ??? ???? ?? ?? ??, .py ??? ??, ????? ??? ???? ?? ?????. 3. ???? ???? ?? ? ?? ? ???, ?? ?? ??, .py ???? ???? ?? ?? ?? ??? ?????. 4. ?? ???? ?? ??? ??? ???, ??? ??? (? : Replit.com)? ?????.

tuplesinpytonarimmutabledartructureSedtostoreCollectionsofitems, wherelistsaremutable.tuplesAredefinedwithparenthesandcommas, supportIndexing, andcannotbemodifiedaftercreation, magememfasterandmoremoremory- ??? ?? .usetuplesfordatain

??? ???? ????? Python? Random ? String ?? ??? ??? ? ????. ?? ??? ??? ????. 1. ?? ? ??? ?? ?? ??; 2. String.ascii_letters ? String.Digits? ?? ?? ?? ?????. 3. ??? ??? ??????. 4. random.choices ()? ???? ???? ?????. ?? ??, ???? importrandom ? importString, set length = 10, arribution = string.ascii_letters.digits and execute '.join (random.c
