Wheat impurity content is one of the crucial indicators for evaluating wheat quality grades and prices, serving as an essential inspection parameter for grain storage. Due to the substantial intra-class variations in the aspect ratios of wheat impurities, traditional object detection algorithms fail to consider the diverse shapes and sizes of wheat impurities in real-world scenarios, resulting in low detection accuracy and missed detections. To address those issues, a YOLOv5-based wheat impurity automatic detection method, named Ro-YOLOv5, is proposed for computed tomography (CT) images of wheat samples. This method introduces rotated detection boxes and Circular Smooth Label (CSL) to transform angle regression predictions into angle classification predictions, effectively resolving issues related to angle periodicity and boundary exchange in regression; Additionally, the GIOU loss function in YOLOv5 is replaced with the CIOU loss function, which is more suitable for wheat impurity targets, ensuring the lower loss values and stable boundary regression. When creating the impurity-containing wheat dataset, a hybrid filtering method is introduced for leveraging the damping characteristics of the S-L filter for suppressing high-frequency components in projection images, thereby mitigating oscillation phenomena; Moreover, the Blackman filter is employed for image sharpening to preserve more image detail components. Experiments results have shown that the proposed algorithm achieves a mean average precision of 88.83% on the self-made dataset, representing a 7.56% improvement over the original YOLOv5 baseline network. The average detection time is 11.6ms, meeting the performance requirements for detecting wheat impurities.