Timely and accurate acquisition of crop planting areas and spatial distribution are deemed essential for grasping food configurations and guiding agricultural production. Despite the increasing research on crop mapping and changes with the development of remote sensing technology, most studies have focused on large-scale regions, with limited research being conducted in fragmented and ecologically vulnerable valley areas. To this end, this study utilized Landsat ETM+/OLI images as the data source to extract additional features, including vegetation index, terrain, and texture. We employed the Random Forest Recursive Feature Elimination (RF_RFE) algorithm for feature selection and evaluated the effectiveness of three machine learning algorithms—Support Vector Machine (SVM), Random Forest (RF), and Rotation Forest (ROF)—for crop extraction. Then, based on the optimal classifiers, the main crops in the Huangshui basin for the years of 2002, 2014, and 2022 were extracted. Finally, the transfer matrix, the gravity center model, and the Standard Deviation Ellipse (SDE) model were used to analyze the spatio—temporal changes of crops over the past 20 years in the Huangshui basin. The results showed that the spectral, vegetation index, and terrain features played a crucial role in crop extraction. Comparing the performance of the classifiers, the ROF algorithm displayed superior effectiveness in crop identification. The overall accuracy of crop extraction was above 86.97%, and the kappa coefficient was above 0.824. Notably, between 2002 and 2022, significant shifts in crop distribution within the Huangshui basin were observed. The highland barley experienced a net increase in planting area at a rate of 8.34 km2/year, while the spring wheat and oilseed rape demonstrated net decreases at rates of 16.02 km2/year and 14.28 km2/year, respectively. Furthermore, the study revealed that highland barley exhibited the most substantial movement, primarily expanding towards the southeast direction.