Natural or engineering rock joints often contains different kinds of infilling materials, such as clay, sand, or cement, which may significantly affect the crack initiation, propagation, and coalescence between joints. The cracking behaviours of the jointed rock masses have not been widely studied quantitatively, especially for the crack mechanism identification. Most previous studies identified the crack mechanisms, i.e. mode I, mode II, and mixed-mode, by visual inspection of the relative opening or sliding displacement across the cracks or the roughness of the newly formed fracture surfaces, while a quantitative method has not been developed to avoid being subjective. Thus, a novel DIC-based method is proposed for quantitatively identifying the crack path and fracture mechanism of the initiated cracks in rocks. The method involves three steps, including initial displacement measurement, displacement reconstruction around the discontinuity, and crack identification and displacement jump measurement. The key challenge of the proposed method lies in the displacement reconstruction at the discontinuity with the modified subset splitting technique, whose validity is verified by the computer experiments on synthetic images. With the novel DIC-based method, the cracking behaviors of flawed marble specimens considering different flaw geometries and infilling conditions are quantitatively studied. The experimental result indicates that the crack initiation, propagation, and coalescence of flawed marble specimens are closely related to infilling conditions. The mixed-mode cracks are more likely to initiate from cement-filled and resin-filled flaws, while mode I crack is prone to initiate from unfilled and gypsum-filled flaws. Besides, the infilling significantly alters the coalescence patterns at β=45°, while it plays a little role in crack coalescence at β=30° and 60°, mainly controlled by flaw geometry.