A camera color automatic optimization method and device based on fruit recognition algorithm
Through the fruit recognition model and camera color optimization method of BP neural network, the accuracy problem of fruit recognition algorithm in complex environments is solved, independent image processing and recognition process is realized, and recognition accuracy and image vibrancy are improved.
Patent Information
- Application Number
- CN202110338736.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-30
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2041-03-30
AI Technical Summary
Existing fruit recognition algorithms are difficult to accurately identify fruits with similar characteristics under light and complex backgrounds. The image recognition process and processing process are intertwined and difficult to carry out independently.
The automatic camera color optimization method based on BP neural network is adopted. By pre-processing, feature extraction and normalization of the training image and target image, a fruit recognition model is constructed, and the trained BP neural network is used for recognition, and finally warm tone and saturation enhancement are performed.
The accuracy of fruit recognition and the independence of image processing and recognition process are achieved, the recognition accuracy and image color intensity are improved, and the appetite is increased.
Smart Images

Figure CN113011515B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to image recognition processing, and in particular to a camera color automatic optimization method and device based on a fruit recognition algorithm. Background Art
[0002] Accurate and rapid image recognition has long been a key research topic for scholars worldwide. Fruit image recognition plays a crucial role in both the smart industry and digital healthcare. In smart agriculture, fruit recognition enables precise cultivation of fruit trees in complex orchards and automated fruit harvesting. In digital healthcare, fruit recognition primarily assists in subsequent nutritional analysis of fruit. Rapid and accurate fruit recognition is crucial to these tasks. Existing fruit recognition algorithms include the SURF algorithm and the HALCON algorithm, which can effectively identify and classify most fruits. However, the image recognition and image processing processes in these algorithms are closely intertwined, making them difficult to distinguish. Furthermore, the influence of lighting and complex backgrounds can make it difficult to distinguish fruits with very similar features. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to address the deficiencies of the above-mentioned prior art and provide a method and device for automatic camera color optimization based on a fruit recognition algorithm.
[0004] The present invention solves the above technical problems with the following technical solution: a camera color automatic optimization method based on a fruit recognition algorithm, comprising the following steps:
[0005] Reading the training image and performing image processing, performing image feature extraction processing on the trained image after image processing, and obtaining training feature data;
[0006] Constructing a fruit recognition model based on a BP neural network, and using the training feature data to train the fruit recognition model;
[0007] Read the target image and perform image processing, perform image feature extraction on the processed target image, and obtain target feature data;
[0008] Inputting the target feature data into the trained fruit recognition model for recognition to obtain a corresponding recognition result;
[0009] Perform warm tone and saturation enhancement processing on the target image according to the recognition result.
[0010] The beneficial effects of the present invention are as follows: the present invention provides a camera color automatic optimization method based on a fruit recognition algorithm, performs image processing on training images and target images in advance, extracts corresponding feature data information, then constructs a BP neural network and uses a large number of training images to train the BP neural network, and then uses the trained BP neural network to recognize the feature data information corresponding to the target image, so that the fruit name can be accurately recognized, and the image processing process and the recognition process are independent of each other. Finally, according to the recognition result, the target image is enhanced in warm tone and saturation, so that the color of the target image is more intense and vivid, and the appetite is increased.
[0011] On the basis of the above technical solution, the present invention can also be improved as follows:
[0012] In a further technical solution, the reading of the training image and performing image processing includes the following steps:
[0013] Reading the training image and converting the training image into a digital image;
[0014] performing denoising and contrast enhancement processing on the digital image;
[0015] Binarizing the digital image after denoising and contrast enhancement to obtain a black and white image;
[0016] Labeling is performed on pixels in the black and white image to complete image processing of the training image.
[0017] The beneficial effects of the above further scheme are: by digitally converting the training image, it can facilitate computer recognition and subsequent processing; by performing denoising and contrast enhancement processing, the recognition accuracy can be improved; through labeling processing, all pixels can be easily separated, so that the respective feature information can be extracted for different pixels.
[0018] In a further technical solution, the labeling of pixels in the black and white image specifically includes the following steps:
[0019] Reading the RGB value of each pixel in the black-and-white image, and determining that the different pixels are connected if the RGB values of the different pixels are within the same color gamut, otherwise determining that the different pixels are disconnected;
[0020] Different pixels connected to each other are marked with the same label, and the labeling process of the pixels in the black and white image is completed.
[0021] The beneficial effect of the above further solution is that by determining whether different pixels are connected or disconnected, the connected pixels can be separated, thereby facilitating the subsequent extraction of feature data information of each pixel.
[0022] In a further technical solution, the training feature data is normalized, and the normalized training feature data is used as an input variable of the fruit recognition model for training;
[0023] After obtaining the target feature data, the following steps are also included:
[0024] The target feature data is normalized, and the normalized target feature data is input into the trained fruit recognition model for recognition.
[0025] The beneficial effect of the above further scheme is: since the units of each variable in the collected target feature data and the training feature data are not unified, and there are differences in the order of magnitude, the training feature data and the target feature data are normalized and converted into dimensionless quantities to eliminate the differences in their units and dimensions, reduce training time, avoid non-convergence, and thus improve training efficiency and accuracy. After recognition, denormalization is then performed to match and obtain the recognition results.
[0026] The present invention also provides a camera color automatic optimization device based on a fruit recognition algorithm, comprising an image processing module, a training module, a neural network recognition module and a post-processing module;
[0027] The image processing module is used to read the training image and perform image processing, perform image feature extraction processing on the image-processed training image, and obtain training feature data; and to read the target image and perform image processing, perform image feature extraction processing on the image-processed target image, and obtain target feature data;
[0028] The training module is used to construct a fruit recognition model based on a BP neural network, and train the fruit recognition model using the training feature data;
[0029] The neural network recognition module is used to input the target feature data into the trained fruit recognition model for recognition to obtain a corresponding recognition result;
[0030] The post-processing module is used to enhance the warm tone and saturation of the target image according to the recognition result.
[0031] The present invention provides a camera color automatic optimization device based on a fruit recognition algorithm. The device performs image processing on training images and target images in advance to extract corresponding feature data information. A BP neural network is then constructed and trained using a large number of training images. The trained BP neural network is then used to recognize the feature data information corresponding to the target image. The fruit name can be accurately recognized, and the image processing process and the recognition process are independent of each other. Finally, the target image is enhanced in warm tone and saturation according to the recognition result, thereby making the color of the target image more intense and vivid, thereby increasing appetite.
[0032] On the basis of the above technical solution, the present invention can also be improved as follows:
[0033] In a further technical solution, the image processing module specifically includes a conversion unit, an enhancement unit, a binarization unit and a labeling unit.
[0034] The conversion unit is used to read the training image and the target image, and convert the training image and the target image into digital images;
[0035] The enhancement unit is used to perform denoising and contrast enhancement processing on the digital image and the target image;
[0036] The binarization unit is used to perform binarization processing on the digital image and the target image after denoising and contrast enhancement processing to obtain corresponding black and white images;
[0037] The labeling unit is used to perform labeling processing on pixels in the black and white image to complete image processing of the training image and the target image.
[0038] The beneficial effects of the above further scheme are: by digitally converting the training image, it can facilitate computer recognition and subsequent processing; by performing denoising and contrast enhancement processing, the recognition accuracy can be improved; through labeling processing, all pixels can be easily separated, so that the respective feature information can be extracted for different pixels.
[0039] In a further technical solution, the labeling unit specifically includes:
[0040] a judgment unit, configured to read the RGB value of each pixel in the black-and-white image, and determine that the different pixels are connected if the RGB values of the different pixels are within the same color gamut; otherwise, determine that the different pixels are disconnected;
[0041] The labeling unit is used to label different interconnected pixels with the same label and complete the labeling process of the pixels in the black and white image.
[0042] The beneficial effect of the above further solution is that by determining whether different pixels are connected or disconnected, the connected pixels can be separated, thereby facilitating the subsequent extraction of feature data information of each pixel.
[0043] In a further technical solution, the image processing module further includes a normalization unit,
[0044] The normalization unit is used to normalize the training feature data and use the normalized training feature data as input variables of the fruit recognition model for training; and is used to normalize the target feature data and input the normalized target feature data into the trained fruit recognition model for recognition.
[0045] The beneficial effect of the above further scheme is: since the units of each variable in the collected target feature data and the training feature data are not unified, and there are differences in the order of magnitude, the training feature data and the target feature data are normalized and converted into dimensionless quantities to eliminate the differences in their units and dimensions, reduce training time, avoid non-convergence, and thus improve training efficiency and accuracy. After recognition, denormalization is then performed to match and obtain the recognition results.
[0046] In order to solve the technical problem of the present invention, the present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the camera color automatic optimization method based on the fruit recognition algorithm is implemented.
[0047] In order to solve the technical problem of the present invention, the present invention also provides a camera color automatic optimization device based on a fruit recognition algorithm, characterized in that it includes the above-mentioned storage medium and a processor, and when the processor executes the computer program on the storage medium, it implements the steps of the camera color automatic optimization method based on the fruit recognition algorithm.
[0048] In order to make the above-mentioned objects, features and advantages of the invention more obvious and easy to understand, preferred embodiments of the present invention are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a diagram showing an application scenario of a camera color automatic optimization method based on a fruit recognition algorithm in one embodiment;
[0050] Figure 2 is a flow chart of a method for automatic camera color optimization based on a fruit recognition algorithm in one embodiment;
[0051] Figure 3is a schematic structural diagram of a camera color automatic optimization device based on a fruit recognition algorithm in an embodiment;
[0052] Figure 4 The figure is a diagram of the internal structure of a computer device in an embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and beneficial technical effects of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described in this specification are only for the purpose of explaining the present invention and are not intended to limit the present invention.
[0054] The camera color automatic optimization method based on fruit recognition algorithm provided in this application can be applied to Figure 1 In the application environment shown, the camera color automatic optimization method based on the fruit recognition algorithm is applied to the terminal 102, wherein the terminal 102 can be, but is not limited to, a mobile terminal such as a smart phone, a computer, a laptop, a PDA, a portable media player (PMP), a navigation terminal, a wearable device, a smart bracelet, a pedometer, and a fixed terminal such as a digital TV and a desktop computer.
[0055] In one embodiment, Figure 2 As shown in the figure, a camera color automatic optimization method based on fruit recognition algorithm is provided. Figure 1 The following steps are used as an example to illustrate the smartphone in the figure:
[0056] S1: The smartphone reads the training image and performs image processing, then performs image feature extraction on the processed training image to obtain training feature data. In an embodiment of the present invention, the training feature data includes at least the training sample area, training sample perimeter, training sample curvature, and training sample color, etc. The above-mentioned image feature extraction can be performed on the fruit in the training image using methods such as the SURF algorithm and the HALCON algorithm. In one or more embodiments of the present invention, the smartphone reading the training image and performing image processing includes the following steps:
[0057] S11, the smartphone reads the training image and converts the training image into a digital image.
[0058] S12, smartphone performs denoising and contrast enhancement on digital images.
[0059] S13, the smart phone performs binarization processing on the digital image after denoising and contrast enhancement processing to obtain a black and white image.
[0060] At step S14, the smartphone labels the pixels in the black and white image. Specifically, the smartphone reads the RGB value of each pixel in the black and white image. If the RGB values of different pixels are within the same color gamut, the pixels are determined to be connected; otherwise, the pixels are determined to be disconnected. The connected pixels are then labeled with the same label, completing the pixel labeling process in the black and white image. By determining whether different pixels are connected or disconnected, the connected pixels can be separated, facilitating the subsequent extraction of feature data for each pixel.
[0061] The above preferred embodiment can facilitate computer recognition and subsequent processing by digitally converting the training image; improve recognition accuracy by performing denoising and contrast enhancement processing; and facilitate separation of all pixels by labeling, so that the respective feature information of different pixels can be extracted.
[0062] Then execute S2, the smartphone builds a fruit recognition model based on the BP neural network, uses the training feature data as the input variable of the fruit recognition model B, and uses the corresponding fruit name as the output variable of the fruit recognition model. The fruit recognition model is trained using the training feature data.
[0063] In step S3, the smartphone reads the target image and performs image processing, extracting image features from the processed target image to obtain target feature data. Similarly, the target feature data includes the target sample area, target sample perimeter, target sample curvature, and target sample color.
[0064] In step S4, the smartphone inputs the target feature data into the trained fruit recognition model for recognition, and obtains the corresponding recognition result.
[0065] S5, the smartphone enhances the warm tone and saturation of the target image based on the recognition results.
[0066] The above embodiment provides a method for automatic camera color optimization based on a fruit recognition algorithm. The training image and the target image are processed in advance to extract corresponding feature data information. Then, a BP neural network is constructed and trained using a large number of training images. The trained BP neural network is then used to recognize the feature data information corresponding to the target image, so that the name of the fruit can be accurately identified. The image processing and recognition are independent of each other. The target image is then enhanced in warm tones and saturation, which makes the color of the target image more intense and vivid, thereby increasing appetite.
[0067] Optionally, after obtaining the training feature data in S1 of one or more embodiments of the present invention, the following steps are also included: the smartphone normalizes the training feature data, and uses the normalized training feature data as input variables of the BP neural network for training.
[0068] Since the units of each variable in the collected target feature data and training feature data are not unified and there are differences in magnitude, the training feature data and target feature data are normalized and converted into dimensionless quantities to eliminate the differences in their units and dimensions, reduce training time, avoid non-convergence, and improve training efficiency and accuracy. After recognition, they are then denormalized to obtain matching recognition results.
[0069] Optionally, after acquiring the target feature data in S3 of one or more embodiments of the present invention, the method further includes the following steps: the smartphone normalizes the acquired target feature data, inputs the normalized target feature data into a trained fruit recognition model for recognition, and performs denormalization after recognition to obtain a matching recognition result. The specific normalization method is described in prior art documents and will not be detailed here.
[0070] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0071] Figure 3 FIG. 1 is a structural diagram of a camera color automatic optimization device based on a fruit recognition algorithm provided by another embodiment of the present invention. Figure 3 As shown, it includes an image processing module 100, a training module 200, a neural network recognition module 300 and a post-processing module 400;
[0072] The image processing module 100 is used to read a training image and perform image processing, perform image feature extraction processing on the processed training image, and obtain training feature data; and to read a target image and perform image processing, perform image feature extraction processing on the processed target image, and obtain target feature data;
[0073] The training module 200 is used to construct a fruit recognition model based on a BP neural network and train the fruit recognition model using training feature data;
[0074] The neural network recognition module 300 is used to input the target feature data into the trained fruit recognition model for recognition and obtain the corresponding recognition result;
[0075] The post-processing module 400 is used to enhance the warm tone and saturation of the target image according to the recognition result.
[0076] In one or more embodiments of the present invention, the image processing module 100 specifically includes a conversion unit, an enhancement unit, a binarization unit, and a labeling unit.
[0077] The conversion unit is used for reading the training image and the target image, and converting the training image and the target image into a digital image;
[0078] The enhancement unit is used to perform denoising and contrast enhancement on the digital image and the target image;
[0079] The binarization unit is used to perform binarization processing on the digital image and the target image after denoising and contrast enhancement processing to obtain the corresponding black and white image;
[0080] The labeling unit is used to perform labeling processing on pixels in the black and white image to complete image processing of the training image and the target image.
[0081] The above preferred embodiment can facilitate computer recognition and subsequent processing by digitally converting the training image; improve recognition accuracy by performing denoising and contrast enhancement processing; and facilitate separation of all pixels by labeling, so that the respective feature information of different pixels can be extracted.
[0082] In one or more embodiments of the present invention, the labeling unit specifically includes:
[0083] a judgment unit, configured to read the RGB value of each pixel in the black-and-white image, and determine that the different pixels are connected if the RGB values of the different pixels are within the same color gamut; otherwise, determine that the different pixels are disconnected;
[0084] The labeling unit is used to label different connected pixels with the same label and complete the labeling processing of pixels in the black and white image.
[0085] The above embodiment determines whether different pixels are connected or disconnected, so that the connected pixels can be separated, thereby facilitating subsequent extraction of feature data information of each pixel.
[0086] Optionally, in one or more embodiments of the present invention, the image processing module 100 further includes a normalization unit.
[0087] The normalization unit is used to normalize the training feature data and use the normalized training feature data as input variables of the fruit recognition model for training; and is used to normalize the target feature data and input the normalized target feature data into the trained fruit recognition model for recognition.
[0088] In the above preferred embodiment, since the units of each variable in the collected target feature data and the training feature data are not unified and there are differences in the order of magnitude, the training feature data and the target feature data are normalized and converted into dimensionless quantities to eliminate the differences in their units and dimensions, reduce the training time, and even prevent convergence, thereby improving the training efficiency and accuracy. After recognition, they are then denormalized to obtain matching recognition results.
[0089] The above embodiment provides a camera color automatic optimization device based on a fruit recognition algorithm. The training image and the target image are processed in advance to extract the corresponding feature data information. Then, a BP neural network is constructed and trained using a large number of training images. The trained BP neural network is then used to recognize the feature data information corresponding to the target image, so that the name of the fruit can be accurately identified. The image processing and recognition are independent of each other. The target image is then enhanced in warm tones and saturation, which makes the color of the target image more intense and vivid, thereby increasing the appetite.
[0090] In one embodiment, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0091] S1, reading a training image and performing image processing, performing image feature extraction processing on the processed training image to obtain training feature data;
[0092] S2, constructing a fruit recognition model based on BP neural network, and using training feature data to train the fruit recognition model;
[0093] S3, reading the target image and performing image processing, performing image feature extraction processing on the processed target image to obtain target feature data;
[0094] S4, inputting the target feature data into the trained fruit recognition model for recognition to obtain a corresponding recognition result;
[0095] S5, performing warm tone and saturation enhancement processing on the target image according to the recognition result.
[0096] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0097] S11, reading the training image and converting the training image into a digital image;
[0098] S12, performing denoising and contrast enhancement processing on the digital image;
[0099] S13, performing binarization processing on the digital image after denoising and contrast enhancement processing to obtain a black and white image;
[0100] S14, performing labeling processing on the pixels in the black and white image to complete the image processing of the training image.
[0101] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0102] Read the RGB value of each pixel in the black and white image. If the RGB values of different pixels are in the same color gamut, the pixels are determined to be connected; otherwise, the pixels are determined to be disconnected.
[0103] Different pixels that are connected to each other are marked with the same label, and the labeling process of pixels in black and white images is completed.
[0104] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: after obtaining the training feature data, normalizing the training feature data, and using the normalized training feature data as input variables of the fruit recognition model for training;
[0105] After obtaining the target feature data, the target feature data is normalized and input into the trained fruit recognition model for recognition.
[0106] The above embodiment proposes a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, an automatic camera color optimization method based on a fruit recognition algorithm is executed. The training image and the target image are processed in advance to extract corresponding feature data information. A BP neural network is then constructed and trained using a large number of training images. The trained BP neural network is then used to recognize the feature data information corresponding to the target image, thereby accurately identifying the name of the fruit. The image processing and recognition are independent of each other. The target image is then enhanced in warm tones and saturation, thereby making the color of the target image more intense and vivid, thereby increasing appetite.
[0107] Figure 4 This is an internal structure diagram of a computer device in an embodiment. The computer device can be a smart phone, a laptop, or other mobile terminals or fixed terminals. Figure 4As shown, it includes a memory 81 and a processor 80. The memory 81 stores a computer program 82. When the processor 80 executes the computer program 82, the following steps are implemented:
[0108] S1, reading a training image and performing image processing, performing image feature extraction processing on the processed training image to obtain training feature data;
[0109] S2, constructing a fruit recognition model based on BP neural network, and using training feature data to train the fruit recognition model;
[0110] S3, reading the target image and performing image processing, performing image feature extraction processing on the processed target image to obtain target feature data;
[0111] S4, inputting the target feature data into the trained fruit recognition model for recognition to obtain a corresponding recognition result;
[0112] S5, performing warm tone and saturation enhancement processing on the target image according to the recognition result.
[0113] In one embodiment, when the processor 80 executes the computer program 82, the processor 80 further implements the following steps:
[0114] S11, reading the training image and converting the training image into a digital image;
[0115] S12, performing denoising and contrast enhancement processing on the digital image;
[0116] S13, performing binarization processing on the digital image after denoising and contrast enhancement processing to obtain a black and white image;
[0117] S14, performing labeling processing on the pixels in the black and white image to complete the image processing of the training image.
[0118] In one embodiment, when the processor 80 executes the computer program 82, the processor 80 further implements the following steps:
[0119] Read the RGB value of each pixel in the black and white image. If the RGB values of different pixels are in the same color gamut, the pixels are determined to be connected; otherwise, the pixels are determined to be disconnected.
[0120] Different pixels that are connected to each other are marked with the same label, and the labeling process of pixels in black and white images is completed.
[0121] In one embodiment, when the processor 80 executes the computer program 82, the processor 80 further implements the following steps:
[0122] After obtaining the training feature data, the training feature data is normalized, and the normalized training feature data is used as an input variable of the fruit recognition model for training;
[0123] After obtaining the target feature data, the target feature data is normalized and input into the trained fruit recognition model for recognition.
[0124] In the above embodiment, image processing is performed on the training image and the target image in advance to extract the corresponding feature data information. Then, a BP neural network is constructed and trained using a large number of training images. The trained BP neural network is then used to recognize the feature data information corresponding to the target image, so that the name of the fruit can be accurately identified. The image processing and recognition are independent of each other. The target image is then enhanced in warm tones and saturation, which makes the color of the target image more intense and vivid, thereby increasing appetite.
[0125] Those skilled in the art will understand that Figure 4 This is only an example of the terminal of the present invention and does not constitute a limitation on the terminal. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal may also include a power management module, an operation processing module, input and output devices, network access devices, a bus, etc.
[0126] The processor 80 may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0127] The memory 81 can be an internal storage unit of the terminal, such as a hard drive or memory. The memory 81 can also be an external storage device of the terminal, such as a plug-in hard drive equipped on the compass calibration terminal, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. Furthermore, the memory 81 can include both the internal storage unit of the compass calibration terminal and an external storage device. The memory 81 is used to store computer programs and other programs and data required by the compass calibration terminal. The memory 81 can also be used to temporarily store data that has been output or is about to be output.
[0128] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the terminal can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned device refers to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0129] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0130] Those skilled in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0131] In the embodiments provided herein, it should be understood that the disclosed terminals / terminal devices and methods can be implemented in other ways. For example, the terminal / terminal device embodiments described above are merely illustrative. For example, the division of modules or units is merely a logical functional division. In actual implementation, other division methods may be used, such as combining or integrating multiple units or components into another device, or omitting or not implementing certain features. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interface, while the indirect coupling or communication connection of the terminals or units may be electrical, mechanical, or other forms.
[0132] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0133] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0134] The present invention is not limited to what is described in the specification and embodiments, and additional advantages and modifications will be readily apparent to those skilled in the art. Therefore, the present invention is not limited to the specific details, representative devices, and illustrative examples shown and described herein without departing from the spirit and scope of the general concept defined by the claims and their equivalents.
Claims
1. A camera color automatic optimization method based on fruit recognition algorithm, characterized in that: The steps include: Reading the training image and performing image processing, performing image feature extraction processing on the trained image after image processing, and obtaining training feature data; Constructing a fruit recognition model based on a BP neural network, and using the training feature data to train the fruit recognition model; Read the target image and perform image processing, perform image feature extraction on the processed target image, and obtain target feature data; Inputting the target feature data into the trained fruit recognition model for recognition to obtain a corresponding recognition result; Performing warm tone and saturation enhancement processing on the target image according to the recognition result; The steps of reading the training image and performing image processing include: Reading the training image and converting the training image into a digital image; performing denoising and contrast enhancement processing on the digital image; Binarizing the digital image after denoising and contrast enhancement to obtain a black and white image; performing labeling processing on pixels in the black and white image to complete image processing of the training image; The labeling process for pixels in the black and white image specifically includes the following steps: Reading the RGB value of each pixel in the black-and-white image, and determining that the different pixels are connected if the RGB values of the different pixels are within the same color gamut, otherwise determining that the different pixels are disconnected; Different pixels connected to each other are marked with the same label, and the labeling process of the pixels in the black and white image is completed.
2. The camera color automatic optimization method based on the fruit recognition algorithm according to claim 1, characterized in that: After obtaining the training feature data, the following steps are also included: Normalizing the training feature data, and using the normalized training feature data as input variables of the fruit recognition model for training; After obtaining the target feature data, the following steps are also included: The target feature data is normalized, and the normalized target feature data is input into the trained fruit recognition model for recognition.
3. A camera color automatic optimization device based on a fruit recognition algorithm, characterized by: Includes image processing module, training module, neural network recognition module and post-processing module; The image processing module is used to read the training image and perform image processing, and perform image feature extraction processing on the trained image after image processing to obtain training feature data; and for reading a target image and performing image processing, performing image feature extraction processing on the target image after image processing, and obtaining target feature data; The training module is used to construct a fruit recognition model based on a BP neural network, and train the fruit recognition model using the training feature data; The neural network recognition module is used to input the target feature data into the trained fruit recognition model for recognition to obtain a corresponding recognition result; The post-processing module is used to enhance the warm tone and saturation of the target image according to the recognition result; The image processing module specifically includes a conversion unit, an enhancement unit, a binarization unit and a labeling unit. The conversion unit is used to read the training image and the target image, and convert the training image and the target image into digital images; The enhancement unit is used to perform denoising and contrast enhancement processing on the digital image and the target image; The binarization unit is used to perform binarization processing on the digital image and the target image after denoising and contrast enhancement processing to obtain corresponding black and white images; The labeling unit is used to perform labeling processing on pixels in the black and white image to complete image processing of the training image and the target image; The labeling unit specifically includes: a judgment unit, configured to read the RGB value of each pixel in the black-and-white image, and determine that the different pixels are connected if the RGB values of the different pixels are within the same color gamut; otherwise, determine that the different pixels are disconnected; The labeling unit is used to label different interconnected pixels with the same label and complete the labeling process of the pixels in the black and white image.
4. The camera color automatic optimization device based on the fruit recognition algorithm according to claim 3, characterized in that: The image processing module further includes a normalization unit, The normalization unit is used to perform normalization processing on the training feature data, and use the normalized training feature data as input variables of the fruit recognition model for training; And it is used to normalize the target feature data and input the normalized target feature data into the trained fruit recognition model for recognition.
5. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the camera color automatic optimization method based on the fruit recognition algorithm according to claim 1 or 2 is implemented.
6. A camera color automatic optimization terminal based on fruit recognition algorithm, characterized in that: The method comprises the storage medium and the processor according to claim 5, wherein when the processor executes the computer program on the storage medium, the steps of the camera color automatic optimization method based on the fruit recognition algorithm according to claim 1 or 2 are implemented.
Citation Information
Patent Citations
Fruit recognition method and device based on deep learning
CN108319894A