A squaring machine intended for slab-shaped elements comprising: - a frame defining a horizontal resting and moving plane which comprises a moving group to advance the slab-shaped elements supported by the moving plane along a predetermined feed direction parallel opposite surface (T1 or T2) to be rectified of the slab-shaped elements; - two groups of abrasive tools, wherein each of said groups of abrasive tools is configured to rectify one of the two opposite surface (T1 or T2) of the slab-shaped element and comprises a plurality of abrasive tools supported by the frame and each abrasive tool being individually movable, following a travel path orthogonal to the feed direction, between a distal position from the slab-shaped element supported by the moving plane and a proximal position, wherein the abrasive tool is adapted to come into contact with the respective surface (T1 or T2) of the slab-shaped element; - a plurality of optical groups, one for each abrasive tool, individually secured to the frame, wherein each optical group is arranged in proximity to a respective abrasive tool so that at least one portion of the respective abrasive tool along at least one segment of the travel path thereof is arranged inside a visual field of the respective optical group, and - a plurality of reference bodies, wherein each reference body is secured to the frame, is arranged along the travel path of a respective abrasive tool and within a visual field of the respective optical group, such that at least one portion of each abrasive tool is adapted to be interposed between the respective optical group and the respective reference body during the movement of the abrasive tool along its travel path; characterized in that each optical group is a video camera and/or a photographic camera configured to detect a respective image or sequence of images of the respective optical field, wherein at least one image includes a representation of at least one portion of the reference body and at least one portion of the abrasive tool; and the colour of each reference body is a different and contrasting colour for the optical group (25,45) with respect to the colour of the respective abrasive tool. - a frame defining a horizontal resting and moving plane which comprises a moving group to advance the slab-shaped elements supported by the moving plane along a predetermined feed direction parallel opposite surface (T1 or T2) to be rectified of the slab-shaped elements; - two groups of abrasive tools, wherein each of said groups of abrasive tools is configured to rectify one of the two opposite surface (T1 or T2) of the slab-shaped element and comprises a plurality of abrasive tools supported by the frame and each abrasive tool being individually movable, following a travel path orthogonal to the feed direction, between a distal position from the slab-shaped element supported by the moving plane and a proximal position, wherein the abrasive tool is adapted to come into contact with the respective surface (T1 or T2) of the slab-shaped element; - a plurality of optical groups, one for each abrasive tool, individually secured to the frame, wherein each optical group is arranged in proximity to a respective abrasive tool so that at least one portion of the respective abrasive tool along at least one segment of the travel path thereof is arranged inside a visual field of the respective optical group, and - a plurality of reference bodies, wherein each reference body is secured to the frame, is arranged along the travel path of a respective abrasive tool and within a visual field of the respective optical group, such that at least one portion of each abrasive tool is adapted to be interposed between the respective optical group and the respective reference body during the movement of the abrasive tool along its travel path; characterized in that each optical group is a video camera and/or a photographic camera configured to detect a respective image or sequence of images of the respective optical field, wherein at least one image includes a representation of at least one portion of the reference body and at least one portion of the abrasive tool; and the colour of each reference body is a different and contrasting colour for the optical group (25,45) with respect to the colour of the respective abrasive tool. characterized in that each optical group is a video camera and/or a photographic camera configured to detect a respective image or sequence of images of the respective optical field, wherein at least one image includes a representation of at least one portion of the reference body and at least one portion of the abrasive tool; and the colour of each reference body is a different and contrasting colour for the optical group (25,45) with respect to the colour of the respective abrasive tool.