The invention relates to a method and an arrangement for measuring the geometry of grooves in an elongated element, which grooves extend as continuous grooves over the whole length of the elongated element, circling around the element, in which method the surface of the elongated element is scanned by of a camera. In the present invention, the detection framework can use only one single boosted cascade to determine the status and position of the object inside the image data. The frame may be designed to at least partially encompass a biplate when mounted in a bipolar battery, and include a device or way to permit gas passage through the gasket. The guiding system can comprise, for example, a global positioning system for determining the instantaneous positions of the vehicle and an automatic steering system for steering the vehicle based on positioning information from global positioning.