Block geometry is commonly the most important feature determining the behaviour of a rock mass and directly controls the structural instability in underground openings or surface cuttings. Various methods are used to estimate block geometry and to perform a block survey, and these are standardly divided into empirical-based methods (e.g. spot mapping, linear mapping, areal mapping) and computer-based methods (e.g. laser scanning, image processing, digital image mapping). Empirical approaches are associated with effective features as well as with a number of errors; however, the latter can be covered by artificial intelligence (AI) techniques. The combination of image processing and areal mapping have led to geometric block estimation in two-dimensional (2D) and three-dimensional (3D) spaces; these approaches can be widely used in stability analysis, dimension stone extraction, excavations, open pit mining design and the delineation of blasting patterns for dimension stone extraction. Therefore, the application of an approach that allows both the modelling and production of rock blocks based on their actual status with qualified accuracy and speed are both worthwhile and necessary. In this study, to estimate the shape and block dimension utilized, we used the algorithm based on the AI image processing technique for rock mass structural detection and for rock block definition in 2D and 3D space obtained with the Mathematica software package. The algorithm, by categorizing the discontinuities in two groups (opened and closed), which represents the main and the secondary discontinuities, can identify the emplacement and shape of rock blocks.