CN112446853A - Method and device for detecting grain state, cooking equipment and computer storage medium - Google Patents

Method and device for detecting grain state, cooking equipment and computer storage medium Download PDF

Info

Publication number
CN112446853A
CN112446853A CN201910824427.6A CN201910824427A CN112446853A CN 112446853 A CN112446853 A CN 112446853A CN 201910824427 A CN201910824427 A CN 201910824427A CN 112446853 A CN112446853 A CN 112446853A
Authority
CN
China
Prior art keywords
picture
average gray
gray scale
grain
grains
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910824427.6A
Other languages
Chinese (zh)
Other versions
CN112446853B (en
Inventor
杨应彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Foshan Shunde Midea Electrical Heating Appliances Manufacturing Co Ltd
Original Assignee
Foshan Shunde Midea Electrical Heating Appliances Manufacturing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Foshan Shunde Midea Electrical Heating Appliances Manufacturing Co Ltd filed Critical Foshan Shunde Midea Electrical Heating Appliances Manufacturing Co Ltd
Priority to CN201910824427.6A priority Critical patent/CN112446853B/en
Publication of CN112446853A publication Critical patent/CN112446853A/en
Application granted granted Critical
Publication of CN112446853B publication Critical patent/CN112446853B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Cold Air Circulating Systems And Constructional Details In Refrigerators (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)

Abstract

The embodiment of the application discloses a method and a device for detecting grain states and a computer storage medium, wherein the method comprises the following steps: acquiring a first picture of the grain; determining an average gray level of the first picture; and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component.

Description

Method and device for detecting grain state, cooking equipment and computer storage medium
Technical Field
The present application relates to the field of intelligent detection technologies, and in particular, to a method and an apparatus for detecting grain status, a cooking device, and a computer storage medium.
Background
With the development of technology, full-automatic electric rice cookers with rice boxes have appeared on the market at present, and a certain amount of rice can be stored in the rice boxes. After the full-automatic electric rice cooker starts a cooking procedure, the rice enters the cooker body of the electric rice cooker from the rice box, and then the rice is washed, and then the rice is put into the cooker body for cooking. However, the rice stored in the fully automatic rice cooker sometimes becomes stale or even exceeds the shelf life due to the fact that the rice is stored for too long because the user goes on a business trip for a long time or fails to eat the rice frequently for other reasons. If the user does not notice that the automatic cooking is started by remote or manual operation, stale rice is consumed, and physical discomfort or even diseases may be caused.
Disclosure of Invention
In view of the above, embodiments of the present application provide a method, an apparatus, a cooking device, and a computer storage medium for detecting a state of grains to solve at least one problem in the prior art, so as to detect a freshness of the grains.
In order to achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:
in a first aspect, the present embodiments provide a method for detecting a grain state, the method including:
acquiring a first picture of the grain;
determining an average gray level of the first picture;
and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component.
Further, in a case that the first picture is a color picture, the determining an average gray scale of the first picture includes:
calculating an average gray level of the first picture based on the color information of the first picture.
Further, the calculating an average gray level of the first picture based on the color information of the first picture includes:
calculating a gray value of each pixel in the first picture based on the color information of each pixel in the first picture;
accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first picture, and dividing the accumulated result by the number of the pixels in the first picture to obtain the average gray of the first picture.
Further, the comparing the average gray scale of the first picture with a standard average gray scale and determining whether to output prompt information based on the comparison result includes:
calculating the difference value of the average gray scale of the first picture and the standard average gray scale;
and if the difference value between the average gray scale of the first picture and the standard average gray scale is larger than or equal to a first threshold value, outputting the prompt message.
Further, the grain storage part is provided in the cooking apparatus;
the outputting the prompt message comprises:
displaying the prompt information through a display device in the cooking equipment; and/or the presence of a gas in the gas,
playing the prompt message through an audio device in the cooking equipment; and/or the presence of a gas in the gas,
sending the prompt information to a terminal device through a communication device in the cooking device
Further, the method further comprises:
when an end signal of a grain adding event is detected, acquiring a second picture of the grain;
and determining the average gray scale of the second picture, and taking the average gray scale of the second picture as the standard average gray scale.
Further, the method further comprises:
when a starting signal of a grain adding event is detected, acquiring a second picture of the grain according to a preset time interval until an ending signal of the grain adding event is detected, and acquiring at least one second picture of the grain;
and determining the average gray scale corresponding to at least one second picture of the grains respectively, and taking the average value of the average gray scales corresponding to the at least one second picture as the standard average gray scale.
In a second aspect, an embodiment of the present application provides an apparatus for detecting a grain state, where the apparatus includes a shooting module and a processing module; wherein:
the shooting module is used for acquiring a first picture of the grains;
the processing module is used for determining the average gray scale of the first picture; and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component.
Further, when the first picture is a color picture, the processing module is further configured to calculate an average gray scale of the first picture based on the color information of the first picture.
Further, the processing module is further configured to calculate a gray scale value of each pixel in the first picture based on the color information of each pixel in the first picture;
accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first picture, and dividing the accumulated result by the number of the pixels in the first picture to obtain the average gray of the first picture.
Further, the processing module is further configured to calculate a difference between the average gray scale of the first picture and a standard average gray scale;
and if the difference value between the average gray scale of the first picture and the standard average gray scale is larger than or equal to a first threshold value, outputting the prompt message.
Further, the grain storage part is provided in the cooking apparatus;
the processing module is further used for displaying the prompt information through a display device in the cooking equipment; and/or the presence of a gas in the gas,
playing the prompt message through an audio device in the cooking equipment; and/or the presence of a gas in the gas,
and sending the prompt information to a terminal device through a communication device in the cooking device.
Further, the shooting module is further configured to obtain a second picture of the grain when an end signal of a grain addition event is detected;
the processing module is further configured to determine an average gray scale of the second picture, and use the average gray scale of the second picture as the standard average gray scale.
Further, the shooting module is further configured to, when a start signal of a grain addition event is detected, obtain a second picture of the grain at a predetermined time interval until an end signal of the grain addition event is detected, and obtain at least one second picture of the grain;
the processing module is further configured to determine average gray levels corresponding to at least one second picture of the grain, and use an average value of the average gray levels corresponding to the at least one second picture as the standard average gray level.
In a third aspect, an embodiment of the present application provides a cooking apparatus, which includes a grain storage component, an image acquisition module, and a data processor; wherein:
the grain storage component is used for storing grains;
the image acquisition module is used for acquiring a first picture of the grains;
the data processor is used for determining the average gray scale of the first picture; and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component.
In a fourth aspect, an embodiment of the present application provides a cooking apparatus, which includes a network interface, a memory, and a processor; wherein,
the network interface is configured to realize connection communication between the components;
the memory configured to store a computer program operable on the processor;
the processor is configured to perform the method of the first aspect when running the computer program.
In a fifth aspect, embodiments of the present application provide a computer storage medium storing a computer program, which when executed by at least one processor implements performing the method of the first aspect.
The method, the device, the cooking equipment and the computer storage medium for detecting the grain state provided by the embodiment of the application acquire a first picture of the grain; determining an average gray level of the first picture; and comparing the average gray scale of the first picture with a standard average gray scale, wherein the comparison result represents the freshness of the grains, and determining whether prompt information is output or not based on the comparison result, wherein the prompt information is used for prompting the freshness of the grains in the grain storage component. So, realized the short-term test to cereal state for the user accurately obtains the fresh degree of cereal in the cereal storage part in time, thereby reaches and reminds the user to change cereal or reminds the purpose that the user eats cereal as early as possible.
Drawings
Fig. 1 is a first schematic flow chart of a method for detecting grain status according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart illustrating an implementation of a method for detecting grain status according to an embodiment of the present disclosure;
fig. 3 is a schematic flow chart illustrating a third implementation of a method for detecting grain status according to an embodiment of the present disclosure;
fig. 4 is a schematic flow chart of a fourth implementation of a method for detecting grain status according to an embodiment of the present disclosure;
FIG. 5 is a schematic structural diagram of an apparatus for detecting the status of grains according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a cooking apparatus according to an embodiment of the present disclosure;
fig. 7 is a specific hardware structure of a cooking apparatus according to an embodiment of the present application.
Detailed Description
So that the manner in which the features and elements of the present embodiments can be understood in detail, a more particular description of the embodiments, briefly summarized above, may be had by reference to embodiments, some of which are illustrated in the appended drawings.
Example one
Fig. 1 is a schematic flow chart illustrating an implementation of a method for detecting a grain state according to an embodiment of the present application, where the method mainly includes the following steps:
s101, obtaining a first picture of the grains.
And S102, determining the average gray scale of the first picture.
S103, comparing the average gray scale of the first picture with a standard average gray scale, and determining whether prompt information is output or not based on a comparison result, wherein the prompt information is used for prompting the freshness degree of grains in the grain storage component.
It should be noted that the grain storage part may be a part of the cooking apparatus, or may be a separate part for storing grains. When the grain storage component is part of the cooking equipment, the grain storage component can share processing resources with the cooking equipment. The cooking equipment is any household electrical appliance which can be used by a user in the daily cooking process, such as an electric cooker, a soybean milk machine, an electric pressure cooker and the like. In some implementations, the cooking device can be connected to the internet through WiFi to establish connection with a terminal, so as to realize data interaction with the terminal. The terminal can be a mobile phone, a smart watch, a smart tablet and other user terminals. In the process of implementing the method for detecting the grain state according to the embodiment of the present application, there are different implementations, and specifically, the detection of the grain state may be implemented by the cooking device itself, or the detection of the grain state may be implemented by controlling the cooking device by the user terminal.
In this embodiment, the mode of obtaining the first picture of the grain may be the first picture of the grain in the grain storage component taken by the camera in the grain storage component controlled by the processor in the cooking device, may also be the first picture of the grain in the cooking device taken by the camera in the cooking device controlled by the processor, and may also be the first picture of the grain in the grain storage component taken by the camera in the grain storage component controlled by the processor according to a preset period. The preset period may be a time period set by a user, or a preset time period, or a time period obtained according to a history set by the user. The preset period may be any time interval, such as one day, one week, one month, etc. The grain storage component and the camera in the cooking appliance may be, but are not limited to, a digital camera, an analog camera, a color camera, a black and white camera, and the like.
In this embodiment, the cereal may be, but is not limited to, rice, for example, fresh rice is milk white or light yellow, and stale rice (i.e., old rice) is dark and even coffee. The gray scale can be used for indicating the depth of the color, so the gray scale can be used for representing the freshness of the rice, and the higher the gray scale is, the lower the freshness is, and the lower the gray scale is, the higher the freshness is. Based on this, after obtaining a first picture of the grain, it is necessary to determine the average gray level of the first picture.
In this embodiment, the first picture may be a color picture or a black and white picture, and the following describes how to determine the average gray scale of the first picture in detail with reference to two cases, namely, the first picture is a color picture and the first picture is a black and white picture.
The first condition is as follows: and when the first picture is a color picture, calculating the average gray scale of the first picture based on the color information of the first picture.
Specifically, 1) calculating a gray value of each pixel in the first picture based on color information of each pixel in the first picture; 2) accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first picture, and dividing the accumulated result by the number of the pixels in the first picture to obtain the average gray of the first picture.
When the camera is a color camera, the first picture is a first color picture, and the method for determining the average gray scale of the first color picture may be that the gray scale value of each pixel in the first color picture is calculated based on the color information of each pixel in the first color picture; accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first color picture, and dividing the accumulated result by the number of the pixels in the first color picture to obtain the average gray of the first color picture.
For example: assuming a first color mapThe resolution of the slice is X × Y, the first color picture comprises X × Y pixels, C (X, Y) is the color information of the pixel with coordinates (X, Y) in the first color picture, taking RGB color information as an example, C (X, Y) ═ R, G, B)(x,y)Wherein, R represents the intensity value corresponding to the red color, G represents the intensity value corresponding to the green color, and B represents the intensity value corresponding to the blue color. The gradation value G (x, y) of the pixel having coordinates (x, y) can be obtained from C (x, y), for example, G (x, y) ═ R (R × W1+ G × W2+ B × W3)(x,y)Wherein, W1, W2 and W3 are three weight coefficients. The gray value of each pixel in the first color picture can be obtained in the above manner. Further, the pixels with the gray values greater than or equal to the gray threshold value are selected from the first color picture, the gray values of the pixels are summed and then divided by the number of the pixels in the first color picture (i.e. X × Y), so as to obtain the average gray of the first color picture.
Case two: and under the condition that the first picture is a black-and-white picture, calculating the average gray scale of the first picture based on the gray scale information of the first picture.
Specifically, the gray values of the pixels with the gray values greater than or equal to the gray threshold value in the first picture are accumulated, and the accumulated result is divided by the number of the pixels in the first picture to obtain the average gray of the first picture.
In the case that the camera is a black-and-white camera, the first picture is a first black-and-white picture, and the method for determining the average gray scale of the first black-and-white picture may be that the gray scale values of pixels in the first black-and-white picture, whose gray scale values are greater than or equal to a gray scale threshold, are accumulated, and the accumulated result is divided by the number of pixels in the first black-and-white picture to obtain the average gray scale of the first black-and-white picture.
For example: assuming that the resolution of the first black-and-white picture is X × Y, the first black-and-white picture includes X × Y pixels, and G (X, Y) is a gray scale value of a pixel with coordinates (X, Y) in the first black-and-white picture, those pixels with gray scale values greater than or equal to a gray scale threshold value are selected from the first black-and-white picture, and the gray scale values of these pixels are summed and then divided by the number of pixels (i.e., X × Y) in the first black-and-white picture, so as to obtain an average gray scale of the first black-and-white picture.
And comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component. The standard average gray scale may be an average gray scale of corresponding fresh grains preset in the cooking apparatus.
Wherein the outputting the prompt information may include: displaying the prompt information through a display device in the cooking equipment; and/or playing the prompt message through an audio device in the cooking equipment; and/or sending the prompt information to terminal equipment through a communication device in the cooking equipment.
The above-mentioned prompt information includes at least one of the following information: text information, picture information, audio information, video information.
According to the method for detecting the grain state, a first picture of the grain is obtained; determining an average gray level of the first picture; and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component. So, realized the short-term test to cereal state for the user accurately obtains the fresh degree of cereal in the cereal storage part in time, thereby reaches and reminds the user to change cereal or reminds the purpose that the user eats cereal as early as possible. According to the method for detecting the grain state, whether the grain is fresh or not can be detected only based on the average gray scale of the grain picture, and therefore the method for detecting the grain state is a green, pollution-free, grain-free, convenient and fast grain state detection method.
Example two
An embodiment of the present application provides a method for detecting a grain state, and fig. 2 is a schematic view illustrating an implementation flow of the method for detecting a grain state according to the embodiment of the present application, as shown in fig. 2, the method mainly includes the following steps:
s201, obtaining a first picture of the grains.
S202, determining the average gray scale of the first picture.
S203, calculating the difference value between the average gray scale of the first picture and the standard average gray scale.
And S204, if the difference value between the average gray scale of the first picture and the standard average gray scale is larger than or equal to a first threshold value, outputting the prompt message.
It should be noted that the grain storage part may be a part of the cooking apparatus, or may be a separate part for storing grains. When the grain storage component is part of the cooking equipment, the grain storage component can share processing resources with the cooking equipment. The cooking equipment is any household electrical appliance which can be used by a user in the daily cooking process, such as an electric cooker, a soybean milk machine, an electric pressure cooker and the like. In some implementations, the cooking device can be connected to the internet through WiFi to establish connection with a terminal, so as to realize data interaction with the terminal. The terminal can be a mobile phone, a smart watch, a smart tablet and other user terminals. In the process of implementing the method for detecting the grain state according to the embodiment of the present application, there are different implementations, and specifically, the detection of the grain state may be implemented by the cooking device itself, or the detection of the grain state may be implemented by controlling the cooking device by the user terminal.
In this embodiment, the mode of obtaining the first picture of the grain may be the first picture of the grain in the grain storage component taken by the camera in the grain storage component controlled by the processor in the cooking device, may also be the first picture of the grain in the cooking device taken by the camera in the cooking device controlled by the processor, and may also be the first picture of the grain in the grain storage component taken by the camera in the grain storage component controlled by the processor according to a preset period. The preset period may be a time period set by a user, or a preset time period, or a time period obtained according to a history set by the user. The preset period may be any time interval, such as one day, one week, one month, etc. The grain storage component and the camera in the cooking appliance may be, but are not limited to, a digital camera, an analog camera, a color camera, a black and white camera, and the like.
In this embodiment, the cereal may be, but is not limited to, rice, for example, fresh rice is milk white or light yellow, and stale rice (i.e., old rice) is dark and even coffee. The gray scale can be used for indicating the depth of the color, so the gray scale can be used for representing the freshness of the rice, and the higher the gray scale is, the lower the freshness is, and the lower the gray scale is, the higher the freshness is. Based on this, after obtaining a first picture of the grain, it is necessary to determine the average gray level of the first picture.
In this embodiment, the first picture may be a color picture or a black and white picture, and the following describes how to determine the average gray scale of the first picture in detail with reference to two cases, namely, the first picture is a color picture and the first picture is a black and white picture.
The first condition is as follows: and when the first picture is a color picture, calculating the average gray scale of the first picture based on the color information of the first picture.
Specifically, 1) calculating a gray value of each pixel in the first picture based on color information of each pixel in the first picture; 2) accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first picture, and dividing the accumulated result by the number of the pixels in the first picture to obtain the average gray of the first picture.
When the camera is a color camera, the first picture is a first color picture, and the method for determining the average gray scale of the first color picture may be that the gray scale value of each pixel in the first color picture is calculated based on the color information of each pixel in the first color picture; accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first color picture, and dividing the accumulated result by the number of the pixels in the first color picture to obtain the average gray of the first color picture.
Case two: and under the condition that the first picture is a black-and-white picture, calculating the average gray scale of the first picture based on the gray scale information of the first picture.
Specifically, the gray values of the pixels with the gray values greater than or equal to the gray threshold value in the first picture are accumulated, and the accumulated result is divided by the number of the pixels in the first picture to obtain the average gray of the first picture.
In the case that the camera is a black-and-white camera, the first picture is a first black-and-white picture, and the method for determining the average gray scale of the first black-and-white picture may be that the gray scale values of pixels in the first black-and-white picture, whose gray scale values are greater than or equal to a gray scale threshold, are accumulated, and the accumulated result is divided by the number of pixels in the first black-and-white picture to obtain the average gray scale of the first black-and-white picture.
In this embodiment, a difference between the average gray scale of the first picture and the standard average gray scale is calculated, and the difference between the average gray scale of the first picture and the standard average gray scale is compared with a first threshold; if the difference is smaller than the first threshold value, the prompt message is not output, and if the difference is larger than or equal to the first threshold value, the prompt message is output.
Here, the standard average gray scale is used to represent the freshness of new rice, the difference between the average gray scale of the first picture and the standard average gray scale may represent the difference between the freshness of the current grain and the freshness of the new rice, and if the difference between the freshness of the current grain and the freshness of the new rice is greater than or equal to a first threshold value, it indicates that the freshness of the current grain is low (or not fresh), and a prompt message is output. In one embodiment, the prompt is used to prompt the user that the grain is currently less fresh (or not fresh). In another embodiment, the prompting message is used for prompting the user of a specific freshness degree of the current grain, the specific freshness degree is determined based on a difference value of the freshness degree of the current grain relative to the freshness degree of new rice, and the larger the difference value is, the lower the specific freshness degree is, the smaller the difference value is, and the higher the specific freshness degree is.
In an optional embodiment of the present application, the average gray scale of the first picture may be directly compared with a first threshold, and if the average gray scale of the first picture is smaller than the first threshold, the prompt information is not output; and if the average gray scale of the first picture is larger than or equal to a first threshold value, outputting the prompt message. Here, the first threshold may be a standard gray scale calculated from standard samples of grains stored for different time periods, and the first threshold may be a standard critical gray scale value of fresh and stale grains, or a standard gray scale value range of grains. The grain standard gray scale and the grain storage time are in positive correlation, the longer the grain storage time is, the larger the grain standard gray scale value is, and the longer the grain storage time is, the lower the grain freshness degree is, so that the first threshold value can represent whether the grains are fresh or not.
In this embodiment, the cooking apparatus stores therein first threshold values of respective grains.
Wherein the outputting the prompt information may include: displaying the prompt information through a display device in the cooking equipment; and/or playing the prompt message through an audio device in the cooking equipment; and/or sending the prompt information to terminal equipment through a communication device in the cooking equipment.
The above-mentioned prompt information includes at least one of the following information: text information, picture information, audio information, video information.
According to the method for detecting the grain state, a first picture of the grain is obtained; determining an average gray level of the first picture; and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component. So, realized the short-term test to cereal state for the user accurately obtains the fresh degree of cereal in the cereal storage part in time, thereby reaches and reminds the user to change cereal or reminds the purpose that the user eats cereal as early as possible. According to the method for detecting the grain state, whether the grain is fresh or not can be detected only based on the average gray scale of the grain picture, and therefore the method for detecting the grain state is a green, pollution-free, grain-free, convenient and fast grain state detection method.
EXAMPLE III
An embodiment of the present application provides a method for detecting a grain state, and fig. 3 is a schematic view of an implementation flow of the method for detecting a grain state provided in the embodiment of the present application, as shown in fig. 3, the method mainly includes the following steps:
s301, when the end signal of the grain adding event is detected, a second picture of the grain is obtained.
S302, determining the average gray scale of the second picture, and taking the average gray scale of the second picture as the standard average gray scale.
S303, obtaining a first picture of the grains.
S304, determining the average gray scale of the first picture.
S305, comparing the average gray scale of the first picture with a standard average gray scale, and determining whether prompt information is output or not based on a comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component.
It should be noted that the grain storage part may be a part of the cooking apparatus, or may be a separate part for storing grains. When the grain storage component is part of the cooking equipment, the grain storage component can share processing resources with the cooking equipment. The cooking equipment is any household electrical appliance which can be used by a user in the daily cooking process, such as an electric cooker, a soybean milk machine, an electric pressure cooker and the like. In some implementations, the cooking device can be connected to the internet through WiFi to establish connection with a terminal, so as to realize data interaction with the terminal. The terminal can be a mobile phone, a smart watch, a smart tablet and other user terminals. In the process of implementing the method for detecting the grain state according to the embodiment of the present application, there are different implementations, and specifically, the detection of the grain state may be implemented by the cooking device itself, or the detection of the grain state may be implemented by controlling the cooking device by the user terminal.
In this embodiment, the cereal may be, but is not limited to, rice, for example, fresh rice is milk white or light yellow, and stale rice (i.e., old rice) is dark and even coffee. The gray scale can be used for indicating the depth of the color, so the gray scale can be used for representing the freshness of the rice, and the higher the gray scale is, the lower the freshness is, and the lower the gray scale is, the higher the freshness is. Based on the method, after the user adds the fresh grains into the grain storage component, the grains at the moment are shot to obtain a second picture, and the average gray scale of the second picture is used as the standard average gray scale which can represent the gray scale of the fresh grains.
Furthermore, after the user adds the grains, an end signal of the grain adding event is triggered, and when the processor detects the end signal of the grain adding event, a second picture of the grains is obtained. During specific implementation, the processor detects a closing signal of the opening and closing cover body of the grain storage component through the opening and closing cover detection circuit of the grain storage component. The cover opening and closing detection circuit is a detection circuit arranged on the grain storage part/cover opening and closing body, and comprises a signal collector arranged on the grain storage part, and the signal collector is connected with the processor. When the opening and closing cover body is opened, the signal collector collects an opening level signal for opening and closing the cover body, and sends the opening level signal to the processor, and the processor learns that the opening and closing cover body of the grain storage component is in an opening state according to the opening level signal; when the opening and closing cover body is closed, the signal collector collects closed level signals of the opening and closing cover body and sends the closed level signals to the processor, and the processor acquires that the opening and closing cover body of the grain storage component is in a closed state according to the closed level signals and controls the camera arranged in the grain storage component to shoot second pictures of grains in the grain storage component. The cameras in the grain storage component may be, but are not limited to, digital cameras, analog cameras, color cameras, black and white cameras, and the like.
In this embodiment, the second picture may be a color picture or a black and white picture, and the following describes how to determine the average gray scale of the second picture in detail with reference to two cases, namely, the second picture is a color picture and the second picture is a black and white picture.
The first condition is as follows: and under the condition that the second picture is a color picture, calculating the average gray scale of the second picture based on the color information of the second picture.
Specifically, 1) calculating a gray value of each pixel in the second picture based on color information of each pixel in the second picture; 2) accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the second picture, and dividing the accumulated result by the number of the pixels in the second picture to obtain the average gray of the second picture.
When the camera is a color camera, the second picture is a second color picture, and the method for determining the average gray scale of the second color picture may be that the gray scale value of each pixel in the second color picture is calculated based on the color information of each pixel in the second color picture; and accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the second color picture, and dividing the accumulated result by the number of the pixels in the second color picture to obtain the average gray of the second color picture.
Case two: and under the condition that the second picture is a black-and-white picture, calculating the average gray scale of the second picture based on the gray scale information of the second picture.
Specifically, the gray values of the pixels with the gray values greater than or equal to the gray threshold value in the second picture are accumulated, and the accumulated result is divided by the number of the pixels in the second picture to obtain the average gray of the second picture.
In the case that the camera is a black-and-white camera, the second picture is a second black-and-white picture, and the method for obtaining the average gray scale of the second black-and-white picture may be that the gray scale values of pixels in the second black-and-white picture, whose gray scale values are greater than or equal to the gray scale threshold, are accumulated, and the accumulated result is divided by the number of pixels in the second black-and-white picture to obtain the average gray scale of the second black-and-white picture.
In the above scheme, it is assumed that a second picture is acquired at time T1, and after a standard average gray scale is obtained based on the second picture, the average gray scale of a first picture of grains collected at time T2 (time T2 is later than time T1) can be compared with the standard average gray scale, so as to determine the freshness of the grains at time T2. Here, the manner of acquiring the average grayscale of the first picture is the same as the manner of acquiring the average grayscale of the first picture, and how to acquire the average grayscale of the first picture will be described in detail below with reference to both the case where the first picture is a color picture and the case where the first picture is a black-and-white picture.
The first condition is as follows: and when the first picture is a color picture, calculating the average gray scale of the first picture based on the color information of the first picture.
Specifically, 1) calculating a gray value of each pixel in the first picture based on color information of each pixel in the first picture; 2) accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first picture, and dividing the accumulated result by the number of the pixels in the first picture to obtain the average gray of the first picture.
When the camera is a color camera, the first picture is a first color picture, and the method for determining the average gray scale of the first color picture may be that the gray scale value of each pixel in the first color picture is calculated based on the color information of each pixel in the first color picture; accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first color picture, and dividing the accumulated result by the number of the pixels in the first color picture to obtain the average gray of the first color picture.
Case two: and under the condition that the first picture is a black-and-white picture, calculating the average gray scale of the first picture based on the gray scale information of the first picture.
Specifically, the gray values of the pixels with the gray values greater than or equal to the gray threshold value in the first picture are accumulated, and the accumulated result is divided by the number of the pixels in the first picture to obtain the average gray of the first picture.
In the case that the camera is a black-and-white camera, the first picture is a first black-and-white picture, and the method for determining the average gray scale of the first black-and-white picture may be that the gray scale values of pixels in the first black-and-white picture, whose gray scale values are greater than or equal to a gray scale threshold, are accumulated, and the accumulated result is divided by the number of pixels in the first black-and-white picture to obtain the average gray scale of the first black-and-white picture.
In this embodiment, a difference between the average gray scale of the first picture and a standard average gray scale (i.e., the average gray scale of the second picture) is calculated, and the difference between the average gray scale of the first picture and the standard average gray scale is compared with a first threshold; if the difference is smaller than the first threshold value, the prompt message is not output, and if the difference is larger than or equal to the first threshold value, the prompt message is output.
Here, the standard average gray scale is used to represent the freshness of new rice, the difference between the average gray scale of the first picture and the standard average gray scale may represent the difference between the freshness of the current grain and the freshness of the new rice, and if the difference between the freshness of the current grain and the freshness of the new rice is greater than or equal to a first threshold value, it indicates that the freshness of the current grain is low (or not fresh), and a prompt message is output. In one embodiment, the prompt is used to prompt the user that the grain is currently less fresh (or not fresh). In another embodiment, the prompting message is used for prompting the user of a specific freshness degree of the current grain, the specific freshness degree is determined based on a difference value of the freshness degree of the current grain relative to the freshness degree of new rice, and the larger the difference value is, the lower the specific freshness degree is, the smaller the difference value is, and the higher the specific freshness degree is.
In an optional embodiment of the present application, the average gray scale of the first picture may be directly compared with a first threshold, and if the average gray scale of the first picture is smaller than the first threshold, the prompt information is not output; and if the average gray scale of the first picture is larger than or equal to a first threshold value, outputting the prompt message. Here, the first threshold may be a standard gray scale calculated from standard samples of grains stored for different time periods, and the first threshold may be a standard critical gray scale value of fresh and stale grains, or a standard gray scale value range of grains. The grain standard gray scale and the grain storage time are in positive correlation, the longer the grain storage time is, the larger the grain standard gray scale value is, and the longer the grain storage time is, the lower the grain freshness degree is, so that the first threshold value can represent whether the grains are fresh or not.
Wherein the outputting the prompt information may include: displaying the prompt information through a display device in the cooking equipment; and/or playing the prompt message through an audio device in the cooking equipment; and/or sending the prompt information to terminal equipment through a communication device in the cooking equipment.
The above-mentioned prompt information includes at least one of the following information: text information, picture information, audio information, video information.
According to the method for detecting the grain state, a first picture of the grain is obtained; determining an average gray level of the first picture; and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component. So, realized the short-term test to cereal state for the user accurately obtains the fresh degree of cereal in the cereal storage part in time, thereby reaches and reminds the user to change cereal or reminds the purpose that the user eats cereal as early as possible. According to the method for detecting the grain state, whether the grain is fresh or not can be detected only based on the average gray scale of the grain picture, and therefore the method for detecting the grain state is a green, pollution-free, grain-free, convenient and fast grain state detection method.
Example four
An embodiment of the present application provides a method for detecting a grain state, and fig. 4 is a schematic view illustrating an implementation flow of the method for detecting a grain state according to the embodiment of the present application, as shown in fig. 4, the method mainly includes the following steps:
s401, when a start signal of a grain adding event is detected, acquiring a second picture of the grain according to a preset time interval until an end signal of the grain adding event is detected, and acquiring at least one second picture of the grain.
S402, determining the average gray scale corresponding to at least one second picture of the grains, and taking the average value of the average gray scales corresponding to the at least one second picture as the standard average gray scale.
And S403, acquiring a first picture of the grains.
S404, determining the average gray scale of the first picture.
S405, comparing the average gray scale of the first picture with a standard average gray scale, and determining whether prompt information is output or not based on a comparison result, wherein the prompt information is used for prompting the freshness degree of grains in the grain storage component.
In this embodiment, the cereal may be, but is not limited to, rice, for example, fresh rice is milk white or light yellow, and stale rice (i.e., old rice) is dark and even coffee. The gray scale can be used for indicating the depth of the color, so the gray scale can be used for representing the freshness of the rice, and the higher the gray scale is, the lower the freshness is, and the lower the gray scale is, the higher the freshness is. Based on the method, during the process that a user adds fresh grains to the grain storage component, the grains in the period are shot to obtain at least one second picture, and the average value of the average gray scale of the at least one second picture is used as the standard average gray scale which can represent the gray scale of the fresh grains.
Further, when the user starts to add the grains, a start signal of the grain addition event is triggered, and when the user finishes adding the grains, an end signal of the grain addition event is triggered. Based on this, when the processor detects a start signal of a grain adding event, the processor may control the camera to take pictures of grains in the grain storage component at a predetermined time interval in such a manner that a second picture of the grains is obtained at a predetermined time interval until an end signal of the grain adding event is detected, and at least one second picture of the grains is obtained. During specific implementation, the processor detects an opening/closing signal of an opening/closing cover body of the grain storage part through an opening/closing cover detection circuit of the grain storage part. The cover opening and closing detection circuit is a detection circuit arranged on the grain storage part/cover opening and closing body, and comprises a signal collector arranged on the grain storage part, and the signal collector is connected with the processor. When the opening and closing cover body is opened, the signal collector collects an opening level signal for opening and closing the cover body, and sends the opening level signal to the processor, and the processor learns that the opening and closing cover body of the grain storage component is in an opening state according to the opening level signal and controls a camera arranged in the grain storage component to shoot a second picture of grains in the grain storage component according to a preset time interval; when the opening and closing cover body is closed, the signal collector collects a closed level signal of the opening and closing cover body and sends the closed level signal to the processor, the processor learns that the opening and closing cover body of the grain storage component is in a closed state according to the closed level signal and controls the camera arranged in the grain storage component to stop shooting, and finally at least one second picture of the grain is obtained.
In this embodiment, the at least one second picture may be a color picture or a black and white picture, and how to determine the average gray scale corresponding to each of the at least one second picture is described in detail below with reference to two cases, namely, the at least one second picture is a color picture and the at least one second picture is a black and white picture.
The first condition is as follows: and under the condition that the second picture is a color picture, calculating the average gray scale corresponding to the at least one second picture based on the color information of the at least one second picture.
Specifically, 1) calculating a gray value of each pixel in the at least one second picture based on color information of each pixel in the at least one second picture; 2) and accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in each second picture, and dividing the accumulated result by the number of the pixels in each second picture to obtain the average gray corresponding to at least one second picture.
When the camera is a color camera, the at least one second picture is a second color picture, and the method for determining the average gray scale corresponding to the at least one second color picture may be that the gray scale value of each pixel in each second color picture is calculated based on the color information of each pixel in the at least one second color picture; and accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in each second color picture, and dividing the accumulated result by the number of the pixels in each second color picture to obtain the average gray corresponding to at least one second color picture.
Case two: and under the condition that the at least one second picture is a black-and-white picture, calculating the average gray scale corresponding to the at least one second picture based on the gray scale information of the at least one second picture.
Specifically, the gray values of the pixels with the gray values greater than or equal to the gray threshold value in each second picture are accumulated, and the accumulated result is divided by the number of the pixels in each second picture to obtain the average gray corresponding to at least one second picture.
In the case that the camera is a black-and-white camera, the at least one second black-and-white picture is a second black-and-white picture, and the method for determining the average gray scale corresponding to the at least one second black-and-white picture may be to accumulate the gray scale values of the pixels of which the gray scale values are greater than or equal to the gray scale threshold value in each second black-and-white picture, and divide the accumulated result by the number of the pixels of each second black-and-white picture to obtain the average gray scale corresponding to the at least one second black-and-white picture.
And after the average gray scale corresponding to at least one second image of the grains is obtained, taking the average value of the average gray scale corresponding to the at least one second image as the standard average gray scale.
In the above scheme, assuming that at least one second picture is acquired from time T0 (corresponding to the time when the start signal of the grain addition event is detected) to time T1 (corresponding to the time when the end signal of the grain addition event is detected), after a standard average gray scale is obtained based on the at least one second picture, the average gray scale of a first picture of grains collected at time T2 (time T2 is later than time T1) can be compared with the standard average gray scale, so as to determine the freshness of the grains at time T2. Here, the manner of determining the average grayscale of the first picture is the same as the manner of determining the average grayscale of the first picture, and how to determine the average grayscale of the first picture will be described in detail below with reference to both the case where the first picture is a color picture and the case where the first picture is a black-and-white picture.
The first condition is as follows: and when the first picture is a color picture, calculating the average gray scale of the first picture based on the color information of the first picture.
Specifically, 1) calculating a gray value of each pixel in the first picture based on color information of each pixel in the first picture; 2) accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first picture, and dividing the accumulated result by the number of the pixels in the first picture to obtain the average gray of the first picture.
When the camera is a color camera, the first picture is a first color picture, and the method for determining the average gray scale of the first color picture may be that the gray scale value of each pixel in the first color picture is calculated based on the color information of each pixel in the first color picture; accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first color picture, and dividing the accumulated result by the number of the pixels in the first color picture to obtain the average gray of the first color picture.
Case two: and under the condition that the first picture is a black-and-white picture, calculating the average gray scale of the first picture based on the gray scale information of the first picture.
Specifically, the gray values of the pixels with the gray values greater than or equal to the gray threshold value in the first picture are accumulated, and the accumulated result is divided by the number of the pixels in the first picture to obtain the average gray of the first picture.
In the case that the camera is a black-and-white camera, the first picture is a first black-and-white picture, and the method for determining the average gray scale of the first black-and-white picture may be that the gray scale values of pixels in the first black-and-white picture, whose gray scale values are greater than or equal to a gray scale threshold, are accumulated, and the accumulated result is divided by the number of pixels in the first black-and-white picture to obtain the average gray scale of the first black-and-white picture.
In this embodiment, in order to reduce such an error, when the processor detects a start signal of a grain addition event in the grain storage component (for example, an opening signal of an opening/closing cover of the grain storage component), the camera arranged in the grain storage component may be controlled to shoot grains in the grain storage component at a predetermined time interval until information of a grain addition end event (for example, an opening/closing cover closing signal of the grain storage component) is detected, and at least one second picture of the grains may be obtained.
In this embodiment, a difference between the average gray scale of the first picture and a standard average gray scale (i.e., an average of the average gray scales corresponding to the at least one second picture) is calculated, and the difference between the average gray scale of the first picture and the standard average gray scale is compared with a first threshold; if the difference is smaller than the first threshold value, the prompt message is not output, and if the difference is larger than or equal to the first threshold value, the prompt message is output.
Here, the standard average gray scale is used to represent the freshness of new rice, the difference between the average gray scale of the first picture and the standard average gray scale may represent the difference between the freshness of the current grain and the freshness of the new rice, and if the difference between the freshness of the current grain and the freshness of the new rice is greater than or equal to a first threshold value, it indicates that the freshness of the current grain is low (or not fresh), and a prompt message is output. In one embodiment, the prompt is used to prompt the user that the grain is currently less fresh (or not fresh). In another embodiment, the prompting message is used for prompting the user of a specific freshness degree of the current grain, the specific freshness degree is determined based on a difference value of the freshness degree of the current grain relative to the freshness degree of new rice, and the larger the difference value is, the lower the specific freshness degree is, the smaller the difference value is, and the higher the specific freshness degree is.
In an optional embodiment of the present application, the average gray scale of the first picture may be directly compared with a first threshold, and if the average gray scale of the first picture is smaller than the first threshold, the prompt information is not output; and if the average gray scale of the first picture is larger than or equal to a first threshold value, outputting the prompt message. Here, the first threshold may be a standard gray scale calculated from standard samples of grains stored for different time periods, and the first threshold may be a standard critical gray scale value of fresh and stale grains, or a standard gray scale value range of grains. The grain standard gray scale and the grain storage time are in positive correlation, the longer the grain storage time is, the larger the grain standard gray scale value is, and the longer the grain storage time is, the lower the grain freshness degree is, so that the first threshold value can represent whether the grains are fresh or not.
Wherein the outputting the prompt information may include: displaying the prompt information through a display device in the cooking equipment; and/or playing the prompt message through an audio device in the cooking equipment; and/or sending the prompt information to terminal equipment through a communication device in the cooking equipment.
The above-mentioned prompt information includes at least one of the following information: text information, picture information, audio information, video information.
According to the method for detecting the grain state, a first picture of the grain is obtained; determining an average gray level of the first picture; and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component. So, realized the short-term test to cereal state for the user accurately obtains the fresh degree of cereal in the cereal storage part in time, thereby reaches and reminds the user to change cereal or reminds the purpose that the user eats cereal as early as possible. According to the method for detecting the grain state, whether the grain is fresh or not can be detected only based on the average gray scale of the grain picture, and therefore the method for detecting the grain state is a green, pollution-free, grain-free, convenient and fast grain state detection method.
EXAMPLE five
Based on the same technical concept of the foregoing embodiments, an apparatus for detecting a grain state is provided in an embodiment of the present application, and fig. 5 is a schematic structural diagram of the apparatus for detecting a grain state provided in an embodiment of the present application, and as shown in fig. 5, the apparatus 500 for detecting a grain state includes:
the shooting module 501 is used for acquiring a first picture of the grains;
the processing module 502 is configured to determine an average gray level of the first picture; and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component.
In other embodiments, in the case that the first picture is a color picture, the processing module 502 is further configured to calculate an average gray scale of the first picture based on the color information of the first picture.
In other embodiments, the processing module 502 is further configured to calculate a gray scale value of each pixel in the first picture based on the color information of each pixel in the first picture;
accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first picture, and dividing the accumulated result by the number of the pixels in the first picture to obtain the average gray of the first picture.
In other embodiments, the processing module 502 is further configured to calculate a difference between the average gray scale of the first picture and a standard average gray scale;
and if the difference value between the average gray scale of the first picture and the standard average gray scale is larger than or equal to a first threshold value, outputting the prompt message.
In other embodiments, the grain storage component is disposed in a cooking appliance;
the processing module 502 is further configured to display the prompt message through a display device in the cooking apparatus; and/or the presence of a gas in the gas,
playing the prompt message through an audio device in the cooking equipment; and/or the presence of a gas in the gas,
and sending the prompt information to a terminal device through a communication device in the cooking device.
In other embodiments, the shooting module 501 is further configured to obtain a second picture of the grain when detecting an end signal of a grain addition event;
the processing module 502 is further configured to determine an average gray scale of the second picture, and use the average gray scale of the second picture as the standard average gray scale.
In other embodiments, the shooting module 501 is further configured to, when a start signal of a grain addition event is detected, obtain second pictures of the grain at predetermined time intervals until an end signal of the grain addition event is detected, and obtain at least one second picture of the grain;
the processing module 502 is further configured to determine average gray levels corresponding to at least one second image of the grain, and use an average value of the average gray levels corresponding to the at least one second image as the standard average gray level.
EXAMPLE six
Based on the same technical concept of the foregoing embodiments, an embodiment of the present application provides a cooking apparatus, and fig. 6 is a schematic structural diagram of the cooking apparatus provided in the embodiment of the present application, and as shown in fig. 6, the cooking apparatus 600 includes:
a grain storage part 601 for storing grains;
an image acquisition unit 602, configured to acquire a first picture of the grain;
a data processing unit 603 for determining an average gray level of the first picture; and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component.
In other embodiments, in the case that the first picture is a color picture, the data processing unit 603 is further configured to calculate an average gray scale of the first picture based on the color information of the first picture.
In other embodiments, the data processing unit 603 is further configured to calculate a gray scale value of each pixel in the first picture based on the color information of each pixel in the first picture;
accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first picture, and dividing the accumulated result by the number of the pixels in the first picture to obtain the average gray of the first picture.
In other embodiments, the data processing unit 603 is further configured to calculate a difference between the average gray scale of the first picture and a standard average gray scale;
and if the difference value between the average gray scale of the first picture and the standard average gray scale is larger than or equal to a first threshold value, outputting the prompt message.
In other embodiments, the grain storage component is disposed in a cooking appliance;
the data processing unit 603 is further configured to display the prompt information through a display device in the cooking apparatus; and/or the presence of a gas in the gas,
playing the prompt message through an audio device in the cooking equipment; and/or the presence of a gas in the gas,
and sending the prompt information to a terminal device through a communication device in the cooking device.
In other embodiments, the image capturing unit 602 is further configured to, when detecting an end signal of a grain addition event, obtain a second picture of the grain;
the data processing unit 603 is further configured to determine an average gray scale of the second picture, and use the average gray scale of the second picture as the standard average gray scale.
In other embodiments, the image capturing unit 602 is further configured to, when a start signal of a grain addition event is detected, obtain second pictures of the grain at predetermined time intervals until an end signal of the grain addition event is detected, and obtain at least one second picture of the grain;
the data processing unit 603 is further configured to determine average gray scales corresponding to at least one second picture of the grain, and use an average value of the average gray scales corresponding to the at least one second picture as the standard average gray scale.
The components in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware or a form of a software functional module.
Based on the understanding that the technical solution of the embodiments of the present application, or a part thereof contributing to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a computer storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method of the embodiments of the present application. And the aforementioned computer storage media include: a U-disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Accordingly, embodiments of the present application provide a computer storage medium storing a computer program, which when executed by at least one processor implements the steps of the first or second embodiment.
Referring to fig. 7, a specific hardware structure of a cooking apparatus 700 provided in an embodiment of the present application is shown, including: a network interface 701, a memory 702, and a processor 703; the various components are coupled together by a bus system 704. It is understood that the bus system 704 is used to enable communications among the components. The bus system 704 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled in fig. 7 as the bus system 704.
The network interface 701 is configured to receive and transmit signals in a process of receiving and transmitting information with other external network elements;
a memory 702 for storing a computer program capable of running on the processor 703;
a processor 703 for executing, when running the computer program, the following:
acquiring a first picture of the grain;
determining an average gray level of the first picture;
and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component.
The processor 703 is further configured to, when running the computer program, perform:
and when the first picture is a color picture, calculating the average gray scale of the first picture based on the color information of the first picture.
The processor 703 is further configured to, when running the computer program, perform:
calculating a gray value of each pixel in the first picture based on the color information of each pixel in the first picture;
accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first picture, and dividing the accumulated result by the number of the pixels in the first picture to obtain the average gray of the first picture.
The processor 703 is further configured to, when running the computer program, perform:
calculating the difference value of the average gray scale of the first picture and the standard average gray scale;
and if the difference value between the average gray scale of the first picture and the standard average gray scale is larger than or equal to a first threshold value, outputting the prompt message.
The processor 703 is further configured to, when running the computer program, perform:
displaying the prompt information through a display device in the cooking equipment; and/or the presence of a gas in the gas,
playing the prompt message through an audio device in the cooking equipment; and/or the presence of a gas in the gas,
and sending the prompt information to a terminal device through a communication device in the cooking device.
The processor 703 is further configured to, when running the computer program, perform:
when an end signal of a grain adding event is detected, acquiring a second picture of the grain;
and determining the average gray scale of the second picture, and taking the average gray scale of the second picture as the standard average gray scale.
The processor 703 is further configured to, when running the computer program, perform:
when a starting signal of a grain adding event is detected, acquiring second pictures of the grains according to a preset time interval, and determining at least one second picture of the grains until an ending signal of the grain adding event is detected;
and acquiring average gray scales corresponding to at least one second image of the grains respectively, and taking the average value of the average gray scales corresponding to the at least one second image as the standard average gray scale.
It will be appreciated that the memory 702 in the subject embodiment can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous SDRAM (ESDRAM), Sync Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 702 of the methodologies described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
The processor 703 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the method may be implemented by hardware integrated logic circuits in the processor 703 or by instructions in the form of software. The Processor 703 may be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may reside in ram, flash memory, rom, prom, or eprom, registers, among other computer storage media that are well known in the art. The computer storage medium is located in the memory 702, and the processor 703 reads the information in the memory 702 and performs the steps of the above method in combination with the hardware thereof.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the Processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. The above-described terminal embodiments are only illustrative, for example, the division of the unit is only a logical function division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.

Claims (17)

1. A method of detecting the condition of grain, the method comprising:
acquiring a first picture of grains;
determining an average gray level of the first picture;
and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component.
2. The method of claim 1, wherein the determining the average gray level of the first picture in the case that the first picture is a color picture comprises:
calculating an average gray level of the first picture based on the color information of the first picture.
3. The method of claim 2, wherein the calculating an average gray level of the first picture based on the color information of the first picture comprises:
calculating a gray value of each pixel in the first picture based on the color information of each pixel in the first picture;
accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first picture, and dividing the accumulated result by the number of the pixels in the first picture to obtain the average gray of the first picture.
4. The method of claim 1, wherein comparing the average gray level of the first picture with a standard average gray level and determining whether to output prompt information based on the comparison result comprises:
calculating the difference value of the average gray scale of the first picture and the standard average gray scale;
and if the difference value between the average gray scale of the first picture and the standard average gray scale is larger than or equal to a first threshold value, outputting the prompt message.
5. The method of claim 1, wherein the grain storage component is disposed in a cooking appliance;
the outputting the prompt message comprises:
displaying the prompt information through a display device in the cooking equipment; and/or the presence of a gas in the gas,
playing the prompt message through an audio device in the cooking equipment; and/or the presence of a gas in the gas,
and sending the prompt information to a terminal device through a communication device in the cooking device.
6. The method according to any one of claims 1 to 5, further comprising:
when an end signal of a grain adding event is detected, acquiring a second picture of the grain;
and determining the average gray scale of the second picture, and taking the average gray scale of the second picture as the standard average gray scale.
7. The method according to any one of claims 1 to 5, further comprising:
when a starting signal of a grain adding event is detected, acquiring a second picture of the grain according to a preset time interval until an ending signal of the grain adding event is detected, and acquiring at least one second picture of the grain;
and determining the average gray scale corresponding to at least one second picture of the grains respectively, and taking the average value of the average gray scales corresponding to the at least one second picture as the standard average gray scale.
8. An apparatus for detecting the condition of grain, the apparatus comprising: shooting module and processing module, wherein:
the shooting module is used for acquiring a first picture of the grains;
the processing module is used for determining the average gray scale of the first picture; and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component.
9. The apparatus of claim 8, wherein the processing module is further configured to calculate an average gray level of the first picture based on the color information of the first picture in case that the first picture is a color picture.
10. The apparatus according to claim 9, wherein the processing module is further configured to calculate a gray value for each pixel in the first picture based on the color information of each pixel in the first picture;
accumulating the gray values of the pixels with the gray values larger than or equal to the gray threshold value in the first picture, and dividing the accumulated result by the number of the pixels in the first picture to obtain the average gray of the first picture.
11. The apparatus of claim 8, wherein the processing module is further configured to calculate a difference between an average gray level of the first picture and a standard average gray level;
and if the difference value between the average gray scale of the first picture and the standard average gray scale is larger than or equal to a first threshold value, outputting the prompt message.
12. The apparatus of claim 8, wherein the grain storage member is provided in a cooking device;
the processing module is further used for displaying the prompt information through a display device in the cooking equipment; and/or the presence of a gas in the gas,
playing the prompt message through an audio device in the cooking equipment; and/or the presence of a gas in the gas,
and sending the prompt information to a terminal device through a communication device in the cooking device.
13. The apparatus according to any one of claims 8 to 12,
the shooting module is further used for acquiring a second picture of the grain when an end signal of a grain adding event is detected;
the processing module is further configured to determine an average gray scale of the second picture, and use the average gray scale of the second picture as the standard average gray scale.
14. The apparatus according to any one of claims 8 to 12,
the shooting module is further used for acquiring a second picture of the grains according to a preset time interval when a start signal of a grain adding event is detected, and obtaining at least one second picture of the grains until an end signal of the grain adding event is detected;
the processing module is further configured to determine average gray levels corresponding to at least one second picture of the grain, and use an average value of the average gray levels corresponding to the at least one second picture as the standard average gray level.
15. A cooking apparatus, characterized in that the cooking apparatus comprises a grain storage component, an image acquisition unit and a data processing unit; wherein:
the grain storage component is used for storing grains;
the image acquisition unit is used for acquiring a first picture of the grains;
the data processing unit is used for determining the average gray scale of the first picture; and comparing the average gray scale of the first picture with a standard average gray scale, and determining whether to output prompt information based on the comparison result, wherein the prompt information is used for prompting the freshness degree of the grains in the grain storage component.
16. A cooking device, characterized in that the cooking device comprises a network interface, a memory and a processor; wherein,
the network interface is configured to realize connection communication between the components;
the memory configured to store a computer program operable on the processor;
the processor, when executing the computer program, is configured to perform the method of any of claims 1 to 7.
17. A computer storage medium, characterized in that the computer storage medium stores a computer program which, when executed by at least one processor, implements the method according to any one of claims 1 to 7.
CN201910824427.6A 2019-09-02 2019-09-02 Method and device for detecting cereal state, cooking equipment and computer storage medium Active CN112446853B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910824427.6A CN112446853B (en) 2019-09-02 2019-09-02 Method and device for detecting cereal state, cooking equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910824427.6A CN112446853B (en) 2019-09-02 2019-09-02 Method and device for detecting cereal state, cooking equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN112446853A true CN112446853A (en) 2021-03-05
CN112446853B CN112446853B (en) 2024-07-16

Family

ID=74735034

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910824427.6A Active CN112446853B (en) 2019-09-02 2019-09-02 Method and device for detecting cereal state, cooking equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN112446853B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN204423395U (en) * 2015-03-10 2015-06-24 无锡桑尼安科技有限公司 Fish body freshness recognition system
CN107909605A (en) * 2017-10-23 2018-04-13 广东美的厨房电器制造有限公司 Control method, device, storage medium and the server of cooking equipment
CN107960838A (en) * 2016-10-20 2018-04-27 佛山市顺德区美的电热电器制造有限公司 Article-storage device and cooking apparatus
CN108399514A (en) * 2017-02-08 2018-08-14 北京京东尚科信息技术有限公司 The fresh dispatching reminding method and device of freshness can be monitored
CN208598177U (en) * 2017-07-05 2019-03-15 佛山市顺德区美的电热电器制造有限公司 Article-storage device and cooking apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN204423395U (en) * 2015-03-10 2015-06-24 无锡桑尼安科技有限公司 Fish body freshness recognition system
CN107960838A (en) * 2016-10-20 2018-04-27 佛山市顺德区美的电热电器制造有限公司 Article-storage device and cooking apparatus
CN108399514A (en) * 2017-02-08 2018-08-14 北京京东尚科信息技术有限公司 The fresh dispatching reminding method and device of freshness can be monitored
CN208598177U (en) * 2017-07-05 2019-03-15 佛山市顺德区美的电热电器制造有限公司 Article-storage device and cooking apparatus
CN107909605A (en) * 2017-10-23 2018-04-13 广东美的厨房电器制造有限公司 Control method, device, storage medium and the server of cooking equipment

Also Published As

Publication number Publication date
CN112446853B (en) 2024-07-16

Similar Documents

Publication Publication Date Title
US8115822B2 (en) Image capturing apparatus, for determining a subject scene included in a captured image, method for controlling the same, and program therefor
US9648245B2 (en) Low-light image capture method and image capture apparatus
JP6431547B2 (en) Method and apparatus for controlling image capture
CN100542220C (en) Image processing equipment, image processing method and image capture device
US8970716B2 (en) Image-capturing apparatus and control method of the image-capturing apparatus
CN101388959A (en) Image capturing apparatus, method of controlling the same, and program
CN106444451B (en) Food taking and placing prompting method and device in intelligent electric cooker
US9270896B2 (en) Imaging apparatus, client device, imaging system, control method of imaging apparatus, control method of client device, and control method of imaging system
CN107087118B (en) Photographic method, device, storage medium and terminal
RU2690687C1 (en) Method and device for uplink signal transmission
CN114390212B (en) Photographing preview method, electronic device and storage medium
US7301572B2 (en) Pixel correction processing apparatus, image processing apparatus, pixel correction processing method, program, and storage medium
CN106961556A (en) Camera and electronic equipment
CN112446853A (en) Method and device for detecting grain state, cooking equipment and computer storage medium
US9467635B2 (en) Image processing apparatus and image processing method
WO2019144262A1 (en) Smudge detection method and apparatus and mobile electronic device
CN115460344B (en) Method for processing abnormality of image pickup apparatus, server, and medium
JP2006238418A (en) Smear leak detection of image sensor exposed to bright optical source and displaying smear leak icon on display of digital camera
JP2020187239A (en) Imaging apparatus, control method of imaging apparatus, program and storage medium
CN111104633B (en) Display method, device and equipment for sharing page and storage medium
FR3061317B1 (en) METHOD OF ESTIMATING THE ENERGY RESERVE AVAILABLE IN A MEANS FOR STORING ELECTRIC ENERGY OF A DOMOTIC EQUIPMENT
WO2018170727A1 (en) Method and apparatus for determining pickup parameters and electronic equipment
US20090245757A1 (en) Recording system with continuous recording function
JP2007329556A (en) Cradle, imaging apparatus, imaging system, and defect detecting method
JP6095350B2 (en) Imaging apparatus and defective pixel detection method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant