Image processing method and device, equipment and storage medium
By processing the internal images of the steam oven, segmenting the background and target objects, determining the ambient light and depth map, eliminating the interference of water mist and oil stains, improving the contrast and accuracy of food identification, and solving the problem of low image recognition accuracy in the steam oven. Supports automatic cooking implementation.
Patent Information
- Application Number
- CN202411341896.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-31
AI Technical Summary
The water mist and oil stains in the existing steam oven during cooking lead to a reduced image recognition accuracy, making it difficult to automatically identify ingredients and set appropriate heating methods and times.
By obtaining the original image inside the cooking device, segmenting the background and target objects, determining the ambient light and depth map, inputting it into the interference degradation model, eliminating water mist and oil pollution interference, improving the contrast of the food, thereby improving the recognition accuracy.
It effectively eliminates water mist and oil pollution interference, improves the contrast and accuracy of food identification, and supports the realization of automatic cooking.
Smart Images

Figure CN119228837A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology, and in particular, relates to an image processing method, device, equipment and storage medium. Background Art
[0002] With the improvement of living standards, smart home appliances have brought a lot of convenience to life. For current steam ovens, the steaming and baking parameter settings of steam ovens of different brands and models are not the same. In order to steam and bake delicious food, users need to master the various heating methods, heating temperatures and heating time settings of the steam ovens. In addition, the settings of heating methods, heating temperatures and heating time are also different for different ingredients. For users who have no steaming and baking experience or are inexperienced, it is difficult to set the appropriate heating method, heating temperature and heating time for a certain ingredient. In the related art, image recognition technology is used to identify the type of ingredients and automatically cook them. However, when the steam oven is cooking, water mist and oil stains will appear on the glass plate of the steam oven. These water mist and oil stains will affect the shooting (for example, shooting from the outside, or shooting from the inside if conditions permit) of the internal picture of the steam oven, thereby affecting the recognition accuracy. Summary of the invention
[0003] The embodiments of the present application provide an image processing method, device, electronic device and storage medium, which can process the collected original images, improve the contrast of food ingredients, thereby improving the recognition accuracy and facilitating automatic cooking.
[0004] According to a first aspect of the present application, an embodiment of the present application provides an image processing method, including:
[0005] Acquire an original image captured by a capture device of the interior of the cooking device;
[0006] Segmenting the original image to obtain a background image and a target object image, and determining ambient light based on the background image;
[0007] determining a depth map based on the image of the target object;
[0008] The ambient light, the depth map and the original image are input into an interference degradation model suitable for a cooking environment to obtain a target image.
[0009] In some embodiments, the interference degradation model is used to simulate the impact of the cooking environment on image quality and to eliminate the impact.
[0010] The contrast between the target object in the target image obtained by the interference degradation model and the background of the target image is increased relative to the contrast between the target object in the original image and the background of the original image.
[0011] The interference degradation model includes: a fuzzy interference degradation model based on dark channel prior.
[0012] The blur interference degradation model is used to simulate the image quality interference factors that cause image blur and try to eliminate their influence.
[0013] In some embodiments, segmenting the original image to obtain a background image and a target object image includes:
[0014] The original image is input into the image segmentation algorithm model to obtain the background image and the target object image.
[0015] In some embodiments, determining a depth map based on the image of the target includes:
[0016] The image of the target object is input into a pre-trained neural network model to output a depth map.
[0017] In some embodiments, the method further comprises:
[0018] The target image is input into a food recognition model to obtain a recognition result of the target object, so as to perform corresponding cooking based on the recognition result.
[0019] According to a second aspect of the present application, an embodiment of the present application provides an image processing device, including:
[0020] An acquisition module, used to acquire an original image captured by a capture device on the inside of the cooking device;
[0021] A first determination module is used to segment the original image to obtain a background image and a target object image, and determine the ambient light based on the background image;
[0022] A second determination module, configured to determine a depth map based on the image of the target object;
[0023] The third determination module is used to input the ambient light, the depth map and the original image into an interference degradation model suitable for a cooking environment to obtain a target image.
[0024] According to the third aspect of the present application, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the methods described above when executing the computer program.
[0025] According to a fourth aspect of the present application, an embodiment of the present application provides a smart cooking device, including: the electronic device described above.
[0026] According to a fifth aspect of the present application, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the above is implemented.
[0027] According to the sixth aspect of the present application, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the electronic device to execute any of the methods described above.
[0028] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0029] The image processing method provided in the embodiment of the present application obtains an original image collected by an acquisition device targeting the inside of a cooking device; segments the original image to obtain a background image and a target object image, and determines the ambient light based on the background image; determines a depth map based on the target object image; inputs the ambient light, the depth map, and the original image into an interference degradation model suitable for a cooking environment to obtain a target image, and can process the collected original image, thereby improving the contrast of food ingredients and thus improving recognition accuracy.
[0030] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0032] Figure 1 A schematic diagram of an implementation flow of an image processing method provided for the implementation of this application;
[0033] Figure 2 A flowchart of another image processing method provided in an embodiment of the present application;
[0034] Figure 3 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;
[0035] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0037] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0038] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0039] As used in the specification of this application and the appended claims, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to image processing" depending on the context. Similarly, the phrases "if it is determined" or "if the image is processed" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce the image is processed" or "in response to image processing" depending on the context.
[0040] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0041] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
[0042] Based on the technical problems of the related technology, the embodiments of the present application provide an image processing method that can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), steam ovens, etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0043] The functions implemented by the image processing method provided in the embodiment of the present application can be implemented by calling program codes by a processor of an electronic device, wherein the program codes can be stored in a computer storage medium.
[0044] The present application provides an image processing method. Figure 1 A schematic diagram of an implementation flow of an image processing method provided for the implementation of this application is as follows: Figure 1 As shown, the image processing method includes:
[0045] Step S101: acquiring an original image captured by a capturing device of the interior of a cooking device.
[0046] In the embodiment of the present application, the acquisition device may be an image capture device such as a camera, and the cooking device may include a steam oven, a microwave oven, etc.
[0047] The following is an explanation using a steam oven as an example.
[0048] The steam oven usually has a glass plate through which the image inside the steam oven can be captured.
[0049] In the embodiment of the present application, due to the temperature in the steam oven and other reasons, an image acquisition device is usually not provided in the steam oven. In this case, the original image in the steam oven can be acquired from the outside of the steam oven by using the camera on the mobile phone, and then the original image can be sent to the electronic device, so that the electronic device can obtain the original image acquired by the acquisition device for the inside of the steam oven. However, in some cases, an image acquisition device can also be provided in the cooking device to take images. The present invention does not impose any limitation on this.
[0050] In the present invention, image acquisition is aimed at shooting inside the cooking equipment.
[0051] In the embodiment of the present application, since water mist and oil stains will appear on the glass plate of the steam oven when cooking, the oil stains and / or water mist will usually be collected when the original image is collected, that is, the original image may include: the image of the interior of the steam oven and the water mist and / or oil stains on the glass plate.
[0052] In the embodiment of the present application, since the original image contains oil stains and / or water mist, the recognition accuracy will be reduced during recognition. Therefore, in the embodiment of the present application, the original image will be processed.
[0053] Step S102 : segmenting the original image to obtain a background image and a target image, and determining the ambient light based on the background image.
[0054] In the embodiment of the present application, the target object may be, for example, food materials or other objects.
[0055] In an embodiment of the present application, the original image can be input into an image segmentation algorithm model to obtain an image of the background and an image of the target object. The image segmentation algorithm model can be a deep learning algorithm model, and the deep learning algorithm model can include: U-Net, Mask R-CNN, etc.
[0056] Exemplarily, the image segmentation algorithm model can be trained by training data. Taking U-Net as an example, training data can be obtained, and the training data includes: an input image and a corresponding depth map. The input image can be an RGB image, a grayscale image, etc. The standard structure of U-Net can be used to train the image segmentation algorithm model. U-Net extracts features through an encoder and generates an output image through a decoder. In an embodiment of the present application, a suitable loss function is selected to measure the quality of the generated depth map. Commonly used loss functions include mean square error (MSE), structural similarity (SSIM), etc. U-Net can be trained using a prepared data set. Make sure to use appropriate data enhancement techniques to improve the generalization ability of the model. After the training is completed, you can use the model to infer the new input image and generate the corresponding depth map.
[0057] In an embodiment of the present application, U-Net includes: an encoder (downsampling path), a skip connection, a decoder, and an output layer, wherein the encoder is usually composed of multiple convolutional layers and pooling layers. Each layer extracts more and more features while reducing the spatial resolution. After each convolution step, the ReLU activation function is applied, usually with 3x3 convolution and 2x2 maximum pooling as the basic unit. U-Net uses skip connections to combine the feature map of the encoder part with the feature map of the decoder part, so that high-resolution information can be retained. Skip connections enable the network to utilize contextual information and detail information at the same time. Decoder (upsampling path): The spatial resolution of the image is gradually restored through transposed convolution (upsampling). Each decoder block is connected to the feature map of the corresponding encoder block to help the model learn how to combine context and fine features. Output layer: Finally, a 1x1 convolution layer is used to convert the output of the decoder into the required number of output channels, usually a binary image or multi-class segmentation.
[0058] In an embodiment of the present application, the background image can be analyzed to determine the ambient light, and the intensity of the ambient light can be calculated by analyzing the background characteristics (brightness, color). By calculating the intensity of the ambient light, it can help adjust the lighting effects in subsequent image processing steps, making the processing results of the target image more accurate.
[0059] In an embodiment of the present application, the ambient light is obtained by calculating the average brightness of the background image, the color space (such as the brightness channel in the HSV model), etc. The background image to be obtained can be preprocessed, including: converting to an appropriate color space, such as HSV (hue, saturation, brightness) or LAB (brightness, green / red channel, blue / yellow channel) to better analyze the brightness and color. De-noising (such as high-pass filtering) is used to remove unnecessary details and textures in the image, so that the estimation of ambient light is more accurate. Then the brightness information of the background image is calculated. Taking the HSV color space as an example, the brightness channel (V channel) can be obtained and its average value can be calculated, the color distribution of the background image can be analyzed, and the average hue and saturation can be calculated. According to the brightness and color information obtained, an ambient light vector is constructed to obtain the ambient light.
[0060] Step S103: determining a depth map based on the image of the target object.
[0061] In an embodiment of the present application, a depth map is obtained through an image of the target object using a depth estimation algorithm (such as stereo vision, monocular depth estimation, etc.) to provide spatial information for subsequent processing.
[0062] In some embodiments, the image of the target object may be input into a pre-trained neural network model to output a depth map.
[0063] In an embodiment of the present application, the image of the target object can be appropriately preprocessed before being input into the neural network, such as adjusting the image size, normalization, and color space conversion, etc., to meet the input requirements of the model. Use a deep learning framework (such as TensorFlow, PyTorch, etc.) to load a trained neural network model. These models can be convolutional neural networks (CNN) or other architectures suitable for depth estimation, such as U-Net, ResNet, Monodepth, etc. The prepared target object image is input into the neural network for forward reasoning. The model will use its learned features and patterns to predict depth information from the input image. The output of the neural network will be a depth map, usually a grayscale image, where each pixel value represents the depth information at the corresponding position.
[0064] Step S104: input the ambient light, the depth map and the original image into an interference degradation model suitable for a cooking environment to obtain a target image.
[0065] In an embodiment of the present application, the ambient light, the depth map and the original image may be input into an interference degradation model to obtain a target image.
[0066] In the embodiment of the present application, the interference degradation model is used to simulate the impact of the cooking environment on the image quality and to eliminate the impact.
[0067] The contrast between the target object in the target image obtained by the interference degradation model and the background of the target image is increased relative to the contrast between the target object in the original image and the background of the original image.
[0068] In the embodiment of the present application, the interference degradation model may include a fuzzy interference degradation model.
[0069] According to an embodiment of the present application, the blur interference degradation model is used to simulate image quality interference factors that cause image blur and attempt to eliminate their influence.
[0070] Specifically, the fuzzy interference degradation model may include a fog degradation model.
[0071] Fog degradation models are usually used to simulate the degradation process of images under foggy conditions. The basis of the model is atmospheric scattering theory, in which the clarity of the image is related to the environmental conditions, lighting and depth information. The ambient light information (such as light intensity and color temperature), depth map (indicating the depth information of each pixel) and original image (image containing the target object) can be prepared into a format suitable for model input. This usually includes adjusting the dimensions and channels of the data. The ambient light, the depth map and the original image are then input into the fog degradation model, and the model output will be a processed image, which usually shows the target object under improved conditions. By processing the ambient light and depth information, the details and contrast of the image are enhanced, making the target object more prominent.
[0072] In the embodiment of the present application, the target image can be considered as an image after removing or reducing fog interference. The target image can significantly improve the contrast between the target object and the background, providing clearer image data for subsequent image analysis and target recognition.
[0073] Similarly, oil pollution treatment can also be performed. Therefore, in some embodiments, the interference degradation model can include an oil pollution degradation model. In view of the length of the article, the oil pollution treatment is not described in detail here.
[0074] Furthermore, in some embodiments, the interference degradation model may include: a fog and / or oil degradation model.
[0075] In the embodiment of the present application, the target image can be considered as an image after removing or reducing the interference of fog and / or oil pollution. The target image can significantly improve the contrast between the target object and the background, providing clearer image data for subsequent image analysis and target recognition.
[0076] Here, fog and oil are important factors that cause blur in images taken inside cooking equipment. In addition to fog and oil, there may be other factors in the cooking environment that cause image blur. These factors can be included in the blur interference degradation model to simulate interference and eliminate the impact to obtain high-definition and high-contrast images.
[0077] In an embodiment of the present application, a dark channel map of the input foggy image can be calculated. The calculation of the dark channel is usually based on the minimum value of the RGB value of each pixel in a local window. By analyzing the highlight area in the dark channel image, the atmospheric light value can be estimated. Usually, pixels with higher dark channel values are selected and their corresponding original image RGB values are calculated, and the maximum value is taken as the atmospheric light. The transmission map shows the degree of haze for each pixel. The transmission map can be derived by using a priori derivation of the dark channel. In the part without fog, the transmission value is close to 1; while in the part with fog, the transmission value will be reduced. The target image can be calculated using the estimated transmission map and the atmospheric light value.
[0078] In the embodiment of the present application, a blur interference degradation model based on dark channel prior is used to remove blur (such as defogging and / or degreasing) for image restoration. The model uses the statistical characteristics of image pixels in natural scenes to restore images affected by blur (such as haze and / or oil stains).
[0079] Similarly, in some embodiments, the interference degradation model may include: a fog and / or oil degradation model based on a dark channel prior.
[0080] The image processing method provided in the embodiment of the present application obtains an original image collected by an acquisition device targeting the inside of a cooking device; segments the original image to obtain a background image and a target object image, and determines the ambient light based on the background image; determines a depth map based on the target object image; inputs the ambient light, the depth map, and the original image into an interference degradation model suitable for a cooking environment to obtain a target image, and can process the collected original image, thereby improving the contrast of food ingredients and thus improving recognition accuracy.
[0081] In some embodiments, after step S104, the method further includes:
[0082] Step S105, inputting the target image into an ingredient recognition model to obtain a recognition result of the target object, so as to perform corresponding cooking based on the recognition result.
[0083] In the embodiment of the present application, the recognition result may include: classification label, confidence score and bounding box information.
[0084] In an embodiment of the present application, before the target image is input into the recognition model, some preprocessing operations are usually required to ensure the quality of the image and the input requirements applicable to the model. The preprocessing steps may include: image scaling, denoising, and normalization. The processed image is then input into the food recognition model. The model can be a convolutional neural network (CNN), a support vector machine (SVM), or other machine learning algorithms based on deep learning. This step involves the forward propagation process of the model. The model outputs the recognition results of the food in the input image, usually in the following formats: Classification label: the type of food recognized (such as "tomato", "cucumber", etc.). Confidence score: the confidence score of the model for the classification result, usually expressed as a percentage. Bounding box information (if applicable): mark the location of the recognized food in the image.
[0085] In the embodiments of the present application, through identification, the identification results can be applied to a variety of scenarios, such as smart kitchen assistant, food safety monitoring, nutritional analysis, recipe recommendations, etc.
[0086] In some embodiments, corresponding cooking can also be performed based on the recognition results.
[0087] In the embodiment of the present application, the relevant information of each ingredient is obtained according to the recognition result, including nutritional content, suitable cooking methods, matching suggestions, etc. Suitable recipes are recommended according to the recognized ingredients. A database or API can be used to obtain recipe information. The recipe information provides detailed cooking steps, including cooking time, etc. The cooking device can automatically cook the ingredients based on the cooking time. It is also possible to semi-automatically cook the ingredients through the cooking device with human participation and intervention.
[0088] In some embodiments, the cooking information also includes: preparation time, cooking time, required tools and materials, etc. The user can manually control the cooking device to work according to the cooking information.
[0089] Based on the foregoing embodiments, the embodiments of the present application further provide an image processing method, which inputs the image data output by the camera into the U-NET network to segment the approximate area of the target image, and obtains the estimated depth map and ambient light intensity of the image based on this. The estimated depth map and ambient light intensity are input into a fog degradation model based on a dark channel prior to generate an image that removes fog and oil stains in the image, thereby optimizing the effect of subsequent image recognition.
[0090] Figure 2 A schematic diagram of an implementation flow of an exemplary image processing method provided in an embodiment of the present application is shown in FIG. Figure 2 As shown,
[0091] Step S201, obtaining an original image.
[0092] Step S202, segment the image through U-NET.
[0093] In the embodiment of the present application, the target image and the background are distinguished through the image segmentation capability of U-NET, so as to more accurately estimate the ambient light and avoid interference from the target object or oil stains.
[0094] Step S203 and step S204 are performed after step S202.
[0095] Step S203, obtaining a depth map of the image (the same as the depth map in the above embodiment) through the segmented image.
[0096] In the embodiment of the present application, the estimated depth map obtained by U-NET can be relied upon.
[0097] Step S204: estimate the ambient lighting by acquiring the area outside the target object.
[0098] Step S205: input the above parameters and the original image into the fog degradation model.
[0099] In an embodiment of the present application, the ambient light estimation, the estimated depth map, and the original image are input into a fog degradation model to generate an image after removing fog and oil interference, thereby significantly improving the contrast between the target object and the background.
[0100] Step S206, generating an image after the fog is eliminated.
[0101] The method provided in the embodiment of the present application can increase the contrast of the image, eliminate the water mist and oil stains, and improve the recognition accuracy in an environment where the image is contaminated by water mist or oil stains.
[0102] 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 application.
[0103] According to the aforementioned embodiments, the embodiments of the present application provide an image processing device, and the modules included in the device, as well as the units included in the modules, can be implemented by a processor in a computer device; of course, they can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Microprocessor Unit), a digital signal processor (DSP, Digital Signal Processing) or a field programmable gate array (FPGA, Field Programmable Gate Array), etc.
[0104] The present application provides an image processing device. Figure 3 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the image processing device 300 includes:
[0105] An acquisition module 301 is used to acquire an original image captured by a capture device of the inside of a cooking device;
[0106] A first determination module 302 is used to segment the original image to obtain a background image and a target object image, and determine the ambient light based on the background image;
[0107] A second determination module 303, configured to determine a depth map based on the image of the target object;
[0108] The third determination module 304 is used to input the ambient light, the depth map and the original image into an interference degradation model suitable for a cooking environment to obtain a target image.
[0109] In some embodiments, the interference degradation model is used to simulate the impact of the cooking environment on image quality and to eliminate the impact.
[0110] The contrast between the target object in the target image obtained by the interference degradation model and the background of the target image is increased relative to the contrast between the target object in the original image and the background of the original image.
[0111] In some embodiments, the interference degradation model includes: a cooking environment interference degradation model based on dark channel prior.
[0112] In some embodiments, segmenting the original image to obtain a background image and a target object image includes:
[0113] The original image is input into the image segmentation algorithm model to obtain the background image and the target object image.
[0114] In some embodiments, determining a depth map based on the image of the target includes:
[0115] The image of the target object is input into a pre-trained neural network model to output a depth map.
[0116] In some embodiments, the image processing apparatus 300 further includes:
[0117] The recognition module is used to input the target image into the food recognition model to obtain the recognition result of the target object, so as to perform corresponding cooking based on the recognition result.
[0118] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0119] in addition, Figure 3 The image processing device shown may be a software unit, a hardware unit, or a unit combining software and hardware built into an existing electronic device, or may be integrated into the electronic device as an independent accessory, or may exist as an independent terminal device.
[0120] The technicians in the relevant field 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 practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device 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 in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in 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 system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0121] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device 3 of this embodiment may include: at least one processor 30 ( Figure 4 Only one processor 30 is shown in the figure), a memory 31, and a computer program 32 stored in the memory 31 and executable on at least one processor 30. When the processor 30 executes the computer program 32, the steps in any of the above-mentioned method embodiments are implemented. For example, Figure 1 Steps S101 to S104 in the illustrated embodiment. Alternatively, when the processor 30 executes the computer program 32, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 3 Functions of modules 401 to 404 are shown.
[0122] Exemplarily, the computer program 32 may be divided into one or more modules / units, one or more modules / units are stored in the memory 31, and are executed by the processor 30 to complete the present application. One or more modules / units may be a series of computer program 32 instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 32 in the electronic device 3.
[0123] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program 32. When the computer program 32 is executed by the processor 30, the steps in the above-mentioned method embodiments can be implemented.
[0124] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0125] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. According to this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program 32, and the computer program 32 can be stored in a computer-readable storage medium, and the computer program 32 can implement the steps of the above-mentioned various method embodiments when executed by the processor 30. Among them, the computer program 32 includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the terminal, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0126] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0127] Those of ordinary skill in the art will appreciate that the units and algorithm 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. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0128] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0129] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0130] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. An image processing method, characterized in that: include: Acquire an original image captured by a capture device of the interior of the cooking device; Segmenting the original image to obtain a background image and a target object image, and determining ambient light based on the background image; determining a depth map based on the image of the target object; The ambient light, the depth map and the original image are input into an interference degradation model suitable for a cooking environment to obtain a target image.
2. The method according to claim 1, characterized in that: The interference degradation model is used to simulate the impact of the cooking environment on the image quality and to eliminate the impact. The contrast between the target object in the target image obtained by the interference degradation model and the background of the target image is increased relative to the contrast between the target object in the original image and the background of the original image.
3. The method according to claim 1 or 2, characterized in that: The interference degradation model includes: a fuzzy interference degradation model based on dark channel prior.
4. The method according to claim 1 or 2, characterized in that: The step of segmenting the original image to obtain a background image and a target object image includes: The original image is input into the image segmentation algorithm model to obtain the background image and the target object image.
5. The method according to claim 1 or 2, characterized in that: The determining of a depth map based on an image of the target comprises: The image of the target object is input into a pre-trained neural network model to output a depth map.
6. The method according to claim 1 or 2, characterized in that: The method further comprises: The target image is input into a food recognition model to obtain a recognition result of the target object, so as to perform corresponding cooking based on the recognition result.
7. An image processing device, characterized in that: include: An acquisition module, used to acquire an original image captured by a capture device on the inside of the cooking device; A first determination module is used to segment the original image to obtain a background image and a target object image, and determine the ambient light based on the background image; A second determination module, configured to determine a depth map based on the image of the target object; The third determination module is used to input the ambient light, the depth map and the original image into an interference degradation model suitable for a cooking environment to obtain a target image.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. An intelligent cooking device, characterized in that: include: The electronic device as claimed in claim 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
