In the complex real world, with the application and popularization of the intelligent systems and information platforms, complex image recognition and segmentation need to be paid attention to. Therefore, this paper studies the realization of Halcon image segmentation algorithm in machine vision for complex scenarios. Firstly, the image complexity is analyzed. The core reason for firstly analyzing the image complex modelling is that for different images with the segmentation task, the training sets are different. Through the classification of the image complexity, different training and experimental sets can be targeted for performing the real-time tasks, and then, a novel complexity level model is defined. Then, a 2-step segmentation algorithm is proposed. For the simple and complex images, the segmentation models are different to make the comprehensive model efficient. For the complex image, the Selection of Cluster Number algorithm is applied. The proposed experiment compares the proposed model with the FCM, KFCM and SVM and the results have shown that the designed model is efficient considering different factors.