Skip to content

Releases: cihanemres/eokul

V2.0.1

20 Mar 08:28
c78c7e2
Compare
Choose a tag to compare

This program processes student photos in a folder by detecting faces, centering them, cropping them, resizing them to 133x171 pixels, and saving them in an optimized JPEG format. Its main functions include:

Face Detection: Uses OpenCV’s haarcascade_frontalface_default.xml model to detect faces in photos.
Cropping with Face Centering: Crops the detected face area while slightly expanding the region to include the forehead and chin.
Resizing: Adjusts the image dimensions to 133x171 pixels.
File Size Optimization: Adjusts JPEG compression quality to ensure the file size stays between 15 KB and 150 KB.
Error Handling: Displays appropriate error messages if a file is not found or an unknown error occurs.

The program processes photos from the ogrenci_fotograflari (student_photos) folder and saves the output images in the kirpilmis_fotograflar (cropped_photos) folder.

Bu program, bir klasörde bulunan öğrenci fotoğraflarını işleyerek yüzleri merkeze alıp kırpar, boyutlarını 133x171 piksele ölçeklendirir ve optimize edilmiş JPEG formatında kaydeder. Programın temel işlevleri şunlardır:

Yüz Algılama: OpenCV'nin haarcascade_frontalface_default.xml modelini kullanarak fotoğraflardaki yüzleri algılar.
Yüzü Merkeze Alarak Kırpma: Algılanan yüzü çevreleyen bir bölgeyi genişleterek kırpar (baş ve çene alanlarını da içerecek şekilde).
Boyutlandırma: Fotoğrafı 133x171 piksel olacak şekilde yeniden boyutlandırır.
Dosya Boyutunu Optimize Etme: Fotoğrafın dosya boyutunu belirlenen sınırlar (15 KB - 150 KB) arasında tutmak için JPEG sıkıştırma kalitesini ayarlar.
Hata Yönetimi: Dosya bulunamazsa veya bilinmeyen bir hata oluşursa uygun hata mesajlarını gösterir.

Program, ogrenci_fotograflari klasöründeki fotoğrafları işler ve çıktıları kirpilmis_fotograflar klasörüne kaydeder.