A NEW IMAGE PROCESSING METHOD FOR IMPLEMENTATION OF WEED DETECTION

: The earliest essential method of human subsistence on Earth was agriculture. Weeds are one of the most crucial elements, and in the agricultural sector, weed classification and identification are crucial from a scientific and economical standpoint. In the past, weeds were still identified by physical force in the majority of the planet. Subsequently, several automated methods for weed detection emerged, although they were not very accurate. The most important agricultural technique for increasing crop output and lowering herbicide application costs is weed control. The limitations of current weed detection systems prevent them from producing improved outcomes. This study shows how effective an image-processing technique is for identifying weeds in crops. when it is possible to identify the weeds in the unordered harvest in addition to those that are present collectively. Additionally, by recognizing the weed in recorded video as well as by identifying proof of weed in crop with an image, we can identify the weed and guarantee that it is there in the harvest. When weeds are managed, farming can be kept current by supplying crucial and basic protocols in horticultural frameworks for the future and by distributing inputs precisely where they are required. It offers quick and simple ways to identify and manage weeds.


I. INTRODUCTION
The first form of human subsistence in globe was agriculture.80% of people in India are farmers.In 2012, 60.3% of the land was classified as agricultural.According to a recent survey by the national population commission, India has officially surpassed China in terms of population as the world's most populous nation as of 2023.This demonstrates how important agriculture is to us, yet agriculture statistics indicate a significant decline in agricultural cultivation, one of the reasons being weeds.In the agriculture sector, weed identification and categorization play a crucial technical and financial role.A plant that grows alongside beneficial agricultural goods is considered a weed.Any plant that affects farming may be referred to as a weed.Weeds compete with productive crops for water, sunlight, and space.They may also be poisonous and reduce agricultural productivity.The crop's plants can develop more effectively, provide good harvests, and the farmers will make money rather than lose it if the weeds are removed.Even the expense of purchasing fertilizer and other resources can be reduced by getting rid of weeds.To get rid of that weed, we must first locate in the field and, if feasible, determine where it is now growing.Weeds can compete with crops for nutrients, which can reduce productivity, but they can also affect crops because they can absorb nutrients from them.In particular, undesirable herbs growing in crops should be controlled to keep a balance because if control measures are not taken, around 60% of global agricultural output could be lost.Crop output should be raised while weed control expenses should be decreased to lessen the strain on the agricultural industry.The inability to precisely forecast weed yield impact early in the growing season makes weed management more challenging.Different threshold types have been used to manage insects and diseases, and these tools make decision-making easier.Competition for scarce resources is the main factor causing yield losses when weeds and crops coexist.The resources for which crops and weeds most frequently compete are light, water, and nutrients.The particular resource that causes production losses varies with the unique circumstance.Effective weed management methods reduce competition by reducing weed populations and giving the crop an advantage over weeds in acquiring resources.This paper describes the introduction in the first section and is later continued with the literature review, proposed method, experimental results, conclusion, and future work in other sections which gives a brief explanation of the project.

Ⅱ. LITERATURE REVIEW
Some of the related study's findings are shown in this section.By creating algorithms for segmentation, feature extraction, representation, and classification, many researchers were able to build the weed identification technique.The following is a summary of a few of the recent methods discussed in the papers: In [1] Author Bo Liu & Ryan Bruch has proposed that outlines the recent activities in this field over the past few years and gives an overall view on developing and well-liked weed identification approaches for spraying.Weed identification also contributes to the reduction or elimination of pesticide use, minimizing the negative effects of agriculture on the environment and human health, and enhancing sustainability.recent discoveries in creating new methods and rising computer capacity, profound learning-based methods are supplanted ordinary AI procedures to recognize weeds progressively.
In [2] author J. Irías Tejeda, R. Castro has proposed that the development of an image-processing algorithm to find weeds at a particular crop site was the main goal of the project.To eliminate all of the soil from the picture and lessen pointless data, the principal stage in picture handling is the recognition of green vegetation.The vegetation was thusly the principal center after division and the evacuation of unimportant information utilizing morphological and medium channels.
In [3] Author Aichen Wanga, Wen Zhangb, Xinhua,has proposed that this evaluation be written to highlight the improvements made in weed recognition utilizing ground-based machine vision and picture handling techniques.The four strategies for weed discovery, explicitly pre-handling, division, highlight extraction, and arrangement, were given top to bottom.Different variety records and arrangement strategies, for example, variety file based, edge based, and learning-based ones, were created to recognize vegetation from foundation.
In [4] Author Badrinarayanan.V., Kendall.A., Cipolla.R, has proposed that Semantic segmentation using SegNet, a deep convolutional network architecture.SegNet's primary driving force was the requirement to create an architecture that is both memory and computationally economical for analysing road and inside scene.To demonstrate the actual trade-offs involved in creating architectures for segmentation, specifically training time, memory versus accuracy, we examined SegNet and contrasted it with other significant versions.Performance is highest in designs that fully store the encoder network feature maps, but memory usage is higher during inference.SegNet, on the other hand, is more effective since, to achieve good performance, it just saves the feature maps' max-pooling indices.SegNet performs effectively on huge and wellknown datasets.
In [5] Authors Alotaibi, M., Mahmood, A., has proposed that by Using a biometric method called gait recognition, it is possible to identify people by their distinctive walking patterns.In this study, scientists created a deep CNN model with several layers specifically designed for recognizing human gait.The deep CNN's capacity to extract discriminative features and improve classification is an advantage, particularly if a sizable training dataset is available.empirically established the deep CNN's ideal gait design.
In [14] Authors Reddy, L. Uday Kumar, S. Rohitharun, and S. Sujana proposed that controlling weeds is a crucial and important task that can impact crop productivity.Fertilizers are crucial for controlling weeds, but their use is criticized since it is thought to be excessive and may be bad for the environment.The survey of weed and pest identification utilizing image processing in the agricultural area will be the main topic of this research.Selective Patch Spraying is not appropriate for most farms and makes use of remote sensing.Size, shape, texture, color, and location-based data are used in the machine vision-based technique to distinguish between weed crops and diseased leaves or plants.The classification accuracy ranges from 85% to 96% depending on the algorithms and image acquisition constraints.This strategy lowers costs while also preserving the environment.
In [15] Author Wu Lanlan proposed that this study is to demonstrate the use of the support vector machine (SVM) approach and image processing techniques for field-grown maize and weed seedlings.The initial preprocessing of the field-captured original photos uses spatial transform and image processing methods.The OTSU method is used to segment young corn or small weeds utilizing the H channel.We discovered that the H channel works better to lessen the effects of changing lighting.In the recognition process, four shape that were retrieved from the goal are utilized.We use back-propagation neural network classifiers and SVM to distinguish between individual weed and corn seedlings.The results of the experiments demonstrate that the SVM classifier has a greater classification impact.

A. Explanation of Proposed Model
In the past, workers were hired specifically for weed removal to detect weeds.They will inspect every plant field to find the weeds.Then they will manually remove them using their hands or spades.In the suggested system, image processing methods can be used to find weeds.The project's primary goal is to locate weedaffected areas for additional seeding.If weeds are not lawfully controlled promptly, they could destroy the life and nature of the produce.This idea's main goal is to cut down on the effort and time required to find and get rid of weeds.Deep learning can be utilized to examine recordings for data that isn't quickly noticeable outwardly or mathematically and use that information to distinguish things.Real-time object detection is also used.We will take into account Read picture, Grayscale image, Enhancement, Binarization, Area Thresholding, Area identification, and Weed detection throughout this process.Additionally, each crop is examined for its intensity of colour, the intensity of edge, the intensity of size, etc.After segmentation and edge detection, the colour of the crop and weed's edges and veins is white, while the rest of the image is entirely black.It has gone through the filtering procedure after going through the edge detection and colour segmentation processes.Every crop may be identified via the filtering procedure, which also allows for the determination of each crop's gain value, trade-offs, edge, frequency, and weed intensity.
Image Capture High-resolution cameras are used to capture images of weeds in agricultural fields or from web datasets for greater exactness in RGB design.Each obtained picture is saved in its suitable size and as a jpg record.
An image of a crop field that is captured using a webcam or a crop row that has been scanned serves as the system's input.A single crop row image can be the input, which needs to be filtered for image enhancement to remove noise like lighting, dirt backdrop, etc. Median, mean, and average filters are some of the filters that can be used on the input image.The input image is prepared for enhancement after pre-processing.An algorithm called "colour detection" is utilized to detect the pixels in a picture that will suit or be set to a particular colour range.Edge detection is a strategy for picture handling that finds the edges of items in an image.Weed edges are recognized in the drives.It works by searching for changes in splendor.Information extraction and picture division both require edge detection.Extraction of Features Weed location attributes is recovered after pre-handling.Component extraction is the process of describing a collection of highlights to successfully present the data for analysis and characterization.Size, shape, and variety-based features as well as surface viewpoints like entropy, energy, contrast, and so on are used to separate the attributes.After applying the modules that are even described below, the weeds are recognized in the input image.

Read Image:
Read image is the step is that where the detailed information of an image is taken into consideration and used to distinguish the weeds present in the yield.

Grayscale images:
The following are techniques using image processing to find weeds.firstly, picture acquisition For more accuracy in RGB design, high-resolution cameras are used to capture images of weeds in horticulture fields or from online sources.Each image that is obtained is stored as a jpg file at the appropriate size.Pre-processing Various elements, including noise, varying lighting, low image quality, and undesired backdrop, have an impact on the photos that are obtained.The conversion of RGB to grayscale, the conversion of grayscale photos to binary images, and the use of filtering techniques to eliminate background noise are all examples of pre-processing tools.Pictures in grayscale are monochrome, and that implies they just have one tone.There are a few dim levels not entirely settled by every pixel.A run-of-the-mill grayscale picture holds 8 bits of information for every pixel or 256 potential shades of grey.In a grayscale picture, every pixel in the computerized portrayal just conveys information about the brilliance of the light.Commonly, simply the differentiation between the most obscure dark and the lightest white is obvious in such pictures.All in all, the picture just utilizes the shades of grey found in dark, white, and grayscale.

Image enhancement:
Picture improvement is the strategy of upgrading the first information's quality and data content before handling.Advanced pictures are altered during the course of picture upgrade to give results that are more qualified for show or extra picture examination.The goal of image enhancement is to increase the apparent distinction between the scene's characteristics to make an image easier to visually perceive.There are numerous methods for raising the quality of images.After all geometric and radiometric aberrations have been removed, picture augmentation is tried.Plant leaves are typically green in color.Additionally, the hues and variety of changes in water, nutrients, climate, and season can change the color, making the reliability of the color feature low.Therefore, we decided to exclude color information and instead identify different plants using the grey-level image of a plant leaf.As a result, just the green component of each pixel in the color image is computed.

Image Binarization:
The most common way of transforming a report picture into a bi-level record picture is known as picture binarization.High-contrast pixels make up a double assortment of picture pixels.The noise in the photographs, also known as "image processing," prevents auto encoders from recognizing the images.We will apply a Binarization technique, which is frequently used with artificial intelligence, to reduce the background noise produced in photographs.Binarization is the technique of converting any entity's data characteristics into vectors of binary values to increase the performance of classifier algorithms.The most popular method for converting a picture's grayscale from a 0-255 range to a 0-1 range is binarization.

Area Thresholding:
Area Thresholding is a sort of picture division in which we change an image's pixel piece to work with the examination.Through the method involved with thresholding, we transform a variety of grayscale pictures into a paired picture or one that is just high contrast.The simplest technique for segmenting images is thresholding.Thresholding can also be used to produce binary pictures from a grayscale image.

Area:
The most vital phase in picture handling is the acknowledgment of green plants to wipe out all the soil from the image and reduction futile information.Then, by dividing and wiping out unessential data using medium and morphological channels, it zeroed in on the vegetation.disposing of trivial information from the image to take out the aggregate of the dirt.Then, at that point, by fragmenting and eliminating unimportant information utilizing medium and morphological channels, it focused on the vegetation.

C. Implementation:
Several photos can be taken to detect the weed.Edge detection and the color segmentation process will be into account during this process.After segmentation and edge detection, the color of the crop and weed's edges and veins is white, while the rest of the image is entirely black.It has gone through the filtering procedure after going through the edge detection and color segmentation processes.Every crop may be identified via the filtering procedure, which also allows for the determination of each crop's gain value, trade-offs, edge, frequency, and weed frequency.if the crop has a lower edge frequency than the weed.They have a high edge frequency then.This study takes into account a crop with thin leaves, whose edge frequency is lower than that of weeds.The edge frequency is determined using a photo of just the weed.The program calculates the number of edges by using a "for a loop."A single block containing the weed is analyzed and the number of edges is found to be 900 approximately.

Ⅳ. EXPERIMENTAL RESULTS :
When an image of a field containing both plants and weeds is captured, the project's experimental outcomes are shown.The image will then be processed using various techniques such as read image, greyscale image, image enhancement, image binarization, area thresholding, and area recognition of the specified algorithms in the software after being uploaded in Matlab.The presence of weeds in the image will be identified, and by running further code, we may even determine where in the image the weeds are spread out.Along with comprehensive pixel, edge detection, and other information.The loading of the image from the source, color segmentation, and edge detection process an image in preparation for more sophisticated processing.The technique used to distinguish the crop which also includes weed from the backdrop is called color segmentation.The technique aids in separating each color that can be seen from the others.We must convert the color-segmented image into a grayscale image to correctly detect edges.The image is prepared for filtering, in the following step, via techniques like color segmentation and edge detection.The filter in this case is used to identify areas where edges occur frequently within a certain range (weed frequency range).Here, is the image that was used as input for the edge detection stage above.Thresholding is a kind of picture division wherein we change an image's pixel synthesis to work with the examination.To change a variety or grayscale picture into a parallel picture during thresholding.So by following the implementation steps perfectly can obtain all the desired experimental result the image preview of the project are attached below with a neat explanation.The figures mentioned below will give a keen review of the output of the project.

Ⅴ. CONCLUSION :
This study covers the method and application for weed detection using Matlab software and image processing.Crop images can be assessed using methods such as read image, grayscale image, enhancement, binarization, area thresholding, area identification, and weed detection.The detection of cannabis also makes use of video footage.The right strategies must be chosen in order to make decision-making easier.Agricultural production scenarios have made extensive use of image processing technology.The limits of image acquisition and the resolution of the images used by the algorithms have distinct effects on classification accuracy.The employment of multiple efficient algorithms to enhance the weed detection procedure is the improvement over the prior paper.Additionally, with a few basic limitations, the plant in the video can also be identified.Early detection is key to controlling and eliminating weeds.If weeds are not legally controlled as soon as feasible, they could endanger the yields' life and natural state.The image processing technique is used to identify and eradicate weeds that are growing between the crops.The objective of creating such a system is to locate areas affected by weeds and use them for new seeding.In the future, if weeds are discovered in that specific area, the Herbicide Sprayer unit will be informed.This concept's main goal is to cut down on the time and effort required to find and eradicate weeds.

Fig 1 :
Fig 1: population census according to 2023The crop's plants can develop more effectively, provide good harvests, and the farmers will make money rather than lose it if the weeds are removed.Even the expense of purchasing fertilizer and other resources can be reduced by getting rid of weeds.The inability to precisely forecast weed yield impact early in the growing season makes weed management more challenging.Different threshold types have been used to manage insects and diseases, and these tools make decision-making easier.Competition for scarce resources is the main factor causing yield losses when weeds and crops coexist.The resources for which crops and weeds most frequently compete are light, water, and nutrients.

Fig 3 :
Fig 3: Block Diagram of the proposed method.

Fig 5 :
Fig 5: Base view after running code.

Fig 6 :
Fig 6: Selecting an image from test images.

Fig 14 :
Fig 14: weed detection in the crop.