The success of text recognition, when using machine vision, directly depends on the quality of the preliminary processing of the image, as a result of which the image? is obtained from the original image . At the stage of detecting text areas by methods of mathematical morphology in an image with laser engraving, the authors encountered a problem that arises when the label with text id (next label) is rotated in front of the image pickup device by an angle greater than 20o: the area containing the text is not detected. The article is devoted to the presentation of the methodology proposed by the authors to solve this problem. The Hough transformation, developed in 1962, is an excellent tool for finding straight lines in an image. The authors used this algorithm, finalizing a preliminary analysis of areas to find the angle of deviation of the label. The article provides a description of the technique for rotating the image of a label made by laser engraving on metal, as well as the results of testing the technique, proving its performance and effectiveness.