📌 Bu proje hem Türkçe hem İngilizce açıklamalar içermektedir.
📌 This project includes both Turkish and English explanations.
This repository organizes various image processing projects developed using Python and OpenCV by topic. Each file includes sample code with both Turkish and English explanations.
Bu depo, Python ve OpenCV kullanılarak geliştirilen çeşitli görüntü işleme uygulamalarını konu başlıklarına göre sıralar. Her bir dosya, örnek kodlarla birlikte hem Türkçe hem İngilizce açıklamalar içerir.
Kategori / Category | Dosya / File | Açıklama / Description |
---|---|---|
📌 Giriş / Intro | 01_template_intro.py |
Şablon dosya yapısı Template project structure |
🟩 Piksel İşlemleri / Pixel Ops | 02_basic_pixel_operations.py |
Piksel erişimi, kanal ayırma Pixel access, channel ops |
✂️ Kırpma / Cropping | 03_cropping_extract_patch.py |
ROI seçimi, yama çıkarma ROI selection and patch extraction |
⚫ Gri Tonlama / Grayscale | 04_grayscale_channel_operations.py |
Gri ton dönüşümü Grayscale conversion |
🎨 Renk Kanalları / Color Filters | 05_color_channel_filters.py |
Kanal bazlı filtreleme Channel-wise filtering |
🌫️ Bulanıklaştırma / Blurring | 06_blurring_filters_mean_median_gaussian.py |
Gürültü azaltma filtreleri Denoising filters |
⛔ Kenar Uzatma / Border Extension | 07_border_extension_operations.py |
Kenar oluşturma yöntemleri Border types and padding |
🖍️ Çizim / Drawing | 08_shape_and_text_drawing.py |
Şekil ve metin çizme Drawing shapes and text |
➕ Görüntü Aritmetiği / Arithmetic | 09_image_arithmetic_operations.py |
Görüntü toplama, çıkarma vs. Addition, subtraction etc. |
🔍 Yeniden Boyutlandırma / Resize | 10_image_resizing_scaling.py |
Ölçekleme ve yeniden boyutlandırma Scaling and resizing |
🧱 Görüntü Piramitleri / Pyramids | 11_image_pyramids.py |
Gaussian ve Laplacian piramitleri Gaussian & Laplacian pyramids |
🔧 Morfoloji / Morphology | 12_morphological_operations.py |
Erozyon, genişleme, açma-kapama Erosion, dilation, opening-closing |
🔄 Döndürme / Rotation | 13_image_rotation.py |
Açılı döndürme Angle-based rotation |
🎥 Kamera İşlemleri / Camera Input | 15_camera_frame_capture_video_operations.py |
Kamera görüntüsü alma Capturing from camera |
💾 Kayıt / Recording | 16_camera_video_recording.py |
Kamera ile video kaydı Recording video from camera |
⚖️ Eşikleme / Thresholding | 17_thresholding_basic_methods.py |
Sabit ve uyarlanabilir eşikleme Static and adaptive thresholding |
🔪 Kenar Algılama / Edge Detection | 18_canny_edge_detection.py |
Canny algoritması ile kenar bulma Canny edge detection |
🔄 Liste zamanla güncellenecektir.
🔄 This list will be updated over time.
Reference for frequently used OpenCV functions
Sık kullanılan OpenCV fonksiyonları için başvuru kılavuzu
Reference for frequently used Numpy functions
Sık kullanılan Numpy fonksiyonları için başvuru kılavuzu
- Gerekli kütüphaneleri yükleyin / Install required packages:
pip install opencv-python numpy matplotlib
This repo is under active development. Contributions and feedback are welcome.
Bu repo aktif olarak geliştirilmektedir. Geri bildirim ve katkılarınızı beklerim.
# Load an image
image = cv2.imread("path/to/image.jpg")
# Display the image
cv2.imshow("Image", image)
cv2.waitKey(0)
cv2.destroyAllWindows()
📌 Continued below
📌 Aşağıda devam ediyor
🔽 Daha fazlası için tıklayın / Click for more
# Get image properties
height, width, channels = image.shape
# Access pixel values
pixel = image[100, 200]
# Modify pixel values
image[100, 200] = [255, 0, 0]
# Resize image to fixed size
resized = cv2.resize(image, (300, 300))
# Double size using pyramids
bigger = cv2.pyrUp(image)
# Half size using pyramids
smaller = cv2.pyrDown(image)
# Convert to grayscale
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Apply Gaussian Blur
blurred = cv2.GaussianBlur(image, (5, 5), 0)
# Apply Mean Blur
mean_blur = cv2.blur(image, (5,5))
# Apply Median Blur
median_blur = cv2.medianBlur(image, 5)
# Add border to image
border = cv2.copyMakeBorder(image, 10, 10, 10, 10, cv2.BORDER_CONSTANT, value=(0, 0, 0))
# Draw rectangle
cv2.rectangle(image, (50, 50), (150, 150), (0, 255, 0), 2)
# Draw circle
cv2.circle(image, (100, 100), 50, (255, 0, 0), 3)
# Write text
cv2.putText(image, "OpenCV", (100, 200), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2)
# Add two images
added = cv2.add(image1, image2)
# Weighted addition
weighted = cv2.addWeighted(image1, 0.7, image2, 0.3, 0)
kernel = np.ones((5,5), np.uint8)
# Dilation
dilated = cv2.dilate(image, kernel, iterations=1)
# Erosion
eroded = cv2.erode(image, kernel, iterations=1)
# Opening
opening = cv2.morphologyEx(image, cv2.MORPH_OPEN, kernel)
# Closing
closing = cv2.morphologyEx(image, cv2.MORPH_CLOSE, kernel)
# Simple Thresholding
ret, binary = cv2.threshold(gray, 128, 255, cv2.THRESH_BINARY)
# Adaptive Thresholding (Mean)
adaptive_mean = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C,
cv2.THRESH_BINARY, 11, 2)
# Adaptive Thresholding (Gaussian)
adaptive_gaussian = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C,
cv2.THRESH_BINARY, 11, 2)
# Otsu Thresholding
ret, otsu = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
# Apply Canny Edge Detection
edges = cv2.Canny(blurred, 50, 150)
# Auto Canny
def auto_canny(image, sigma=0.33):
median = np.median(image)
lower = int(max(0, (1.0 - sigma) * median))
upper = int(min(255, (1.0 + sigma) * median))
return cv2.Canny(image, lower, upper)
edges_auto = auto_canny(blurred)
camera = cv2.VideoCapture(0)
while True:
ret, frame = camera.read()
cv2.imshow("Camera Frame", frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
camera.release()
cv2.destroyAllWindows()
fourcc = cv2.VideoWriter_fourcc(*"mp4v")
out = cv2.VideoWriter("output.mp4", fourcc, 20.0, (width, height))
while True:
ret, frame = camera.read()
out.write(frame)
cv2.imshow("Recording", frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
camera.release()
out.release()
cv2.destroyAllWindows()
Please for more sample look for repos project Lütfen daha fazla örnek için projelere bakın