Crops and weeds are involved in a continuous competition for equal resources, which may result in a potential decrease in crop yields by up to 31% and an increase in the costs of agricultural inputs by up to 22% of cultivation. Weeds further impact crop production, and their detection is crucial for effective crop management. In this research, we targeted common weeds of cotton field, specifically i) Digitaria sanguinalis (L.) Scop, ii) Amaranthus retroflexus L., iii) Acalypha australis, L., iv) Cephalanoplos segetum, and v) Chenopodium album L. Additionally, image processing techniques such as grayscale conversion, binarization, and Gaussian and morphological filters were also utilized. These methods are based on machine vision and facilitate rapid and straightforward weed detection by segmenting, scrutinizing, and comparing input images. The plant height and area were obtained during cotton planting within 32 days and fitted to develop the growth law concerning planting days for achieving the function of distinguishing cotton from weeds. We conducted recognition experiments by dividing images into four quadrants and categorizing weeds as either inter-row or intra-row. Meanwhile, the inter-row planting information was used to identify weeds, and the leaf pixel area and circularity were used as the identification methods for intra-row weeds, which reduced the algorithm's running time and improved real-time performance. The experimental results indicated that the inter-row weed recognition rate was 89.4%, with an average processing time of 102ms. Whereas in the case of intra-row weeds, the recognition rate was measured at 84.6%, and the overall recognition rate for cotton was 85.0%, with a mean time consumption of 437ms. Furthermore, the present research underscores recent advancements such as machine vision and high-resolution imaging, which have significantly improved the accuracy of automated weed identification in cotton fields while acknowledging ongoing challenges and outlining future opportunities. By Integrating state-of-the-art technology with sustainable agricultural practices, implementing an intelligent system offers a viable approach toward efficient and environmentally friendly weed management in modern agriculture.