  Active regions (ARs) are the main sources of variety in solar dynamic events.
Automated detection and identification tools need to be developed for solar
features for a deeper understanding of the solar cycle. Of particular interest
here are the dynamical properties of the ARs, regardless of their internal
structure and sunspot distribution. We studied the oscillatory dynamics of two
ARs: NOAA 11327 and NOAA 11726 using two different methods of pattern
recognition. We developed a novel method of automated AR border detection and
compared it to an existing method for the proof-of-concept. The first method
uses least-squares fitting on the smallest ellipse enclosing the AR, while the
second method applies regression on the convex hull.} After processing the
data, we found that the axes and the inclination angle of the ellipse and the
convex hull oscillate in time. These oscillations are interpreted as the second
harmonic of the standing long-period kink oscillations (with the node at the
apex) of the magnetic flux tube connecting the two main sunspots of the ARs. In
both ARs we have estimated the distribution of the phase speed magnitude along
the magnetic tubes (along the two main spots) by interpreting the obtained
oscillation of the inclination angle as the standing second harmonic kink mode.
After comparing the obtained results for fast and slow kink modes, we conclude
that both of these modes are good candidates to explain the observed
oscillations of the AR inclination angles, as in the high plasma $\beta$ regime
the phase speeds of these modes are comparable and on the order of the
Alfv\'{e}n speed. Based on the properties of the observed oscillations, we
detected the appropriate depth of the sunspot patterns, which coincides with
estimations made by helioseismic methods. The latter analysis can be used as a
basis for developing a magneto-seismological tool for ARs.
