Accurate mapping of winter wheat is essential for the advancement of precision agriculture and food security. However, classical semantic segmentation models frequently encounter difficulties in precise edge extraction, omission, and classification due to the presence of dense distributions and intra-class diversity. This study proposes a novel method for the extraction of winter wheat from remote sensing data using the GF-2 satellite. The method incorporates a multitask learning framework-Vision Transformer-based model (namely MCFormer) that combines semantic segmentation and boundary detection. Furthermore, the normalized difference vegetation index (NDVI) and land surface temperature (LST) derived from Landsat 8 images was included to enhance the representation of winter wheat's spectral characteristics. The method is evaluated in comparison to frequently used U-Net-, SegNet-, SegFormer-, and MANet-based winter wheat extraction methods in northern Anhui Province. The results indicate that the MCFormer-based method achieves the intersection over union (IoU), F1 score, recall, precision and overall accuracy (OA) of 0.9790, 0.9893, 0.9953, 0.9835, and 0.9900, respectively, outperforming the U-Net-, SegNet-, SegFormer-, and MANet-based methods. The incorporation of multitask learning with NDVI and LST data has been demonstrated to enhance several key performance metrics, including improvements in the IoU, F1 score, recall, precision and OA by 5.95%, 3.65%, 3.75%, 2.79%, and 2.24%, respectively. Our proposed approach improves the accuracy of winter wheat extraction from remote sensing images, which has the potential to facilitate precision agriculture and enhance food security.