High-power laser installations which require complex beam transport systems under vacuum also require a method to accurately align the beam(s) remotely. The alignment precision depends on the accuracy of the beam measurements, and multiple solutions have been adopted in current laser installations. However, time constraints entail the implementation of automated alignment procedures using fast and accurate detection methods for a wide variety of capture types. The current paper proposes an adaptive template matching beam detection algorithm, implemented using Python and OpenCV, which has shown very good accuracy and performance. This is demonstrated using tests on sample captures from the Petawatt laser of the Center of Advanced Laser Technologies at the National Institute for Laser, Plasma and Radiation Physics.