It is the key technology on the automation of fully mechanized caving mining to distinguish between the coal and rock automatically. According to the gray histogram the differences between rock and coal, this paper establishes the CCD sensor digital processing system based on S3C2440A+CPLD platform. It can achieve identification between coal and rock through medium filtering the discrete pulse noise of image by using ARM9 and observing gray histogram obtaibed by caculating. The result obtained by MATLAB simulating is more ideal and pratical in coal industry.