Corn ear damage detection method based on embedded and image processing
Through the embedded and image processing method, the damaged areas in the corn ear image are extracted and marked in real time, and the problem of inability to detect corn ear losses in real time in the prior art is solved, achieving higher harvest quality and lower food waste .
Patent Information
- Application Number
- CN202510006466.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2045-01-03
AI Technical Summary
The prior art cannot detect the loss of corn ears during the harvesting process of corn harvesters in real time, resulting in low harvest quality and serious food waste.
Using embedded and image processing methods, the current original image of corn ears is obtained in real time. Through technical means such as image edge feature extraction, hole filling, color space conversion, expansion and operation, the ears, leaves and damaged areas are gradually extracted and marked. , determine the proportion of the area of the damaged area.
Through real-time acquisition and image processing, the accuracy of damage area determination is significantly improved, food waste during corn harvesting is reduced, and harvest quality is improved.
Smart Images

Figure CN119399205A_ABST
Abstract
Description
Background Art
[0002] In the corn harvesting process, the mechanization level has been increasing year by year, and the corn cob harvesting method accounts for a considerable proportion. During the harvesting process, the relevant working parameters of the corn harvester are constant. In the case of large harvest losses, the harvester working parameters cannot be adjusted in real time according to the corn harvesting situation, resulting in low harvest quality and serious food waste during the harvesting process. The main basis for adjusting the harvester working parameters is the harvest quality of corn cobs during the current harvesting process.
[0003] At present, the research on corn detection is mainly divided into spectral detection and RGB detection according to the classification of acquired information. Considering the real-time adjustment of the working parameters of the corn harvester, RGB detection of corn is more suitable for corn harvesting scenes. RGB detection of corn focuses on corn kernel detection and overall recognition of ears. The improved YOLO-V4 algorithm is combined with the channel pruning algorithm, and the K-means algorithm is used to cluster the proportion of anchor frames to identify the number of corns falling in the field during corn harvesting (Gao A, Geng AJ, Zhang ZL, Zhang J, Hu XL, Li K. Dynamic detection method for falling ears of maize harvester based on improved YOLO-V4. Int JAgric&Biol Eng, 2022; 15(3): 22–32). After using convolutional neural network (CNN) for corn kernel detection, non-maximum suppression (NMS) is applied to remove overlapping detections. Finally, the window classified as a kernel is passed to another CNN regression model to find the coordinates of the corn kernel on the corn cob for kernel counting (Khaki, Saeed, et al. "Convolutional neural networks for image-based corn kernel detection and counting." Sensors 20.9 (2020): 2721.). A Chinese patent (Announcement No.: CN111310756A) discloses a method for detecting and classifying damaged corn kernels based on deep learning. None of the above studies can solve the problem of real-time detection of corn cob harvest losses during the harvesting process of corn harvesters. Summary of the invention
[0004] The technical problem to be solved by the present invention is to address the deficiencies of the prior art and specifically provide a corn ear damage detection method based on embedded and image processing, which is as follows: 1) In the first aspect, the present invention provides a corn ear damage detection method based on embedded system and image processing, and the specific technical scheme is as follows: S1, acquiring in real time a current original image of a corn ear corresponding to a detection area, extracting image edge features of the current original image, performing hole-filling processing on the image edge, and segmenting a background area in the current original image after the hole-filling processing to obtain a first image; S2, using the cv.cvtColor() function to convert the first image into the HSV color space and the YCrCb color space; S3, in the HSV color space, dilate the first image to determine the ear region, remove the ear region from the first image to obtain a second image, and pre-process the second image to obtain a corn leaf region; S4, in the YCrCb color space, removing the corn leaf area from the second image to obtain a third image, and performing an opening operation on the third image to obtain a damaged area.
[0005] The beneficial effects of the corn ear damage detection method based on embedded system and image processing provided by the present invention are as follows: By gradually extracting and labeling the regions of the current original image collected in real time, the accuracy of determining the final damaged region can be further improved. In addition, different regions can be extracted through different color spaces, that is, different features have different extraction difficulties in different color spaces. Therefore, extracting different feature regions in different color spaces can greatly improve the accuracy of determining the regional range.
[0006] Based on the above solution, the present invention can also be improved as follows.
[0007] Furthermore, the method further includes: performing white balance processing and histogram equalization processing on the current original image to obtain an optimized current original image, and using the optimized current original image as the current original image in S1 to extract image edge features.
[0008] Furthermore, it also includes: based on the position information corresponding to the background area in the current original image, the position information corresponding to the ear area in the current original image, the position information corresponding to the corn leaf area in the current original image, and the position information corresponding to the damaged area in the current original image, marking the current original image to generate a marking map.
[0009] Furthermore, it also includes: determining the area ratio of the damaged area in the current original image based on the number of pixels corresponding to the background area, the number of pixels corresponding to the ear area, the number of pixels corresponding to the corn leaf area, and the number of pixels corresponding to the damaged area.
[0010] Furthermore, it also includes: An artificial label map corresponding to the current original image is determined by manual labeling, wherein the artificial label map includes an artificially labeled background area, an artificially labeled ear area, an artificially labeled corn leaf area and an artificially labeled damaged area. Based on the artificial label map and the labeled map, the accuracy of the background area, the ear area, the corn leaf area and the damaged area in the labeled map is determined.
[0011] 2) In the second aspect, the present invention also provides a corn ear damage detection system based on embedded system and image processing, and the specific technical scheme is as follows: The acquisition module is used to: acquire the current original image of the corn ear corresponding to the detection area, extract the image edge features of the current original image, perform hole filling processing on the image edge, and segment the background area in the current original image after the hole filling processing to obtain a first image; The conversion module is used to: use the cv.cvtColor() function to convert the first image into the HSV color space and the YCrCb color space; The first processing module is used to: perform expansion processing on the first image in the HSV color space to determine the ear region, remove the ear region from the first image to obtain the second image, and pre-process the second image to obtain the corn leaf region; The second processing module is used for: in the YCrCb color space, removing the corn leaf area from the second image to obtain a third image, and performing an opening operation on the third image to obtain a damaged area.
[0012] Based on the above solution, the present invention can also be improved as follows.
[0013] Furthermore, it also includes: an optimization module for: performing white balance processing and histogram equalization processing on the current original image to obtain an optimized current original image, and using the optimized current original image as the current original image in the acquisition module to extract image edge features.
[0014] Furthermore, it also includes: a generation module for marking the current original image based on the position information corresponding to the background area in the current original image, the position information corresponding to the ear area in the current original image, the position information corresponding to the corn leaf area in the current original image, and the position information corresponding to the damaged area in the current original image to generate a marking map.
[0015] Furthermore, it also includes: a calculation module for determining the area ratio of the damaged area in the current original image based on the number of pixels corresponding to the background area, the number of pixels corresponding to the ear area, the number of pixels corresponding to the corn leaf area, and the number of pixels corresponding to the damaged area.
[0016] Furthermore, it also includes: The comparison module is used to: determine the artificial label image corresponding to the current original image by artificial labeling, the artificial label image includes an artificially labeled background area, an artificially labeled ear area, an artificially labeled corn leaf area and an artificially labeled damaged area, and determine the accuracy of the background area, ear area, corn leaf area and damaged area in the labeled image based on the artificial label image and the labeled image.
[0017] 3) In a third aspect, the present invention further provides an electronic device, comprising a processor, wherein the processor is coupled to a memory, wherein the memory stores at least one computer program, and wherein the at least one computer program is loaded and executed by the processor so that the electronic device implements any of the above methods.
[0018] 4) In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor to enable a computer to implement any of the above methods.
[0019] It should be noted that the beneficial effects achieved by the technical solutions of the second to fourth aspects of the present invention and the corresponding possible implementation methods can be found in the above-mentioned technical effects of the first aspect and its corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings: Figure 1 This is one of the flow charts of a corn ear damage detection method based on embedded system and image processing according to an embodiment of the present invention; Figure 2This is a second flow chart of a corn ear damage detection method based on embedded system and image processing according to an embodiment of the present invention; Figure 3 A schematic diagram of a preprocessing flow of a corn ear damage detection method based on embedded system and image processing according to an embodiment of the present invention; Figure 4 This is a third structural diagram of a corn ear damage detection method based on embedded system and image processing according to an embodiment of the present invention; Figure 5 A schematic diagram of an original image of corn in a corn harvester ear box of a corn ear damage detection method based on embedded system and image processing according to an embodiment of the present invention; Figure 6 A schematic diagram of an image of corn in an ear box after white balance processing in a method for detecting corn ear damage based on embedded system and image processing according to an embodiment of the present invention; Figure 7 A schematic diagram of a corn image in an ear box using histogram equalization of a corn ear damage detection method based on embedded system and image processing according to an embodiment of the present invention; Figure 8 A schematic diagram of an image of corn in an ear box after extracting image edges in a method for detecting corn ear damage based on embedded system and image processing according to an embodiment of the present invention; Fig. 9 A schematic diagram of a corn image in an ear box with sample background binarization of a corn ear damage detection method based on embedded system and image processing according to an embodiment of the present invention; Fig.10 A schematic diagram of an intact corn ear image subjected to threshold segmentation in the HSV color space in a corn ear damage detection method based on embedded and image processing according to an embodiment of the present invention; Fig.11 A schematic diagram of a leaf image that performs threshold segmentation in the HSV color space in a corn ear damage detection method based on embedded and image processing according to an embodiment of the present invention; Fig.12 A schematic diagram of a damaged corn part image subjected to threshold segmentation in a YCrCb color space in a corn ear damage detection method based on embedded and image processing according to an embodiment of the present invention; Fig.13 It is a structural schematic diagram of an image acquisition and recognition device of a corn ear damage detection method based on embedded system and image processing according to an embodiment of the present invention; Fig.14 A schematic diagram of a laboratory simulation of a corn ear harvesting and collecting box scenario of a corn ear damage detection method based on embedded system and image processing according to an embodiment of the present invention; Fig.15A schematic diagram of a display screen displaying a corn image in a method for detecting corn ear damage based on embedded system and image processing according to an embodiment of the present invention; Fig.16 A schematic diagram of an adjustable fill light for a corn ear damage detection method based on embedded system and image processing according to an embodiment of the present invention; Fig.17 The present invention is an architectural framework diagram of an electronic device. DETAILED DESCRIPTION
[0021] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0022] like Figures 1 to 4 As shown, a corn ear damage detection method based on embedded system and image processing according to an embodiment of the present invention comprises the following steps: S1, acquiring in real time a current original image of a corn ear corresponding to a detection area, extracting image edge features of the current original image, performing hole-filling processing on the image edge, and segmenting a background area in the current original image after the hole-filling processing to obtain a first image; S2, using the cv.cvtColor() function to convert the first image into the HSV color space and the YCrCb color space; S3, in the HSV color space, dilate the first image to determine the ear region, remove the ear region from the first image to obtain a second image, and pre-process the second image to obtain a corn leaf region; S4, in the YCrCb color space, removing the corn leaf area from the second image to obtain a third image, and performing an opening operation on the third image to obtain a damaged area.
[0023] The beneficial effects of the corn ear damage detection method based on embedded system and image processing provided by the present invention are as follows: By gradually extracting and labeling the regions of the current original image collected in real time, the accuracy of determining the final damaged region can be further improved. In addition, different regions can be extracted through different color spaces, that is, different features have different extraction difficulties in different color spaces. Therefore, extracting different feature regions in different color spaces can greatly improve the accuracy of determining the regional range.
[0024] S1, real-time acquisition of the current original image of the corn ear corresponding to the detection area, extraction of the image edge features of the current original image, and hole filling processing of the image edge, segmentation of the background area in the current original image after the hole filling processing, to obtain a first image. Wherein: The detection area is the interior of the device where the corn ears are stored.
[0025] The current original image is an image captured by a camera mounted on the edge of the device storing corn ears, targeting the interior of the device storing corn ears. Fig.13 As shown, it includes a monitor, a Logitech C1000e 4K camera, a power adapter, and a Jetson Xavier NX small AI supercomputer. Fig.14 The shooting scenes shown also include Fig.16 The fill light shown in the figure, the image obtained after shooting is as follows Fig.15 It is also worth emphasizing that compared with small AI supercomputers, conventional computers are more practical and powerful, which also verifies the feasibility of the solution.
[0026] In order to facilitate the confirmation of the image edge features of the original image, it is necessary to perform fitting processing on the overlapping area during the image edge feature determination process. The specific process is as follows: Determine the overlapping area of the images, and determine the number of overlaps corresponding to the overlapping area through the image data connected to the overlapping area, that is, how many corn ears have overlapped images. Layer the overlapping corn ears, and the corn ears whose edge contours can be completely determined are the top layer or the first layer, the corn ears whose image information is only partially covered by the first layer of corn ears are the second layer, the corn ears covered by the first layer and the second layer of corn ears, or the corn ears whose image information is only partially covered by the second layer of corn ears are the third layer, and so on. Determine the number of layers corresponding to each overlapping corn ear, and restore the corn ears of all layers except the first layer layer by layer.
[0027] The specific process of performing the second layer restoration is as follows: Determine the contour features of the uncovered portion of the second layer of corn ears, and search for a reference corn ear image with the highest similarity to the contour features in a corn ear database based on the contour features, restore the corn ears of the second layer according to the reference corn ear image, and determine the covered area of the corn ear based on the restoration result. When the covered area accounts for more than two-thirds of the corn ear and there is no third layer or other layers of corn ears under the corn ear, remove the uncovered portion of the corn ear and replace it with a background image.
[0028] The specific process of searching the corn ear database for the reference corn ear image with the highest phase velocity with the contour feature is as follows: Determine the contour shape of the corn ear, and determine the actual physical information corresponding to the contour shape based on the contour shape, the actual physical information including the true perimeter, length and width of the contour. Based on the above actual physical information, search the corn ear database for the first n historical corn ears that are closest to the actual physical information parameters, and draw the contours of the first n historical corn ears, compare them with the contour shape of the corn ear one by one, determine the historical corn ear with the most similar contour features, and use the historical corn ear as the reference corn ear image. The restoration process of the Nth layer is the same as that of the second layer; Based on the above relationship between the number of layers, the specific process of calculating the area ratio of the damaged area in the current original image is as follows: Determine whether the corn ear corresponding to any damaged area is covered. If not, directly record the area corresponding to the damaged area in the total damaged area. If so, determine the number of covered layers corresponding to the damaged area. Based on the baseline corn ear image corresponding to the damaged area, determine the covered area in the baseline corn ear image. According to the number of covered layers, determine the weight coefficient, and multiply the covered area in the baseline corn ear image by the weight coefficient corresponding to the corresponding number of covered layers to determine the superimposed area. Sum the image area corresponding to the original image and the superimposed area to obtain the accumulated area. Determine the accumulated area as the area value of the current original image in the process of calculating the area ratio of the damaged area in the current original image.
[0029] Among them, different numbers of coverage layers correspond to different weight coefficients, and the higher the number of layers, the smaller the weight coefficient. The purpose of the above processing is that in the process of restoration, the lower the image is, the larger the coverage area is and the less feature information is, so the probability of error in the restoration process is higher. Therefore, when allocating the corresponding weight coefficient, a weight coefficient that is too high cannot be given.
[0030] In order to ensure the accuracy of edge feature extraction, the gray world method is used for white balance processing before edge feature extraction, and then adaptive histogram equalization is performed to obtain the pre-processed image; Convert the preprocessed RGB color space image to HSV and YCrCb color space using cv2.cvtColor() function; The Sobel operator is used to extract the image edge, fill the holes on the edge, extract most of the background, and also extract the background with a color similar to the damage.
[0031] After removing the background area from the current original image, the first image is generated, and the cv.split() function is used to segment the image with a threshold of 80 in the H channel of the HSV color space. Then the image is binarized, the image is dilated, the blurred ear edge is marked as the ear area, and the ear area is removed from the first image to obtain the second image. The cv.split() function is used to select thresholds of 195 and 130 in the V channel and U channel of the HSV color space, respectively, to segment the leaves. Then the image is binarized, the image is eroded and denoised, and then dilated to obtain the segmentation result image of the leaves.
[0032] Remove the parts marked as background, remove the parts marked as ears and leaves, and use the cv.split() function to segment the corn ear damage. In the V channel of the YCrCb color space, select a threshold of 140 to segment the damaged area. Binarize the image, first perform a closing operation on the image to remove noise, and then perform an opening operation on the image to obtain the segmentation result of the damage.
[0033] The ear, leaf, damage and background marks are integrated into one image, marked separately and given different colors. The area with pixel "1" represents the ear area (yellow), the area with pixel "2" represents the damage area (red), the area with pixel "3" represents the leaf area (green), and the remaining pixels are "0" (black), representing the background area. The final output is a visual marked image.
[0034] Calculate the area of each region of the visual marker map excluding the background, including the ear area P lc , leaf area P ll , damage area P ld , the damaged area is divided by the sum of the ear, damaged and leaf areas to obtain the predicted damage proportion P d .
[0035] By manual annotation, the area of each region except the background is calculated, including the area of intact ear R lc , leaf area R ll , Damage area R ld , the damaged area is divided by the sum of the ear, damaged and leaf areas to get the actual damage ratio R d .
[0036] The predicted label map is compared with the artificial label map, and the area of each region where the label map is consistent with the label map is calculated to obtain the accuracy rate Pr of the predicted damaged area.
[0037] Predicted loss ratio P d The calculation method is: ; Actual damage ratio R dThe calculation method is: ; Damage accuracy P r for: .
[0038] Furthermore, the method further includes: performing white balance processing and histogram equalization processing on the current original image to obtain an optimized current original image, and using the optimized current original image as the current original image in S1 to extract image edge features.
[0039] Furthermore, it also includes: based on the position information corresponding to the background area in the current original image, the position information corresponding to the ear area in the current original image, the position information corresponding to the corn leaf area in the current original image, and the position information corresponding to the damaged area in the current original image, marking the current original image to generate a marking map.
[0040] Furthermore, it also includes: determining the area ratio of the damaged area in the current original image based on the number of pixels corresponding to the background area, the number of pixels corresponding to the ear area, the number of pixels corresponding to the corn leaf area, and the number of pixels corresponding to the damaged area.
[0041] Furthermore, it also includes: An artificial label map corresponding to the current original image is determined by manual labeling, wherein the artificial label map includes an artificially labeled background area, an artificially labeled ear area, an artificially labeled corn leaf area and an artificially labeled damaged area. Based on the artificial label map and the labeled map, the accuracy of the background area, the ear area, the corn leaf area and the damaged area in the labeled map is determined.
[0042] Embodiment 1, step 1: the upper computer sends a startup instruction to the embedded module, and the lower computer receives the instruction.
[0043] Step 2: The camera is installed on the corn ear box to obtain corn ear harvesting images in real time during the operation of the harvester, and transmit the images to the host computer.
[0044] Step 3: Execute the image preprocessing module to loop through multiple sample images. Figure 5 As an example, the gray world method is used to perform white balance processing to obtain Figure 6 , and then perform adaptive histogram equalization to obtain the preprocessed Figure 7 .
[0045] The Sobel operator is used to extract the image edge, fill the holes on the edge, and extract most of the background. The background with a color similar to the damage is also extracted, such as Figure 8 , and then perform background binarization to obtain Fig. 9 .
[0046] Step 4: Convert the preprocessed RGB color space image to HSV and YCrCb color space using the cv.cvtColor() function.
[0047] After removing the segmented background image, the cv.split() function is used to perform segmentation with a threshold of 80 in the H channel of the HSV color space. The image is then binarized and then dilated. The blurred ear edge is marked as the ear area. Fig.10 .
[0048] Remove the segmented background and the marked ear part, use the cv.split() function to select the thresholds of 195 and 130 in the V channel and U channel of the HSV color space respectively, and segment the leaves. Then binarize the image, perform corrosion denoising on the image, and then perform dilation to obtain the segmentation result of the leaf. Fig.11 .
[0049] Remove the parts marked as background, remove the parts marked as ears and leaves, and use the cv.split() function to segment the corn ear damage. In the V channel of the YCrCb color space, select a threshold of 140 to segment the damaged area. Binarize the image, first perform a closing operation on the image to remove noise, and then perform an opening operation on the image to enhance it, and obtain the segmentation result of the damage, as shown in the figure below. Fig.12 shown.
[0050] The ear, leaf, damage and background marks are integrated into one image, marked and assigned different colors respectively. The area with pixel "1" represents the ear area (yellow), the area with pixel "2" represents the damage area (red), the area with pixel "3" represents the leaf area (green), and the remaining pixels are "0" (black), representing the background area. The final output is a visual marking map, such as Figure 5 shown.
[0051] Step 5: Calculate the area of each region of the visual marker map except the background, including the ear area P lc , leaf area P ll , damage area P ld , the damaged area is divided by the sum of the ear, damaged and leaf areas to obtain the predicted damage proportion P d .
[0052] Step 6: Save the various parameters predicted by the lower computer into an Excel file, and transfer the predicted damage image and Excel file to the upper computer.
[0053] Step 7: Determine whether to enter the segmentation effect evaluation module. If the segmentation evaluation module needs to be executed, the label image that has been manually calibrated will be transmitted to the lower computer to calculate the area of each area except the background, including the area R of the intact ear. lc , leaf area R ll , Damage area R ld , the damaged area is divided by the sum of the ear, damaged and leaf areas to get the actual damage ratio R d .
[0054] Step 8: Compare the predicted label map with the artificial label map, calculate the area of each region where the label map is consistent with the label map, and obtain the accuracy rate P of the predicted damage area r .
[0055] Step 9: Determine whether there is a new spike box image input within a certain period of time. If there is new image information input, repeat steps 2 to 13, otherwise end.
[0056] The purpose of the image preprocessing module is to enhance the recognizability of corn ears, leaves and background, and improve the image quality; the image processing module segments, marks and visualizes the preprocessed image, and calculates the area of each part and predicts the damage ratio.
[0057] In the above embodiments, although the steps are numbered S1, S2, etc., these are only specific embodiments given by the present invention. Those skilled in the art may adjust the execution order of S1, S2, etc. according to actual conditions, which is also within the protection scope of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.
[0058] The present invention also provides a corn ear damage detection system based on embedded system and image processing, and the specific technical scheme is as follows: The acquisition module is used to: acquire the current original image of the corn ear corresponding to the detection area, extract the image edge features of the current original image, perform hole filling processing on the image edge, and segment the background area in the current original image after the hole filling processing to obtain a first image; The conversion module is used to: use the cv.cvtColor() function to convert the first image into the HSV color space and the YCrCb color space; The first processing module is used to: perform expansion processing on the first image in the HSV color space to determine the ear region, remove the ear region from the first image to obtain the second image, and pre-process the second image to obtain the corn leaf region; The second processing module is used for: in the YCrCb color space, removing the corn leaf area from the second image to obtain a third image, and performing an opening operation on the third image to obtain a damaged area.
[0059] Based on the above solution, the present invention can also be improved as follows.
[0060] Furthermore, it also includes: an optimization module for: performing white balance processing and histogram equalization processing on the current original image to obtain an optimized current original image, and using the optimized current original image as the current original image in the acquisition module to extract image edge features.
[0061] Furthermore, it also includes: a generation module for marking the current original image based on the position information corresponding to the background area in the current original image, the position information corresponding to the ear area in the current original image, the position information corresponding to the corn leaf area in the current original image, and the position information corresponding to the damaged area in the current original image to generate a marking map.
[0062] Furthermore, it also includes: a calculation module for determining the area ratio of the damaged area in the current original image based on the number of pixels corresponding to the background area, the number of pixels corresponding to the ear area, the number of pixels corresponding to the corn leaf area, and the number of pixels corresponding to the damaged area.
[0063] Furthermore, it also includes: The comparison module is used to: determine the artificial label image corresponding to the current original image by artificial labeling, the artificial label image includes an artificially labeled background area, an artificially labeled ear area, an artificially labeled corn leaf area and an artificially labeled damaged area, and determine the accuracy of the background area, ear area, corn leaf area and damaged area in the labeled image based on the artificial label image and the labeled image.
[0064] It should be noted that the beneficial effects of the corn ear damage detection system based on embedded and image processing provided by the above embodiment are the same as the beneficial effects of the corn ear damage detection method based on embedded and image processing, which will not be repeated here. In addition, when the system provided by the above embodiment realizes its functions, it only uses the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to actual conditions to complete all or part of the functions described above. In addition, the system and method embodiments provided by the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0065] like Fig.17 As shown, an electronic device 300 according to an embodiment of the present invention includes a processor 320, the processor 320 is coupled to a memory 310, and the memory 310 stores at least one computer program 330, and the at least one computer program 330 is loaded and executed by the processor 320, so that the electronic device 300 implements any of the above methods, specifically: The electronic device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors 320 (Central Processing Units, CPU) and one or more memories 310, wherein the one or more memories 310 store at least one computer program 330, and the at least one computer program 330 is loaded and executed by the one or more processors 320, so that the electronic device 300 implements a corn ear damage detection method based on embedded and image processing provided in the above embodiment. Of course, the electronic device 300 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the electronic device 300 may also include other components for realizing device functions, which will not be repeated here.
[0066] A computer-readable storage medium according to an embodiment of the present invention stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that a computer implements any one of the above methods.
[0067] Optionally, the computer readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0068] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs any of the above methods.
[0069] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects and represent the definition of a specific order or sequence. The order of use of similar objects can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than the order shown or described.
[0070] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code.
[0071] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.
[0072] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A corn ear damage detection method based on embedded and image processing, characterized in that: include: S1, obtaining a current original image of a corn ear corresponding to a detection area, extracting image edge features of the current original image, performing hole filling processing on the image edge, and segmenting a background area in the current original image after the hole filling processing to obtain a first image; S2, using the cv.cvtColor() function to convert the first image into the HSV color space and the YCrCb color space; S3, in the HSV color space, dilate the first image to determine the ear region, remove the ear region from the first image to obtain a second image, and pre-process the second image to obtain a corn leaf region; S4, in the YCrCb color space, removing the corn leaf area from the second image to obtain a third image, and performing an opening operation on the third image to obtain a damaged area.
2. According to claim 1, a corn ear damage detection method based on embedded and image processing is characterized in that: Also includes: The current original image is subjected to white balance processing and histogram equalization processing to obtain an optimized current original image, and the optimized current original image is used as the current original image in S1 to extract image edge features.
3. The corn ear damage detection method based on embedded system and image processing according to claim 1 is characterized in that: Also includes: Based on the position information corresponding to the background area in the current original image, the position information corresponding to the ear area in the current original image, the position information corresponding to the corn leaf area in the current original image, and the position information corresponding to the damaged area in the current original image, the current original image is marked to generate a marking map.
4. The corn ear damage detection method based on embedded system and image processing according to claim 1 is characterized in that: Also includes: According to the number of pixels corresponding to the background area, the number of pixels corresponding to the ear area, the number of pixels corresponding to the corn leaf area and the number of pixels corresponding to the damaged area, the area ratio of the damaged area in the current original image is determined.
5. The corn ear damage detection method based on embedded system and image processing according to claim 3 is characterized in that: Also includes: An artificial label map corresponding to the current original image is determined by manual labeling, wherein the artificial label map includes an artificially labeled background area, an artificially labeled ear area, an artificially labeled corn leaf area and an artificially labeled damaged area. Based on the artificial label map and the labeled map, the accuracy of the background area, the ear area, the corn leaf area and the damaged area in the labeled map is determined.
6. A corn ear damage detection system based on embedded and image processing, characterized in that: include: The acquisition module is used to: acquire the current original image of the corn ear corresponding to the detection area, extract the image edge features of the current original image, perform hole filling processing on the image edge, and segment the background area in the current original image after the hole filling processing to obtain a first image; The conversion module is used to: use the cv.cvtColor() function to convert the first image into the HSV color space and the YCrCb color space; The first processing module is used to: perform expansion processing on the first image in the HSV color space to determine the ear region, remove the ear region from the first image to obtain the second image, and pre-process the second image to obtain the corn leaf region; The second processing module is used for: in the YCrCb color space, removing the corn leaf area from the second image to obtain a third image, and performing an opening operation on the third image to obtain a damaged area.
7. The corn ear damage detection system based on embedded system and image processing according to claim 6 is characterized in that: Also includes: The optimization module is used to perform white balance processing and histogram equalization processing on the current original image to obtain an optimized current original image, and use the optimized current original image as the current original image in the acquisition module to extract image edge features.
8. The corn ear damage detection system based on embedded system and image processing according to claim 6 is characterized in that: Also includes: The generation module is used to mark the current original image and generate a marking map based on the position information corresponding to the background area in the current original image, the position information corresponding to the ear area in the current original image, the position information corresponding to the corn leaf area in the current original image, and the position information corresponding to the damaged area in the current original image.
9. An electronic device, characterized in that: The electronic device comprises a processor, the processor is coupled to a memory, at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor so that the electronic device implements the method according to any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that a computer implements the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Damaged corn particle detection and classification method based on deep learning
CN111310756A
System for analyzing plant leaf features based on image scanning
CN103077529A
Convolutional-neural-network-based primary classification method for ear image of corn seed production
CN108549910A
Marine plankton automatic identification method and system based on information fusion technology
CN115272838A
HSV threshold segmentation-based corn kernel crushing identification method and sorting device
CN117115506A
Cited By
Corn harvester operation parameter detection control method and system based on visual identification
CN121549175A