An automatic image based technique for rock mass characterization