Algorithm to detect blue rock