An image processing method and system
By identifying and segmenting the target outline of the initial image in the ore sorting system, forming a reconstructed image and saving outline information, and using an AI recognition algorithm for offline recognition, the problems of difficulty in image storage and cumbersome parameter tuning in the prior art are solved, and resource saving and recognition efficiency are improved.
Patent Information
- Application Number
- CN202211286358.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-20
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2042-10-20
AI Technical Summary
The existing ore sorting system cannot effectively store the images collected in real time, resulting in excessive CPU and memory resource usage, affecting detection performance, and being unable to perform offline identification and parameter tuning.
By identifying the target outline of the initial image into multiple target images, forming a reconstructed image and saving the outline information, using an AI recognition algorithm for offline recognition, and image storage and recognition are realized through image acquisition, preprocessing, reconstruction and recognition modules.
Real-time image acquisition and offline recognition are realized, CPU and memory resources are saved, identification parameters are tuning is facilitated, repeated tests are reduced, and manpower and material resources are saved.
Smart Images

Figure CN115690132B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and particularly to an image processing method and system in an ore sorting system. Background Art
[0002] An ore sorting system utilizes technologies such as machine vision, deep learning, automation control, and mechatronics to simulate the human eye vision and brain. Through different spectral imaging, it discriminates the situation on the surface of ores, quickly and accurately analyzes the ores, and can select ore sorting equipment. In the prior art, an ore sorting system cannot store the images collected in real time because the data volume is large and the acquisition speed is too fast. Storing a large number of images in real time will occupy CPU and memory resources, affecting the detection performance. There are many limitations in the prior art: it cannot store the images during the recognition process, cannot perform offline recognition on the images during the production process, and cannot adjust the recognition parameters as required. Summary of the Invention
[0003] This application provides an image processing method and an image processing system, which solve the problems of difficult image storage during the sorting process, cumbersome operations such as offline recognition and parameter adjustment.
[0004] An image processing method according to an embodiment of this application is used in an ore sorting system to perform image processing on ores, and includes the following steps:
[0005] Perform target contour recognition on the initial image and segment it into multiple target images, with each target image corresponding to an ore image;
[0006] Form a reconstructed image and save it. The reconstructed image is a picture file formed by splicing multiple target images. At the same time, save the contour information and position information corresponding to each target image to a data file;
[0007] Use an AI recognition algorithm to recognize the reconstructed image.
[0008] Preferably, in the step of using an AI recognition algorithm to recognize the reconstructed image, it further includes the steps of:
[0009] Read the reconstructed image file and the corresponding data file into the memory;
[0010] Parse the contour information and position information in the data file;
[0011] After intercepting the target image on the reconstructed image according to the contour information and position information in the data file, use an AI recognition algorithm to recognize the target image.
[0012] Preferably, perform gray conversion, median filtering, and binarization processing on the initial image before performing contour recognition.
[0013] Preferably, the target image is a rectangle determined according to the contour boundary of the target image.
[0014] Preferably, in the step of forming the reconstructed image, the following steps are further included:
[0015] Take out each of the target images in sequence;
[0016] Obtain the width and height information of the current target image;
[0017] Calculate whether there is enough space in the reconstructed image to insert the current target image;
[0018] Insert the current target image into the reconstructed image.
[0019] Preferably, if there is not enough space in the reconstructed image, save the reconstructed image and the corresponding data file, create a new reconstructed image file and insert the current target image into the new reconstructed image.
[0020] Preferably, in the step of identifying the target image using the AI recognition algorithm, the following steps are further included:
[0021] Perform recognition and classification on each of the target images according to the recognition parameters;
[0022] Draw a reconstructed recognition image according to the recognition result;
[0023] Display the reconstructed recognition image and perform manual judgment.
[0024] Preferably, in the step of manual judgment, if it does not meet the expectation, adjust the recognition parameters and re-enter the step of performing recognition on each of the target images according to the recognition parameters.
[0025] The embodiment of the present application further provides an image processing system for implementing the above image processing method, which is characterized by including an image acquisition module, an image preprocessing module, an image reconstruction module, and an image recognition module;
[0026] The image acquisition module is used to acquire an initial image;
[0027] The image preprocessing module is used to segment the initial image into multiple target images, and each target image corresponds to an ore image;
[0028] The image reconstruction module is used to reconstruct the multiple target images to form the reconstructed image and save it;
[0029] The image recognition module is used to perform recognition and classification on the reconstructed image.
[0030] The embodiment of the present application also provides a memory storing a program, and when the program is executed by a processor, the above-mentioned image processing method is implemented.
[0031] An embodiment of the present application also provides an electronic device, comprising a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method steps of the above-mentioned image processing method.
[0032] The method and system provided by the present application can collect and save target images in real time online, read the saved target images locally offline, and re-identify the target images by adjusting and optimizing the sorting parameters, which can produce the following beneficial effects:
[0033] The target image collected by the present invention can be reused, which is convenient for tuning the recognition parameters, avoiding repeated test parameters, and achieving the expected effect parameters, saving manpower and material resources. The present invention only saves the target image, eliminating the need to save other invalid area images, saving CPU and memory resources. The image storage space of the present invention is small, does not need to occupy a huge hard disk space, is convenient to copy, and is easy to store. This solution can conveniently store real-time images and perform offline image recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0035] Figure 1 A flow chart of an image processing method provided in an embodiment of the present application;
[0036] Figure 2 A flowchart of an image recognition step of an image processing method provided in an embodiment of the present application;
[0037] Figure 3 A flowchart of an image processing method for reconstructing an image and an image recognition step provided in an embodiment of the present application;
[0038] Figure 4 A schematic diagram of a reconstructed image provided in an embodiment of the present application;
[0039] Figure 5 A flowchart for implementing an image recognition step in an image processing method provided in an embodiment of the present application;
[0040] Figure 6 A schematic diagram of an image processing system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments of this application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of this application.
[0042] The following will detail the technical solutions provided by each embodiment of this application in conjunction with the drawings.
[0043] Figure 1 This application provides an image processing method in an embodiment of the invention for use in an ore sorting system to perform image processing on ores, such as Figure 1 As shown, this solution includes the following steps:
[0044] Step 101: Identify the target contours of the initial image and segment it into multiple target images, with each target image corresponding to one ore.
[0045] In step 101, the original image taken is an image of multiple ores. The contours of the original image are identified, and a contour can be identified for each ore. The ore images are cut out according to the contours to form a form where each ore has a small image.
[0046] The collected original image is first preprocessed. The AI recognition algorithm can be used to preprocess the original image, define the region of interest, and then use threshold segmentation to obtain the target contours. Based on all the target contours obtained by target recognition, the target images are intercepted on the original image using the contours. Each target image contains an image of one ore.
[0047] In this embodiment, the industrial camera used is a line scan camera with a resolution of 4K. The camera uses the line trigger mode for image acquisition, calculates the corresponding line frequency based on the running speed of the belt, and sets the line frequency of the camera. Then, the line height of each frame of the camera is set to 128 lines, and the output image of each frame of the camera is 4096 in width and 128 pixels in height.
[0048] Step 102: Form a reconstructed image and save it. The reconstructed image is a picture file formed by splicing multiple target images. At the same time, save the contour information and position information corresponding to each target image to a data file.
[0049] The multiple small images formed in step 101 are recombined into a large image according to a certain rule and stored in the form of a picture file. During the target recognition process, it is also necessary to store the contour information and position information corresponding to each target image, and store this information in a data file in a custom format for use when restoring the image.
[0050] When reconstructing the target images in this embodiment, each target image is stitched together according to the stitching rules into a large image of a fixed size, and the data file is saved. The data saving is divided into raw files and JPG format images. The raw file is a custom data format used to store contour information, position information, etc., and JPG is a standard image format used to store the large image of a fixed size stitched from multiple target images.
[0051] Step 103, use the AI recognition algorithm to recognize the reconstructed image.
[0052] In step 103, after restoring the stitched large image using the data information saved in the data file, the AI recognition algorithm is used for offline recognition. Each target image traversed is subjected to AI recognition, and the recognition result is obtained.
[0053] In this embodiment, when the AI recognition algorithm recognizes, it first traverses the target images, loads the target images read from the raw file into the memory, performs AI recognition on each target image traversed, can use the recognition parameters to recognize all the target images and obtain the recognition result, and the software displays the classification situation of each target image.
[0054] Figure 2 This is a flowchart of another image processing method provided by the embodiments of the present invention and the present application. When using the AI recognition algorithm to recognize the reconstructed image, the following steps are further included:
[0055] Step 1031, read the reconstructed image file and the corresponding data file into the memory;
[0056] In this embodiment, the work of image acquisition, preprocessing, and saving can be carried out during the production process, while the steps of AI recognition can be implemented at the front end of the recognition software. In step 102, the stitched large image file and the corresponding data file have been saved. First, the picture file and the data file need to be read into the memory.
[0057] Read the saved reconstructed image file, read the file content in binary format, and the file content includes information such as the position and contour of the reconstructed image and all target images.
[0058] Step 1032, parse the contour information and position information in the data file;
[0059] Convert the data of the read reconstructed image into a picture, store the position and contour information of all target images in the memory, and complete the parsing process.
[0060] In this embodiment, the parsing process is to parse the content of the raw file read into the memory according to a custom data format to obtain the contour information and position information of all target images.
[0061] Step 1033, after intercepting the target image on the reconstructed image according to the contour information and position information in the data file, the AI recognition algorithm recognizes the target image.
[0062] After reading the picture file and the data file into the memory, the large picture of the reconstructed image, as well as the contour information and position information of each target image can be obtained. According to the position and contour information of all the parsed target images, all the target images are intercepted on the reconstructed image, and all the individual target images can be obtained.
[0063] As an embodiment of the present application, in step 101, the initial image is subjected to grayscale conversion, median filtering, binarization processing and then contour recognition.
[0064] In this embodiment, when performing contour recognition, the initial image can be subjected to grayscale conversion, median filtering, binarization processing and then contour recognition.
[0065] Specifically, in this embodiment, first the color image is converted into a grayscale image, then the color image is subjected to median filtering, and the size of the filtering template is set to 5; the preprocessed image is subjected to binarization processing; contour search is performed on the binarized image, and all target contours can be obtained.
[0066] As an embodiment of the present application, in step 101, the intercepted target image is a rectangle determined according to the contour boundary.
[0067] After the target contour is obtained, the target image needs to be intercepted in the original image according to the target contour. In this embodiment, the circumscribed rectangle of the target contour is used as the boundary for interception for all target images, that is, all target images are intercepted into rectangular target images according to the size of the target contour.
[0068] Specifically, in this embodiment, ROI image extraction is used, and the circumscribed rectangle of the directory contour is used to intercept the target image in the original image, and each obtained target image is cached in the memory in sequence.
[0069] By intercepting the image to regenerate the reconstructed image, only the target image is saved, and the saving of other invalid area images is omitted, saving the resources of the CPU and memory.
[0070] Due to the interception of the image and the omission of the saving of the invalid area image, the occupied space of the image storage is small, there is no need to occupy a huge hard disk space, it is convenient to copy and easy to store.
[0071] Figure 3 Another flowchart embodiment of the image processing method provided by the embodiment of the present invention application. In step 102, in the step of forming the reconstructed image, the following steps are further included:
[0072] Take out each of the target images in sequence;
[0073] Obtain the width and height information of the current target image;
[0074] Calculate whether there is enough space in the reconstructed image to insert the current target image;
[0075] Insert the current target image into the reconstructed image.
[0076] In this embodiment, each target image needs to be stored in a large reconstructed image according to certain rules, and a reconstructed image of a fixed size is generated according to certain rules. Generally, the size of the reconstructed image is much larger than the size of the target image, and each reconstructed image can store several target images. The process of generating the reconstructed image includes: first, take out each target image. The target image is a rectangle of different sizes when intercepted, and the size of the rectangle is determined by the size of the target contour. Each target image has its own height and width. Obtain the height and width of the current target image to be inserted and calculate whether there is enough space in the reconstructed image to insert the new target image. If there is enough space, insert the current target image into the reconstructed image.
[0077] Figure 4 It is a splicing schematic diagram of a reconstructed image. As an embodiment of the present application, it will be spliced into a fixed-size image according to rules, and each target image is spliced to form a large image of a fixed size for convenient overall storage and viewing.
[0078] In this embodiment, the reconstructed image can be spliced according to the following splicing rules:
[0079] a) The size of the large image after reconstruction is fixed, with a width of 4096 pixels and a height of 16384 pixels;
[0080] b) The upper left corner of the large image after reconstruction is the origin (0, 0);
[0081] c) The upper left corner of each target image is the origin (0, 0);
[0082] d) Each target image is arranged with a 5-pixel width interval on the left and right;
[0083] e) The first target image in the first row is placed at the position (5, 5) of the large reconstructed image;
[0084] f) If the last target object in each row will exceed 4096 pixels when placed down, place it at the first position of the next row;
[0085] g) The Y coordinate of each row of target images is arranged by accumulating 5 pixels on the height of the highest target image in the previous row of images.
[0086] As an embodiment of the present invention application, if there is not enough space in the reconstructed image, save the reconstructed image and the corresponding data file, create a new reconstructed image file and insert the current target image into the newly created reconstructed image.
[0087] If after calculation, there is not enough space in the current reconstructed image to insert the target image, save the current reconstructed image and create a new blank reconstructed image, and insert the target image into the new reconstructed image.
[0088] Specifically, in this embodiment, the target image can be inserted into the reconstructed image according to the following steps:
[0089] a) Take out each target image in sequence;
[0090] b) Place the first target image at the position of (5, 5). For example, if the width of the first target image is 45, then the second target image is placed at the position of (55, 5), where 55 = 5 (the x coordinate point of the first target) + 45 (the width of the first target image) + 5 (the interval width between each target image on the left and right). Arrange them in sequence according to the above rules until after placing the last target image in the first row, the x coordinate + the target width exceeds 4096 pixels. For example, if the original position of the last target is (4090, 5) and the width of this target image is 100, then 4090 + 100 = 4190, and 4190 exceeds 4096, which means the first row cannot hold this target image. Therefore, this target image needs to be placed at the first position of the second row;
[0091] c) The x coordinate of the first position in the second row is 5, and the y coordinate is the y coordinate of the highest target image in the first row + the height of the target image + 5. For example, if the highest target image in the first row is 90 and the coordinates of the highest target image are (100, 5), then the height of all target images placed in the second row is 5 (the y coordinate of the highest target image in the first row) + 90 (the height of the highest target image in the first row) + 5 (the interval height between each row of images) = 100. Therefore, the y coordinate of the second row is all 100, and the x coordinate of the second row is arranged in sequence as described in step b;
[0092] d) Regarding the arrangement of the last row of the reconstructed image, since the reconstructed image has a fixed height, if there are too many target images during the production process, after the last row is full, no further splicing will be performed. To illustrate when the storage of the last row ends, after the arrangement of the penultimate row is completed, the storage of the last row begins. For example, if the maximum height of the target image in the penultimate row is 100 and its coordinates are (100, 16200), then the maximum height of the target image stored in the last row is 16384 (fixed height of the reconstructed image) - 16200 (y coordinate of the highest target in the penultimate row of target images) - 100 (highest height of the target image in the penultimate row) - 5 (vertical interval height between images) = 79. That is to say, the highest height of the target image that can be placed in the last row is 79. Therefore, when placing the target images in the last row, target images with a height lower than 79 in the memory should be selected for storage, and the rest that do not meet the conditions should be discarded.
[0093] As an embodiment of the present invention application, as Figure 5 shown, in the step of using the AI recognition algorithm to recognize the target image, the following steps are further included:
[0094] Recognize and classify each target image according to the recognition parameters;
[0095] The user can set the recognition parameters in the software, and the recognition parameters are used to recognize all the target images. Or the recognition parameters commonly used in the production process can be used to recognize the target images first. The recognition parameters include but are not limited to the following parameters: minimum size (mm), maximum size (mm), grayscale threshold, sorting coefficient, sorting threshold 1, sorting threshold 2, etc.
[0096] Among them, the minimum size is the minimum particle size that the algorithm can recognize, with the unit of millimeter; the maximum size is the maximum particle size that the algorithm can recognize, with the unit of millimeter; the grayscale threshold is the threshold for distinguishing stones and the background; the sorting coefficient is used to calculate the "score" value of each stone, which can be understood as the "standard answer of the test paper"; sorting threshold 1 is used to judge the "score" generated by the sorting coefficient. Stones with a score lower than sorting threshold 1 are judged as tailings, and stones with a score higher than sorting threshold 1 are medium-grade ores, which can be regarded as the "passing score line"; sorting threshold 2 is used to judge the "score" generated by the sorting coefficient. Stones with a score lower than sorting threshold 1 are judged as tailings, which can be regarded as the "excellent score line". Between sorting threshold 1 and sorting threshold 2 are medium-grade ores, and those higher than sorting threshold 2 are high-grade ores.
[0097] Draw a reconstructed recognition image according to the recognition result;
[0098] In this step, according to the result after the recognition result of the previous step, a reconstructed recognition image is drawn, and the software displays the classification situation of each target image.
[0099] Display the reconstructed recognition image and perform manual judgment.
[0100] In this embodiment, the recognition result is used to draw a reconstructed recognition image and display it at the software front end for users to perform manual judgment.
[0101] Specific steps: Load the reconstructed image read from the raw file into memory, and draw the image to the software image control to display the reconstructed image to the user.
[0102] As another embodiment of the present invention application, as Figure 5 shown, in the step of manual judgment in step 1033, if it does not meet the expectation, adjust the recognition parameters and re-enter the step of recognizing and classifying each target image according to the recognition parameters.
[0103] In the step of AI recognition algorithm recognition, add a link of manual judgment. If the recognition effect of the AI recognition algorithm does not meet the expectation, the recognition parameters can be adjusted again. The adjustment of the recognition parameters can affect the features of recognition classification and directly affect the result of the AI recognition algorithm. Adding this loop link can make the AI recognition finally reach a satisfactory effect by repeatedly adjusting the recognition parameters.
[0104] By adding the link of manual judgment, the collected target images can be reused, avoiding repeated experimental parameter adjustment, and thus the expected effect parameters can be achieved, saving human and material resources.
[0105] Specifically, in this embodiment, the following steps are adopted to implement the function of manual judgment to reach the expectation.
[0106] a) Display the reconstructed image. Load the reconstructed image read from the raw file into memory, and draw the image to the software image control to display the original reconstructed image to the user;
[0107] b) Load the recognition parameters. Read the recognition parameters for saving production data at that time from the raw file and load them into memory. The raw file can save the recognition parameters being used during the production process as the initial recognition parameters while saving the position information and contour information of the target image. Use this initial recognition parameter for recognition when the AI recognition algorithm performs the first recognition to obtain an initial recognition result;
[0108] c) Traverse the target images. Traverse the target images read from the raw file and load them into memory;
[0109] d) AI recognition. Perform AI recognition on each traversed target image and obtain the recognition result;
[0110] e) Draw the reconstructed image. For the types recognized by the AI, circumscribed rectangles and contours can be drawn on the target image in different colors.
[0111] f) Adjust the recognition parameters. If the recognition result is different from the expectation, the relevant recognition parameters of the AI can be appropriately modified, and the offline recognition process can be executed again. The result is used to redraw the reconstructed image until the expected result is achieved.
[0112] Figure 6 The figure shows an image processing system provided by an embodiment of the present application. As Figure 6 shown, the image processing system provided by the present application includes an image acquisition module, an image preprocessing module, an image reconstruction module, and an image recognition module.
[0113] The image acquisition module is used to acquire the initial image.
[0114] In this embodiment, the image acquisition module is used for the image acquisition and processing end of the production equipment. Usually, an industrial camera can be used as the acquisition device. The industrial camera is a line scan camera with a resolution of 4K. The camera uses the line trigger mode for image acquisition. The corresponding line frequency is calculated according to the running speed of the belt, and the line frequency of the camera is set. Then, the line height of each frame of the camera is set to 128 lines. The output image of each frame of the camera is 4096 in width and 128 pixels in height. At the same time, the image acquisition device is equipped with a high-speed image acquisition card and a self-developed high-performance acquisition software. The industrial camera acquires images in real time, transmits them to the acquisition software through the acquisition card, and the software stores the acquired images in the continuous memory and stitches each frame of the image continuously.
[0115] The image preprocessing module is used to segment the initial image into multiple target images, and each target image corresponds to an ore image.
[0116] In this embodiment, the image preprocessing module completes the processes of converting the image into a grayscale image, median filtering, and binarization, and then performs ore contour recognition. The ROI method is used to obtain the target image. According to all the target contours obtained by target recognition, the circumscribed rectangles of the contours are used to intercept the target image on the original image, and each obtained target image is buffered in the memory in sequence.
[0117] The image reconstruction module is used to reconstruct the multiple target images into the reconstructed image and save it.
[0118] In this embodiment, the image reconstruction module is used after the production is completed. The software stitches all the target images buffered in the memory into an image of a fixed size for overall storage and viewing. The following describes the detailed process of stitching all the target images.
[0119] The image acquisition module, the image preprocessing module, and the image reconstruction module can all be located at the image acquisition and processing end on the production side.
[0120] The image recognition module is used to identify and classify the reconstructed images.
[0121] In this embodiment, the image recognition module can be used for the recognition of ore images. The user can set recognition parameters on the software side to recognize all target images and display the classification of each target image. If the effect does not meet the expectation, the user can reset the recognition parameters for adjustment until the expected effect is achieved.
[0122] As an embodiment of the present application, the industrial camera is a color three-channel line scan camera with a resolution of 4K. The camera is set to the line trigger acquisition mode, and the corresponding line frequency and trigger period are calculated according to the running speed of the belt. The camera can set the line height of each frame, such as 64 or 128, etc. The image acquisition device includes a high-speed image acquisition card and self-developed high-performance acquisition software. The industrial camera acquires images in real time, transmits them to the acquisition software through the acquisition card, and the software stores the acquired images in continuous memory.
[0123] During the production process, the function of saving data can be realized in the production equipment end through the following process:
[0124] Target recognition: The AI recognition algorithm preprocesses the original image, defines the region of interest, and then uses threshold segmentation to obtain the target contour;
[0125] ROI image extraction: Use the circumscribed rectangle of the target contour to intercept the target image from the original image;
[0126] Store the target image: The target image and other information such as the contour are stored in the memory;
[0127] Stop scanning: At the end of production, stop data acquisition;
[0128] Reconstruct the target image: Stitch each target image together, and the stitching rule is a large image with a fixed size;
[0129] Save the data file: The data saving is divided into raw files and JPG format images. The raw file is a custom data format, and JPG is a standard image format.
[0130] On the software side, the function of reading data can be realized through the following process:
[0131] Read the raw file: The recognition software reads the file content into the memory device according to the defined raw file format;
[0132] File parsing: Parse the content of the raw file read into the memory according to the custom data format;
[0133] Obtain the target image, and according to the content of the parsed raw file, obtain the target image during the production process;
[0134] Obtain the recognition parameters. According to the content of the parsed raw file, obtain the recognition parameters during the production process. Here, the recognition parameters already in use during the production process can be continued to be used, or the recognition parameters can be reset.
[0135] The function of performing offline recognition on the software side will be implemented through the following steps:
[0136] Display the reconstructed image. The reconstructed image read from the raw file is loaded into the memory, and the image is drawn to the software image control to display the reconstructed image to the user;
[0137] Load the recognition parameters. Read the recognition parameters for saving production data at that time from the raw file and load them into the memory;
[0138] Traverse the target image. Traverse the target image read from the raw file and load it into the memory;
[0139] AI recognition. Perform AI recognition on each traversed target image and obtain the recognition result;
[0140] Draw the reconstructed image. For the types recognized by AI, an external rectangle and contour can be drawn on the target image in different colors;
[0141] Adjust the recognition parameters. If the recognition result is different from the expectation, the AI-related recognition parameters can be appropriately modified, and the offline recognition process is executed again. The result will redraw the reconstructed image until the expected result is achieved.
[0142] When optimizing the parameters, the recognition software loads the target image into the memory. Adjust the recognition parameters in the software, and the target object can be repeatedly recognized to achieve the expected effect.
[0143] An embodiment of the present application also provides a memory storing a program, and when the program is executed by a processor, the image processing method provided in the above embodiment is implemented.
[0144] An embodiment of the present application also provides an electronic device, including a memory and a processor; wherein, the memory is used to store one or more computer instructions, and when the one or more computer instructions are executed by the processor, the method steps provided in the above embodiment are implemented.
[0145] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.
[0146] It should also be noted that the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising the element.
[0147] The above are only the embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. An AI recognition method for an ore sorting system, characterized in that, Including the following steps: Step S1: Perform contour recognition on the captured original image containing multiple ores, segment it into multiple target images, identify a contour for each ore, and intercept the target image on the original image according to the contour. The intercepted target image is a rectangle determined according to the boundary of the contour. Step S2: Stitch the multiple target images formed in Step S1 into a large image and store it in the form of a picture. At the same time, store the contour information and position information corresponding to each target image in a data file for use when restoring the image. Step S3: After restoring the stitched large image using the data information saved in the data file, perform offline recognition using the AI recognition algorithm. Among them, perform AI recognition on each traversed target image and obtain the recognition result; draw a reconstructed recognition image according to the recognition result, display the reconstructed recognition image and perform manual judgment. If the recognition result is different from the expectation, modify the relevant AI recognition parameters.
2. The AI recognition method of the ore sorting system according to claim 1, wherein, Step S3 includes the steps of: Read the reconstructed image file and the corresponding data file into the memory; Parse the contour information and position information in the data file; After intercepting the target image on the reconstructed image according to the contour information and position information in the data file, perform recognition on the target image using the AI recognition algorithm.
3. The AI recognition method of the ore sorting system according to claim 1, wherein, In Step S1, perform gray-scale conversion, median filtering, and binarization processing on the original image before performing contour recognition.
4. The AI recognition method of the ore sorting system according to claim 1, wherein, Step S2 also includes the steps of: Take out each of the target images in turn; Obtain the width and height information of the current target image; Calculate whether there is enough space in the reconstructed image to insert the current target image; Insert the current target image into the reconstructed image.
5. The AI recognition method of the ore sorting system according to claim 4, wherein, If there is not enough space in the reconstructed image, save the reconstructed image and the corresponding data file, create a new reconstructed image file and insert the current target image into the new reconstructed image.
6. The AI recognition method of the ore sorting system according to claim 1, wherein, In Step S3, after modifying the relevant AI recognition parameters, re-perform recognition and classification on each target image according to the recognition parameters.
7. An AI recognition system for an ore sorting system, which is used for the AI recognition method according to any one of claims 1 to 6, and is characterized in that, Including an image acquisition module, an image preprocessing module, an image reconstruction module, and an AI image recognition module; The image acquisition module is used to acquire the original image; The image preprocessing module is used to segment the original image into multiple target images, and each target image is an image containing one ore; The image reconstruction module is used to stitch the multiple target images into a large image to form the reconstructed image and save it. At the same time, store the contour information and position information corresponding to each target image in a data file; The AI image recognition module is used to perform offline recognition on the target image obtained by restoring the stitched large image using the data information saved in the data file and obtain the recognition result.
8. A memory stores a program, characterized in that, When the program is executed by the processor, it implements the AI recognition method according to any one of claims 1-6.
9. An electronic device, characterized in that, Including a memory and a processor; among them, the memory is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the method steps according to any one of claims 1-6.
Citation Information
Patent Citations
Flake-type medium identification method and identification device
CN103106412A