To effectively and precisely drive industrial cameras to photograph and then sort long bamboo battens, a surface-defect and color detection device and a sorting device are designed. Further, a sectionalized photography program and sorting program design is proposed. The overall machine employs STM32 as the core master controller, which is connected to the relay drive plate, the photoelectric switch, the industrial camera, etc., for control, to photograph bamboo battens of different lengths in sections, and to sort six types of bamboo batten according to the bamboo-batten category signal sent by the upper computer. Devices for improving bamboo-product processing system efficiency and enhancing the level of automation of modern agricultural products, such as the proposed design, are of considerable importance.