HYBRID VERIFICATION OF TARGET POSITIONING IN A CAMERA FRAME USING YOLOV8 AND CONTOUR GEOMETRY
DOI:
https://doi.org/10.26577/jpcsit20540126Ключевые слова:
computer vision, object detection, YOLOv8, image segmentation, visual inspection, positioning verificationАннотация
Verifying that an object is correctly positioned in front of a camera is a routine prerequisite in measurement rigs and industrial inspection cells, yet it is still commonly performed by eye, which makes the acceptance criterion implicit and reveals positioning errors only after a whole series of frames has been acquired. This paper proposes a hybrid method that verifies three criteria from a single camera frame: centring of the object, absence of rotation relative to the frame axes, and full visibility within the field of view. The method deliberately divides responsibility between a learned and a deterministic component. Coarse localisation is performed by a lightweight YOLOv8n detector fine-tuned for a single class by transfer learning, while all metrologically meaningful quantities are computed inside the resulting region of interest by classical computer vision: colour segmentation in HSV space, morphological filtering, extraction of the largest external contour, and fitting of a minimum-area bounding rectangle. The training set of 439 frames was annotated programmatically by the very same segmentation module that runs at inference time, which removes manual annotation entirely and enforces a single operational definition of the object across training and deployment. Angular deviation is computed as the distance to the nearest multiple of ninety degrees, which analytically removes the orientation ambiguity inherent in minimum-area rectangle fitting without any additional heuristics or learned parameters. On the validation subset the detector attains a precision of about 0.999, a recall of 1.000, a mAP50 of about 0.995 and a mAP50-95 of about 0.89, indicating that detection is not the accuracy-limiting stage. Decision thresholds were calibrated against the empirical spread of deviations observed over a reference set of correct placements.





