International Science and Technology Journal

Home < Articles < Article Details

Automated ID Photo Standardization via Hybrid Segmentation and Face Detection: Design and Implementation of a Python-Based GUI Tool

الملخص
عادةً ما يتطلب إنتاج الصور الفوتوغرافية الرسمية للهوية التزاماً صارماً بمعايير الأبعاد والخلفية وموضع الوجه، وهي عملية لا تزال يدوية إلى حد كبير، وتستغرق وقتاً طويلاً، وتكثر فيها الأخطاء. تعرض هذه الورقة العلمية نظاماً آلياً قائماً على الحواسيب المكتبية لتوحيد معايير الصور الشخصية الرسمية، يدمج بين التقسيم الهجين للخلفية والمحاذاة الموجهة بالوجه لإنتاج صور مطابقة للمواصفات. يجمع المسار المقترح بين تقنيات الرؤية الحاسوبية التقليدية (GrabCut) وكشف العناصر البارزة القائم على التعلم العميق (U²-Net/نماذج rembg المختلفة)، مما يتيح استخراجاً قوياً للعناصر الأمامية عبر ظروف الإضاءة والخلفيات المعقدة المتنوعة. وتقود وحدة كشف الوجه المعتمدة على dlib/OpenCV عملية توسيط الوجه تلقائياً وتهيئة المنطقة، بينما تضمن الأقنعة التكيفية للأشكال (دائرية، بيضاوية، مستطيلة مستديرة الزوايا) والتركيب الشفاف (Alpha Compositing) دقة عرض الحواف واستبدال الخلفية. تم تنفيذ النظام على هيئة واجهة مستخدم رسومية (Tkinter) آمنة للتعامل مع تعدد المهام (thread-safe) ومتعددة المنصات، وتتميز بمعاينة فورية، ومعالجة مجمعة للدفعات، ومرشحات تحسين قابلة للتكوين، وتسجيل شامل للوقائع مع طوابع زمنية. يُظهر التقييم التجريبي انخفاضاً كبيراً في زمن المعالجة اليدوية مع الحفاظ على معدلات امتثال عالية لمواصفات صور جوازات السفر والتأشيرات الدولية. عبر دمج معالجة الصور التقليدية مع التقسيم العصري القائم على الذكاء الاصطناعي في إطار عمل مكتبي ميسور، تقدم هذه الأداة حلاً قابلاً للتطوير وجاهزاً للإنتاج من أجل توليد الصور الشخصية الرسمية آلياً. بعد التحقق عبر أكثر من 500 صورة، حقق النظام نسبة امتثال بلغت 97.3% لمعايير منظمة الطيران المدني الدولي (ICAO) في ظروف متنوعة، وأظهر قابلية عالية ومستدامة للتوسع في الإنتاجية، كما حقق درجة 83/100 في استبيان قابلية استخدام النظام (SUS) في تجارب المستخدمين.................. الكلمات المفتاحية: ............توحيد معايير الصور الشخصية، تقسيم الخلفية، U²-Net، GrabCut، كشف الوجه، واجهة المستخدم الرسومية Tkinter، الرؤية الحاسوبية، معالجة الصور الآلية، التركيب الشفاف (Alpha Compositing)، المعالجة المجمعة.
Abstract
Generating official identification photographs typically requires strict compliance with dimensional, background, and facial positioning standards, a process that remains largely manual, time-consuming, and error-prone. This paper presents an automated, desktop-based ID photo standardization system that integrates hybrid background segmentation with face-guided alignment to produce compliant identification images. The proposed pipeline combines traditional computer vision techniques (GrabCut) with deep learning-based salient object detection (U²-Net/rembg variants), enabling robust foreground extraction across diverse lighting and complex backgrounds. A dlib/OpenCV face detection module drives automatic face centering and region initialization, while adaptive shape masking (circular, oval, rounded rectangular) and alpha compositing ensure precise edge rendering and background replacement. The system is implemented as a cross-platform, thread-safe Tkinter GUI featuring real-time preview, batch processing, configurable enhancement filters, and comprehensive timestamped logging. Experimental evaluation demonstrates significant reductions in manual processing time while maintaining high compliance rates with international passport and visa photo specifications. By bridging traditional image processing with modern AI-driven segmentation in an accessible desktop framework, this tool provides a scalable, production-ready solution for automated ID photo generation. Validated across 500+ images, the system achieves 97.3% ICAO compliance under diverse conditions, demonstrates sustained high-throughput scalability, and attained an SUS score of 83/100 in usability trials........... Keywords:............ ID Photo Standardization, Background Segmentation, U²-Net, GrabCut, Face Detection, Tkinter GUI, Computer Vision, Automated Image Processing, Alpha Compositing, Batch Processing.