Hello, Erop, you wrote: E> Hello, rg45, you wrote: R>> As I understood, the task of recognition of orientation is not put at all." Did not depend on square orientation "means that the image should not change from picture turn on 90 degrees. Is not present unless? E> Is not present, roughly speaking, it is necessary to write the program to which you give numbers m> 0 and N> 0 and it prints square NxN or says that m is too great E> And the second to which you give square NxN turned on an unknown corner (from 0, 90, 180, 270), and it prints m E> thus it is necessary that the program would reject as it is possible big m. E> Well also ask not the program, and dependence maximum possible m from N a square there is no selected orientation, . it is symmetric. Means the square is necessary not. For example: one pixel in left upper to a corner is done black, pixels round it always white and are not used for record, is similar on remaining corners white not used fields 2 on . Because of black pixel of symmetry is not present and it is possible to recognize orientation. P.S. Optimal it to use not a square, and for example a square-topped triangle. Generally, it is necessary to note, the problem of search of a qr-code not where does not disappear. Suddenly almost all pixels will be white how then to recognize qr-code boundaries? Without special labels here as and if there are labels it is possible to learn and orientation.