Bu proje, optik formlarda işaretlenen harflerden isim tanıma işlemini gerçekleştiren bir Python uygulamasıdır. OpenCV kütüphanesi kullanılarak geliştirilmiştir.
- Optik formda işaretlenen kutuların tespiti
- Türkçe alfabeye uygun harf tanıma
- Görsel debug desteği
- Adaptif eşikleme ile farklı ışık koşullarına uyum
- Gürültü temizleme ve görüntü ön işleme
pip install opencv-python
pip install numpy
- Projeyi klonlayın:
git clone [proje-url]
cd opticForm
- Gerekli kütüphaneleri yükleyin:
pip install -r requirements.txt
-
preprocess_image(img)
:- Görüntüyü gri tonlamaya çevirir
- Adaptif eşikleme uygular
- Gürültü temizleme işlemi yapar
-
find_checkboxes(thresh, min_area=15, max_area=200)
:- İşaretlenen kutuları tespit eder
- Alan bazlı filtreleme yapar
- Kenar payı ekler
-
group_checkboxes_by_row(checkboxes, row_threshold=15)
:- Tespit edilen kutuları satırlara göre gruplar
- Dikey pozisyona göre sıralama yapar
-
recognize_ad_soyad_final(image_path)
:- Ana tanıma fonksiyonu
- ROI (İlgi Alanı) seçimi
- Karakter tanıma ve görselleştirme
min_area
: Minimum kutu alanı (varsayılan: 15 piksel)max_area
: Maksimum kutu alanı (varsayılan: 200 piksel)row_threshold
: Satır gruplama eşiği (varsayılan: 15 piksel)- ROI koordinatları: x=38, y=183, w=280, h=352
Program çalışırken iki pencere gösterir:
- Debug penceresi: Tespit edilen kutuları yeşil çerçevelerle gösterir
- Sonuç penceresi: Tanınan karakterleri kırmızı renkle gösterir
Program aşağıdaki Türkçe karakterleri destekler:
['A', 'B', 'C', 'Ç', 'D', 'E', 'F', 'G', 'Ğ', 'H',
'I', 'İ', 'J', 'K', 'L', 'M', 'N', 'O', 'Ö', 'P',
'R', 'S', 'Ş', 'T', 'U', 'Ü', 'V', 'Y', 'Z']
Eğer program istenilen sonucu vermiyorsa:
- Eşik değerlerini ayarlayın (
min_area
,max_area
) - ROI koordinatlarını kontrol edin
- Debug penceresinden kutu tespitini gözlemleyin
- Fork edin
- Feature branch oluşturun (
git checkout -b feature/amazing-feature
) - Değişikliklerinizi commit edin (
git commit -m 'Add some amazing feature'
) - Branch'inizi push edin (
git push origin feature/amazing-feature
) - Pull Request oluşturun
Bu proje MIT lisansı altında lisanslanmıştır. Detaylar için LICENSE
dosyasına bakın.
Muhammed Aydın - GitHub
This project is a Python application that performs name recognition from marked letters on optical forms. It is developed using the OpenCV library.
- Detection of marked boxes on optical forms
- Turkish alphabet-compatible character recognition
- Visual debug support
- Adaptive thresholding for different lighting conditions
- Noise removal and image preprocessing
pip install opencv-python
pip install numpy
- Clone the project:
git clone [project-url]
cd opticForm
- Install required libraries:
pip install -r requirements.txt
-
preprocess_image(img)
:- Converts image to grayscale
- Applies adaptive thresholding
- Performs noise removal
-
find_checkboxes(thresh, min_area=15, max_area=200)
:- Detects marked boxes
- Performs area-based filtering
- Adds margin to boxes
-
group_checkboxes_by_row(checkboxes, row_threshold=15)
:- Groups detected boxes by rows
- Sorts by vertical position
-
recognize_ad_soyad_final(image_path)
:- Main recognition function
- ROI (Region of Interest) selection
- Character recognition and visualization
min_area
: Minimum box area (default: 15 pixels)max_area
: Maximum box area (default: 200 pixels)row_threshold
: Row grouping threshold (default: 15 pixels)- ROI coordinates: x=38, y=183, w=280, h=352
The program shows two windows while running:
- Debug window: Shows detected boxes with green frames
- Result window: Shows recognized characters in red
The program supports the following Turkish characters:
['A', 'B', 'C', 'Ç', 'D', 'E', 'F', 'G', 'Ğ', 'H',
'I', 'İ', 'J', 'K', 'L', 'M', 'N', 'O', 'Ö', 'P',
'R', 'S', 'Ş', 'T', 'U', 'Ü', 'V', 'Y', 'Z']
If the program is not giving the desired results:
- Adjust threshold values (
min_area
,max_area
) - Check ROI coordinates
- Observe box detection in the debug window
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Muhammed Aydın - GitHub