R&D
CENTER

Aligning parts that are not round — moments and principal axes

Training is more stable when every part faces the same way, round or not. How first-, second- and third-order moments give position, orientation and front/back.

Image Processing Tool v1.6.1 adds Shape (PCA) alignment. The existing Ring method assumes round products, so parts with arbitrary shapes, such as seatbelt buckles, could not be oriented.

Orientation in three steps

  1. Position — the centroid from the first-order image moments gives the part's center.
  2. Direction — second-order moments give the principal axis, the direction in which the part is longest.
  3. Front and back — the principal axis leaves a 180° ambiguity. Third-order moments (skewness) pick the heavier side as the front.

Even left-right symmetric parts resolve to a single orientation thanks to asymmetric features such as tabs.

Configuration

[aligner]
method = shape
shape_axis = auto      ; auto | major | minor
open_ksize = 5         ; despeckle (morphological open) kernel
target_x = 0.5         ; center after alignment (0.5, 0.5 = middle)
target_y = 0.5

Validation

All 13 seatbelt buckle images were aligned tab-up, with a mean center error of about 1.7 px. The same alignment settings are reused as-is by Multi-Inspector's yolo_align mode.