CN118736563A - A method, device and medium for detecting food maturity - Google Patents
A method, device and medium for detecting food maturity Download PDFInfo
- Publication number
- CN118736563A CN118736563A CN202310315809.2A CN202310315809A CN118736563A CN 118736563 A CN118736563 A CN 118736563A CN 202310315809 A CN202310315809 A CN 202310315809A CN 118736563 A CN118736563 A CN 118736563A
- Authority
- CN
- China
- Prior art keywords
- image
- food
- maturity
- hsv
- value
- 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.)
- Pending
Links
- 235000013305 food Nutrition 0.000 title claims abstract description 193
- 238000000034 method Methods 0.000 title claims abstract description 95
- 238000001514 detection method Methods 0.000 claims abstract description 233
- 239000000463 material Substances 0.000 claims abstract description 30
- 238000006243 chemical reaction Methods 0.000 claims abstract description 23
- 238000012937 correction Methods 0.000 claims description 28
- 238000004590 computer program Methods 0.000 claims description 13
- 230000004927 fusion Effects 0.000 claims description 11
- 238000012545 processing Methods 0.000 claims description 10
- 230000005540 biological transmission Effects 0.000 claims description 6
- 239000003086 colorant Substances 0.000 claims description 5
- 238000010606 normalization Methods 0.000 claims description 5
- 238000012804 iterative process Methods 0.000 claims description 2
- 230000006870 function Effects 0.000 description 30
- 238000010586 diagram Methods 0.000 description 26
- 230000008569 process Effects 0.000 description 26
- 239000004615 ingredient Substances 0.000 description 24
- 238000012360 testing method Methods 0.000 description 17
- 238000000605 extraction Methods 0.000 description 16
- 238000011176 pooling Methods 0.000 description 10
- 238000011156 evaluation Methods 0.000 description 8
- 230000003044 adaptive effect Effects 0.000 description 6
- 239000006071 cream Substances 0.000 description 6
- 230000004048 modification Effects 0.000 description 6
- 238000012986 modification Methods 0.000 description 6
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 5
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 5
- 230000004044 response Effects 0.000 description 5
- 238000012549 training Methods 0.000 description 5
- 230000008859 change Effects 0.000 description 4
- 238000010438 heat treatment Methods 0.000 description 4
- ATJFFYVFTNAWJD-UHFFFAOYSA-N Tin Chemical compound [Sn] ATJFFYVFTNAWJD-UHFFFAOYSA-N 0.000 description 3
- 230000008901 benefit Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000003384 imaging method Methods 0.000 description 3
- 230000001965 increasing effect Effects 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 2
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 2
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 2
- 230000004913 activation Effects 0.000 description 2
- 230000002776 aggregation Effects 0.000 description 2
- 238000004220 aggregation Methods 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 230000003247 decreasing effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 240000004050 Pentaglottis sempervirens Species 0.000 description 1
- 235000004522 Pentaglottis sempervirens Nutrition 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 230000004931 aggregating effect Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 235000015219 food category Nutrition 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/60—Type of objects
- G06V20/68—Food, e.g. fruit or vegetables
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/22—Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/80—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
- G06V10/806—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of extracted features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V2201/00—Indexing scheme relating to image or video recognition or understanding
- G06V2201/07—Target detection
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- Databases & Information Systems (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域Technical Field
本申请涉及图像处理技术领域,具体涉及一种食材成熟度检测方法、设备及介质。The present application relates to the field of image processing technology, and in particular to a method, device and medium for detecting the maturity of food.
背景技术Background Art
目前的智能烤箱多具备成熟度检测功能,该功能用于在烘焙过程中对食材进行检测以确定是否食材是否已烘焙至用户需求的成熟度。例如用户可自行设置烘焙七成熟的牛排,智能烤箱会通过内置摄像头监测食材的烘焙过程,并在确定食材达到七成熟状态时提示用户食材已完成烘焙。Most current smart ovens have a maturity detection function, which is used to detect ingredients during the baking process to determine whether the ingredients have been baked to the degree of maturity required by the user. For example, the user can set the steak to be baked to medium-rare. The smart oven will monitor the baking process of the ingredients through the built-in camera and prompt the user that the ingredients have been baked when it is determined that the ingredients have reached the medium-rare state.
传统的成熟度检测功能多是基于检测网络模型实现的,其通过内置模型对烤箱内部画面的视频图像进行检测来获取食材成熟度的评价指标(主要是食材颜色和形状),继而确定食材是否达到成熟度要求。Traditional maturity detection functions are mostly implemented based on detection network models. They use built-in models to detect video images of the interior of the oven to obtain evaluation indicators of the maturity of the ingredients (mainly the color and shape of the ingredients), and then determine whether the ingredients meet the maturity requirements.
然而烤箱内部的光照环境较为复杂,如红外加热管的光照强度、托盘和锡纸的光反射、外界光源等因素均会影响食材在图像采集过程中的成像效果,这会直接影响模型对食材的图像特征提取的准确性,进而降低模型对食材成熟度检测的精度。However, the lighting environment inside the oven is relatively complex. Factors such as the light intensity of the infrared heating tube, the light reflection of the tray and tin foil, and external light sources will affect the imaging effect of the food during the image acquisition process. This will directly affect the accuracy of the model's image feature extraction of the food, thereby reducing the accuracy of the model's detection of the maturity of the food.
发明内容Summary of the invention
本申请实施例提供一种食材成熟度检测方法、设备及介质。用于在不影响食材自身成熟度指标的判定基础上对食材的图像特征进行增强,继而提高食材成熟度检测的精度。The embodiment of the present application provides a method, device and medium for detecting the maturity of food, which are used to enhance the image features of food without affecting the determination of the maturity index of the food itself, thereby improving the accuracy of food maturity detection.
第一方面,本申请实施例提供了一种食材成熟度检测方法,所述方法包括:In a first aspect, an embodiment of the present application provides a method for detecting the maturity of food materials, the method comprising:
响应于检测指示,获取待测图像;其中,所述待测图像中包含待测食材;In response to the detection instruction, acquiring an image to be tested; wherein the image to be tested includes the food to be tested;
基于预设的像素调整方式对所述待测图像中像素点的色彩值HSV进行改变处理,使所述像素点在HSV值改变之前进行颜色值RGB转换得到的颜色,与所述像素点在HSV值改变之后进行所述RGB转换得到的颜色相同;Based on a preset pixel adjustment method, the color value HSV of the pixel point in the image to be tested is changed so that the color obtained by performing the color value RGB conversion of the pixel point before the HSV value is changed is the same as the color obtained by performing the RGB conversion of the pixel point after the HSV value is changed;
将处理后的待测图像输入已训练的成熟度检测模型进行特征识别,得到待测食材的成熟度检测结果。The processed image to be tested is input into the trained maturity detection model for feature recognition to obtain the maturity detection result of the food to be tested.
在一些可能的实施例中,所述待测图像是通过下述方式获取的:In some possible embodiments, the image to be tested is obtained by:
接收用户指示的待测食材种类;Receiving the type of food to be tested indicated by the user;
对所述智能烤箱的烘焙区域进行图像采集,得到目标图像;Capturing an image of a baking area of the smart oven to obtain a target image;
将所述目标图像输入已训练的目标检测模型进行特征识别,得到所述目标图像中每份食材的食材信息;其中,所述食材信息包括食材的种类和表征食材所在位置的检测框;Inputting the target image into a trained target detection model for feature recognition to obtain food information of each food in the target image; wherein the food information includes the type of food and a detection frame representing the location of the food;
根据所述目标图像中的目标检测框确定所述待测图像;其中,所述目标检测框对应食材的种类为所述待测食材种类。The image to be tested is determined according to a target detection frame in the target image; wherein the type of food corresponding to the target detection frame is the type of food to be tested.
在一些可能的实施例中,所述待测图像包括第一图像和第二图像;所述第一图像包含所述目标图像中的全部待测食材,所述第二图像包含所述第一图像中的任一待测食材;In some possible embodiments, the image to be tested includes a first image and a second image; the first image includes all the food to be tested in the target image, and the second image includes any food to be tested in the first image;
其中,所述成熟度检测结果是通过下述方式获取的:The maturity test result is obtained in the following way:
分别对所述第一图像和所述第二图像进行特征提取,得到所述待测食材在所述第一图像中的第一特征,以及所述待测食材在所述第二图像中的第二特征;Performing feature extraction on the first image and the second image respectively to obtain a first feature of the food to be tested in the first image and a second feature of the food to be tested in the second image;
对所述第一特征和所述第二特征进行归一化处理,并将归一化处理结果和所述第一特征进行特征融合;Normalizing the first feature and the second feature, and fusing the normalized result with the first feature;
通过对特征融合的结果进行特征识别得到所述成熟度检测结果。The maturity detection result is obtained by performing feature recognition on the result of feature fusion.
在一些可能的实施例中,所述根据所述目标图像中的目标检测框确定所述待测图像,包括:In some possible embodiments, determining the image to be detected according to the target detection frame in the target image includes:
获取每个目标检测框在所述目标图像的像素坐标系中的顶点坐标信息;其中,所述顶点坐标信息包括所述目标检测框上各第一顶点的最小横坐标和最小纵坐标,以及各第二顶点中的最大横坐标和最大纵坐标;所述第一顶点为所述目标检测框中指定两条边框的夹角顶点,所述第一顶点和所述第二顶点的连线为所述目标检测框的对角线;Acquire vertex coordinate information of each target detection frame in the pixel coordinate system of the target image; wherein the vertex coordinate information includes the minimum horizontal coordinate and the minimum vertical coordinate of each first vertex on the target detection frame, and the maximum horizontal coordinate and the maximum vertical coordinate of each second vertex; the first vertex is the angle vertex of two specified borders in the target detection frame, and the line connecting the first vertex and the second vertex is the diagonal line of the target detection frame;
根据各所述目标检测框的顶点坐标信息确定所述目标图像中包含全部目标检测框的最小外接矩形区域;Determining the minimum circumscribed rectangular area of all target detection frames in the target image according to the vertex coordinate information of each target detection frame;
根据所述最小外接矩形区域确定所述第一图像,并根据所述第一图像中的目标检测框确定所述第二图像。The first image is determined according to the minimum circumscribed rectangular area, and the second image is determined according to the target detection frame in the first image.
在一些可能的实施例中,所述根据所述最小外接矩形区域确定所述第一图像之前,所述方法包括:In some possible embodiments, before determining the first image according to the minimum circumscribed rectangular area, the method includes:
将所述最小外接矩形区域中指定区域的灰度值调整至预设数值;Adjusting the grayscale value of the designated area within the minimum circumscribed rectangular area to a preset value;
其中,所述指定区域是根据指定检测框确定的,所述指定检测框为所述最小外接矩形区域中每种非待测食材对应的检测框。The designated area is determined according to a designated detection frame, and the designated detection frame is a detection frame corresponding to each non-to-be-tested food in the minimum circumscribed rectangular area.
在一些可能的实施例中,所述食材信息中还包括所述目标检测模型针对每一检测框的检测置信度;所述根据所述第一图像中的目标检测框确定所述第二图像,包括:In some possible embodiments, the food information further includes a detection confidence of the object detection model for each detection frame; and determining the second image according to the object detection frame in the first image includes:
根据所述第一图像中检测置信度最高的目标检测框确定所述第二图像。The second image is determined according to the target detection box with the highest detection confidence in the first image.
在一些可能的实施例中,所述基于预设的像素调整方式对所述待测图像中像素点的色彩值HSV进行改变处理,包括:In some possible embodiments, the changing the color value HSV of the pixel point in the image to be tested based on a preset pixel adjustment method includes:
对所述像素点的HSV值进行多轮迭代调整,在每轮迭代过程中确定所述HSV值在调整前后进行颜色值RGB转换得到的颜色是否相同;若不相同则进入下一轮迭代,若相同则将本轮得到的HSV值作为所述像素点调整后的HSV值;Perform multiple rounds of iterative adjustments on the HSV value of the pixel point, and determine in each round of iteration whether the colors obtained by converting the color value RGB before and after the adjustment of the HSV value are the same; if they are not the same, enter the next round of iteration; if they are the same, use the HSV value obtained in this round as the adjusted HSV value of the pixel point;
其中,任一轮迭代调整包括:Among them, any round of iterative adjustment includes:
根据当前迭代轮数确定本轮校正值和本轮调整方式;其中,首轮的校正值为预设值,非首轮的校正值为首轮校正值的指定倍数;首轮的调整方式为对所述HSV值进行增大或减小,非首轮的调整方式与首轮调整方式相反;Determine the current round correction value and current round adjustment method according to the current iteration round number; wherein the first round correction value is a preset value, and the non-first round correction value is a specified multiple of the first round correction value; the first round adjustment method is to increase or decrease the HSV value, and the non-first round adjustment method is opposite to the first round adjustment method;
采用本轮调整方式以本轮校正值对前一轮得到的HSV值进行调整。The current round adjustment method is used to adjust the HSV value obtained in the previous round with the current round correction value.
在一些可能的实施例中,所述得到待测食材的成熟度检测结果之后,所述方法还包括:In some possible embodiments, after obtaining the maturity test result of the food to be tested, the method further includes:
若所述成熟度检测结果表征所述待测食材已达到指定烘焙状态,则控制所述智能烤箱输出表征待测食材烘焙完成的提示信息。If the maturity detection result indicates that the food to be tested has reached a specified baking state, the intelligent oven is controlled to output a prompt message indicating that baking of the food to be tested is complete.
第二方面,本申请实施例提供了一种烘焙设备,包括数据传输单元和处理器;所述数据传输单元被配置为:响应于检测指示,获取待测图像;其中,所述待测图像中包含待测食材;In a second aspect, an embodiment of the present application provides a baking device, including a data transmission unit and a processor; the data transmission unit is configured to: acquire an image to be tested in response to a detection indication; wherein the image to be tested includes food to be tested;
所述处理器被配置为:基于预设的像素调整方式对所述待测图像中像素点的色彩值HSV进行改变处理,使所述像素点在HSV值改变之前进行颜色值RGB转换得到的颜色,与所述像素点在HSV值改变之后进行所述RGB转换得到的颜色相同;The processor is configured to: change the color value HSV of the pixel point in the image to be tested based on a preset pixel adjustment method, so that the color obtained by performing the color value RGB conversion of the pixel point before the HSV value is changed is the same as the color obtained by performing the RGB conversion of the pixel point after the HSV value is changed;
将处理后的待测图像输入已训练的成熟度检测模型进行特征识别,得到待测食材的成熟度检测结果。The processed image to be tested is input into the trained maturity detection model for feature recognition to obtain the maturity detection result of the food to be tested.
在一些可能的实施例中,所述待测图像是通过下述方式获取的:In some possible embodiments, the image to be tested is obtained by:
接收用户指示的待测食材种类;Receiving the type of food to be tested indicated by the user;
对所述智能烤箱的烘焙区域进行图像采集,得到目标图像;Capturing an image of a baking area of the smart oven to obtain a target image;
将所述目标图像输入已训练的目标检测模型进行特征识别,得到所述目标图像中每份食材的食材信息;其中,所述食材信息包括食材的种类和表征食材所在位置的检测框;Inputting the target image into a trained target detection model for feature recognition to obtain food information of each food in the target image; wherein the food information includes the type of food and a detection frame representing the location of the food;
根据所述目标图像中的目标检测框确定所述待测图像;其中,所述目标检测框对应食材的种类为所述待测食材种类。The image to be tested is determined according to a target detection frame in the target image; wherein the type of food corresponding to the target detection frame is the type of food to be tested.
在一些可能的实施例中,所述待测图像包括第一图像和第二图像;所述第一图像包含所述目标图像中的全部待测食材,所述第二图像包含所述第一图像中的任一待测食材;In some possible embodiments, the image to be tested includes a first image and a second image; the first image includes all the food to be tested in the target image, and the second image includes any food to be tested in the first image;
其中,所述成熟度检测结果是通过下述方式获取的:The maturity test result is obtained in the following way:
分别对所述第一图像和所述第二图像进行特征提取,得到所述待测食材在所述第一图像中的第一特征,以及所述待测食材在所述第二图像中的第二特征;Performing feature extraction on the first image and the second image respectively to obtain a first feature of the food to be tested in the first image and a second feature of the food to be tested in the second image;
对所述第一特征和所述第二特征进行归一化处理,并将归一化处理结果和所述第一特征进行特征融合;Normalizing the first feature and the second feature, and fusing the normalized result with the first feature;
通过对特征融合的结果进行特征识别得到所述成熟度检测结果。The maturity detection result is obtained by performing feature recognition on the result of feature fusion.
在一些可能的实施例中,执行所述根据所述目标图像中的目标检测框确定所述待测图像,所述处理器被配置为:In some possible embodiments, to determine the image to be detected according to the target detection frame in the target image, the processor is configured to:
获取每个目标检测框在所述目标图像的像素坐标系中的顶点坐标信息;其中,所述顶点坐标信息包括所述目标检测框上各第一顶点的最小横坐标和最小纵坐标,以及各第二顶点中的最大横坐标和最大纵坐标;所述第一顶点为所述目标检测框中指定两条边框的夹角顶点,所述第一顶点和所述第二顶点的连线为所述目标检测框的对角线;Acquire vertex coordinate information of each target detection frame in the pixel coordinate system of the target image; wherein the vertex coordinate information includes the minimum horizontal coordinate and the minimum vertical coordinate of each first vertex on the target detection frame, and the maximum horizontal coordinate and the maximum vertical coordinate of each second vertex; the first vertex is the angle vertex of two specified borders in the target detection frame, and the line connecting the first vertex and the second vertex is the diagonal line of the target detection frame;
根据各所述目标检测框的顶点坐标信息确定所述目标图像中包含全部目标检测框的最小外接矩形区域;Determining the minimum circumscribed rectangular area of all target detection frames in the target image according to the vertex coordinate information of each target detection frame;
根据所述最小外接矩形区域确定所述第一图像,并根据所述第一图像中的目标检测框确定所述第二图像。The first image is determined according to the minimum circumscribed rectangular area, and the second image is determined according to the target detection frame in the first image.
在一些可能的实施例中,执行所述根据所述最小外接矩形区域确定所述第一图像之前,所述处理器还被配置为:In some possible embodiments, before executing the step of determining the first image according to the minimum circumscribed rectangular area, the processor is further configured to:
将所述最小外接矩形区域中指定区域的灰度值调整至预设数值;Adjusting the grayscale value of the designated area within the minimum circumscribed rectangular area to a preset value;
其中,所述指定区域是根据指定检测框确定的,所述指定检测框为所述最小外接矩形区域中每种非待测食材对应的检测框。The designated area is determined according to a designated detection frame, and the designated detection frame is a detection frame corresponding to each non-to-be-tested food in the minimum circumscribed rectangular area.
在一些可能的实施例中,所述食材信息中还包括所述目标检测模型针对每一检测框的检测置信度;执行所述根据所述第一图像中的目标检测框确定所述第二图像,所述处理器被配置为:In some possible embodiments, the food information further includes a detection confidence of the target detection model for each detection frame; and to perform determining the second image according to the target detection frame in the first image, the processor is configured to:
根据所述第一图像中检测置信度最高的目标检测框确定所述第二图像。The second image is determined according to the target detection box with the highest detection confidence in the first image.
在一些可能的实施例中,所述基于预设的像素调整方式对所述待测图像中像素点的色彩值HSV进行改变处理,所述处理器被配置为:In some possible embodiments, the color value HSV of the pixel point in the image to be tested is changed based on a preset pixel adjustment method, and the processor is configured as follows:
对所述像素点的HSV值进行多轮迭代调整,在每轮迭代过程中确定所述HSV值在调整前后进行颜色值RGB转换得到的颜色是否相同;若不相同则进入下一轮迭代,若相同则将本轮得到的HSV值作为所述像素点调整后的HSV值;Perform multiple rounds of iterative adjustments on the HSV value of the pixel point, and determine in each round of iteration whether the colors obtained by converting the color value RGB before and after the adjustment of the HSV value are the same; if they are not the same, enter the next round of iteration; if they are the same, use the HSV value obtained in this round as the adjusted HSV value of the pixel point;
其中,任一轮迭代调整包括:Among them, any round of iterative adjustment includes:
根据当前迭代轮数确定本轮校正值和本轮调整方式;其中,首轮的校正值为预设值,非首轮的校正值为首轮校正值的指定倍数;首轮的调整方式为对所述HSV值进行增大或减小,非首轮的调整方式与首轮调整方式相反;Determine the current round correction value and current round adjustment method according to the current iteration round number; wherein the first round correction value is a preset value, and the non-first round correction value is a specified multiple of the first round correction value; the first round adjustment method is to increase or decrease the HSV value, and the non-first round adjustment method is opposite to the first round adjustment method;
采用本轮调整方式以本轮校正值对前一轮得到的HSV值进行调整。The current round adjustment method is used to adjust the HSV value obtained in the previous round with the current round correction value.
在一些可能的实施例中,执行所述得到待测食材的成熟度检测结果之后,所述处理器还被配置为:In some possible embodiments, after obtaining the maturity test result of the food to be tested, the processor is further configured to:
若所述成熟度检测结果表征所述待测食材已达到指定烘焙状态,则控制所述智能烤箱输出表征待测食材烘焙完成的提示信息。If the maturity detection result indicates that the food to be tested has reached a specified baking state, the intelligent oven is controlled to output a prompt message indicating that baking of the food to be tested is complete.
第三方面,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时,实现第一方面中的任一方法。In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any one of the methods in the first aspect is implemented.
第四方面,本申请实施例一种计算机程序产品,其包括计算机指令,所述计算机指令存储在计算机可读存储介质中;当计算机设备的处理器从所述计算机可读存储介质读取所述计算机指令时,所述处理器执行该计算机指令,使得所述计算机设备实现第一方面中的任一方法。In a fourth aspect, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; when a processor of a computer device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, so that the computer device implements any one of the methods in the first aspect.
本申请实施例中,通过在获取包含待测食材的待测图像之后基于预设的像素调整方式对待测图像中各像素点HSV值进行改变,并将处理后的待测图像输入已训练的成熟度检测模型进行特征识别,得到待测食材的成熟度检测结果。In an embodiment of the present application, after obtaining an image to be tested containing the food to be tested, the HSV value of each pixel in the image to be tested is changed based on a preset pixel adjustment method, and the processed image to be tested is input into a trained maturity detection model for feature recognition to obtain a maturity detection result of the food to be tested.
由于食材在图像中的颜色是评判其成熟度的指标之一,而RGB值与HSV值间具有区间对应的转换关系,即对调整前和调整后的HSV值分别进行RGB转换可以得到相同的颜色。因而在保证像素点颜色不变的前提下对HSV值进行微调,能够在不影响食材自身成熟度指标的判定基础上对食材的图像特征进行增强,继而提高食材成熟度检测的精度。Since the color of food in the image is one of the indicators for judging its maturity, and there is an interval-corresponding conversion relationship between RGB value and HSV value, that is, the same color can be obtained by converting the HSV value before and after adjustment to RGB. Therefore, by fine-tuning the HSV value while ensuring that the color of the pixel point remains unchanged, the image features of the food can be enhanced without affecting the determination of the maturity index of the food itself, thereby improving the accuracy of food maturity detection.
本申请的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本公开而了解。本申请的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。Other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present disclosure. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本申请实施例提供的应用场景示意图;FIG1 is a schematic diagram of an application scenario provided by an embodiment of the present application;
图2为本申请实施例提供的一种食材成熟度检测方法的整体流程图;FIG2 is an overall flow chart of a method for detecting the maturity of food provided in an embodiment of the present application;
图3为本申请实施例提供的如何获取待测图像的流程示意图;FIG3 is a schematic diagram of a flow chart of how to obtain an image to be tested according to an embodiment of the present application;
图4为本申请实施例提供的智能烤箱的结构示意图;FIG4 is a schematic diagram of the structure of a smart oven provided in an embodiment of the present application;
图5为本申请实施例提供的目标检测网络的结构示意图;FIG5 is a schematic diagram of the structure of a target detection network provided in an embodiment of the present application;
图6为本申请实施例提供的特征提取模块示意图;FIG6 is a schematic diagram of a feature extraction module provided in an embodiment of the present application;
图7为本申请实施例提供的食材检测模块示意图;FIG. 7 is a schematic diagram of a food detection module provided in an embodiment of the present application;
图8为本申请实施例提供的SPP模块的结构示意图;FIG8 is a schematic diagram of the structure of an SPP module provided in an embodiment of the present application;
图9为本申请实施例提供的检测头模块示意图;FIG9 is a schematic diagram of a detection head module provided in an embodiment of the present application;
图10为本申请实施例提供的目标检测网络的输出示意图;FIG10 is a schematic diagram of the output of a target detection network provided in an embodiment of the present application;
图11为本申请实施例提供的如何第一图像和第二图像的流程示意图;FIG11 is a schematic diagram of a process of generating a first image and a second image according to an embodiment of the present application;
图12为本申请实施例提供的目标检测框的顶点坐标示意图;FIG12 is a schematic diagram of vertex coordinates of a target detection frame provided in an embodiment of the present application;
图13为本申请实施例提供的最小外接矩形区域示意图;FIG13 is a schematic diagram of a minimum circumscribed rectangular area provided in an embodiment of the present application;
图14为本申请实施例提供的第一图像和第二图像的示意图;FIG14 is a schematic diagram of a first image and a second image provided in an embodiment of the present application;
图15为本申请实施例提供的灰度值调整示意图;FIG15 is a schematic diagram of grayscale value adjustment provided in an embodiment of the present application;
图16为本申请实施例提供的第二图像获取流程示意图;FIG16 is a schematic diagram of a second image acquisition process provided in an embodiment of the present application;
图17为本申请实施例提供的HSV转换示意图;FIG17 is a schematic diagram of HSV conversion provided in an embodiment of the present application;
图18为本申请实施例提供的成熟度检测模型结构示意图;FIG18 is a schematic diagram of the structure of a maturity detection model provided in an embodiment of the present application;
图19为本申请实施例提供的特征融合示意图;FIG19 is a schematic diagram of feature fusion provided in an embodiment of the present application;
图20为本申请实施例提供的烘焙设备160的结构示意图。FIG. 20 is a schematic diagram of the structure of the baking equipment 160 provided in an embodiment of the present application.
具体实施方式DETAILED DESCRIPTION
为使本申请的目的、技术方案和优点更加清楚明白,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以按不同于此处的顺序执行所示出或描述的步骤。In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other arbitrarily. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
本申请的说明书和权利要求书及上述附图中的术语“第一”和“第二”是用于区别不同对象,而非用于描述特定顺序。此外,术语“包括”以及它们任何变形,意图在于覆盖不排他的保护。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。本申请中的“多个”可以表示至少两个,例如可以是两个、三个或者更多个,本申请实施例不做限制。The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.
前文已提及,传统的成熟度检测多是基于目标检测技术实现的,其通过内置检测网络模型(例如Yolo系列、Faster-Rnn等网络模型)对表征烤箱内部画面的视频帧进行目标检测来获取食材成熟度的评价指标,该评价指标主要包括待测食材在图像中颜色和形状的变化。继而根据食材成熟度的评价指标确定食材是否达到成熟度要求。As mentioned above, traditional maturity detection is mostly based on target detection technology, which uses built-in detection network models (such as Yolo series, Faster-Rnn and other network models) to perform target detection on video frames representing the internal images of the oven to obtain the evaluation index of the maturity of the food. The evaluation index mainly includes the changes in the color and shape of the food to be tested in the image. Then, it is determined whether the food meets the maturity requirements based on the evaluation index of the food maturity.
然而烤箱内部的光照环境较为复杂,如红外加热管的光照强度、托盘和锡纸的光反射、外界光源等因素均会影响食材在图像采集过程中的成像效果,这会直接影响检测模型对图像中食材特征提取的准确性,继而降低模型对食材成熟度检测的精度。However, the lighting environment inside the oven is relatively complex. Factors such as the light intensity of the infrared heating tube, the light reflection of the tray and tin foil, and external light sources will affect the imaging effect of the food during the image acquisition process. This will directly affect the accuracy of the detection model in extracting food features in the image, thereby reducing the accuracy of the model in detecting the maturity of the food.
为解决上述问题,本申请的发明构思为:通过在获取包含待测食材的待测图像后之后基于预设的像素调整方式对待测图像中各像素点HSV值进行改变,并将处理后的待测图像输入已训练的成熟度检测模型进行特征识别,得到待测食材的成熟度检测结果。由于食材在图像中的颜色是评判其成熟度的指标之一,而RGB值与HSV值间具有区间对应的转换关系,即对调整前和调整后的HSV值分别进行RGB转换可以得到相同的颜色。因而在保证像素点颜色不变的前提下对HSV值进行微调,能够在不影响食材自身成熟度指标的判定基础上对食材的图像特征进行增强,继而提高食材成熟度检测的精度。In order to solve the above problems, the inventive concept of the present application is as follows: after obtaining the image to be tested containing the food to be tested, the HSV value of each pixel in the image to be tested is changed based on a preset pixel adjustment method, and the processed image to be tested is input into the trained maturity detection model for feature recognition to obtain the maturity detection result of the food to be tested. Since the color of the food in the image is one of the indicators for judging its maturity, and there is an interval-corresponding conversion relationship between the RGB value and the HSV value, that is, the same color can be obtained by performing RGB conversion on the HSV values before and after the adjustment. Therefore, the HSV value is fine-tuned under the premise of ensuring that the color of the pixel point remains unchanged, and the image features of the food can be enhanced on the basis of not affecting the determination of the maturity index of the food itself, thereby improving the accuracy of the maturity detection of the food.
接下来如图1所示,图1为本申请实施例提供的针对食材成熟度检测的应用场景示意图。图1示出了网络10、服务器20、存储器30和烘焙设备40。Next, as shown in FIG1 , FIG1 is a schematic diagram of an application scenario for food maturity detection provided by an embodiment of the present application. FIG1 shows a network 10 , a server 20 , a storage 30 and a baking device 40 .
其中,用户可通过网络10向烘焙设备40下达成熟度检测指示,例如用户向烘焙设备下达牛排七成熟的检测指示。烘焙设备40响应于成熟度检测指示,通过内置摄像头对烤箱内部的食材进行图像采集,并将采集到的图像通过网络10传输至服务器20。The user can issue a maturity detection instruction to the baking device 40 through the network 10, for example, the user issues a detection instruction for the steak to be 70% done to the baking device. In response to the maturity detection instruction, the baking device 40 captures an image of the food inside the oven through a built-in camera, and transmits the captured image to the server 20 through the network 10.
服务器20通过内置检测算法对图像进行目标检测,确定图像中表征牛排的颜色和形状的特征参数,根据该特征参数与预设的表征七成熟牛排的参数进行比对,确定牛排是否烘焙至七成熟。并在达到七成熟后控制烘焙设备40向用户发送表征牛排达到七成熟的提示信息。The server 20 detects the target in the image through a built-in detection algorithm, determines the characteristic parameters representing the color and shape of the steak in the image, and compares the characteristic parameters with the preset parameters representing the medium-rare steak to determine whether the steak is baked to medium-rare. After reaching medium-rare, the server 20 controls the baking device 40 to send a prompt message to the user indicating that the steak has reached medium-rare.
需要说明的是,虽然上述流程中仅就单个服务器或烘焙设备加以叙述,但本领域技术人员应当理解的是,图1中示出的烘焙设备40、服务器20和存储器30旨在表示本申请的技术方案涉及的烘焙设备、服务器以及存储器的操作。对单个服务器和存储器加以详述至少为了说明方便,而非暗示对烘焙设备和服务器的数量、类型或是位置等具有限制。It should be noted that, although only a single server or baking device is described in the above process, those skilled in the art should understand that the baking device 40, server 20 and memory 30 shown in FIG1 are intended to represent the operations of the baking device, server and memory involved in the technical solution of the present application. The single server and memory are described in detail at least for the convenience of explanation, and do not imply any limitation on the number, type or location of the baking devices and servers.
应当注意,如果向图示环境中添加附加模块或从其中去除个别模块,不会改变本申请的示例实施例的底层概念。另外,虽然为了方便说明而在图1中示出了从存储器30到服务器20的双向箭头,但本领域技术人员可以理解的是,上述数据的收发也是需要通过网络10实现的。It should be noted that if additional modules are added to the illustrated environment or individual modules are removed therefrom, the underlying concepts of the exemplary embodiments of the present application will not be changed. In addition, although a bidirectional arrow from the storage 30 to the server 20 is shown in FIG. 1 for ease of explanation, it will be understood by those skilled in the art that the sending and receiving of the above data also needs to be implemented through the network 10.
需要说明的是,本申请实施例中的存储器例如可以是缓存系统、也可以是硬盘存储、内存存储等等,其中存储了智能烤箱的类型、支持的工作模式、对不同食材的不同成熟度的评判标准等信息。It should be noted that the memory in the embodiment of the present application can be, for example, a cache system, or a hard disk storage, memory storage, etc., which stores information such as the type of smart oven, supported working modes, and evaluation criteria for different degrees of maturity of different ingredients.
接下来如图2所示,图2示出了本申请实施例提供的一种食材成熟度检测方法的整体流程,包括下述步骤:Next, as shown in FIG. 2 , FIG. 2 shows the overall process of a method for detecting the maturity of food provided in an embodiment of the present application, including the following steps:
步骤201:响应于检测指示,获取待测图像;其中,所述待测图像中包含待测食材;Step 201: In response to a detection instruction, acquiring an image to be tested; wherein the image to be tested includes food to be tested;
本申请实施例中的待处理图像是包含待测食材的图像,待测食材即为用户指示的用于成熟度检测的食材。待测图像的获取方式具体如图3所示,包括下述步骤:The image to be processed in the embodiment of the present application is an image containing the food to be tested, and the food to be tested is the food for maturity detection indicated by the user. The method for obtaining the image to be tested is specifically shown in FIG3 and includes the following steps:
步骤301:接收用户指示的待测食材种类;对智能烤箱的烘焙区域进行图像采集,得到目标图像;Step 301: receiving the type of food to be tested indicated by the user; capturing an image of the baking area of the smart oven to obtain a target image;
本申请实施例的智能烤箱中内设有图像采集装置,具体如图4所示,该图像采集装置设置烤箱的箱体内部棚顶、位于烤箱门的对侧,且以俯视角度拍摄烤箱内的全景,即图像采集装置的采集范围包含烤箱内的每层烤架区域,由此,无论用户将烤盘放置在哪层烤架,均会被图像采集装置完整捕捉。The smart oven of the embodiment of the present application is provided with an image acquisition device, as specifically shown in FIG4 . The image acquisition device is disposed on the internal ceiling of the oven body, on the opposite side of the oven door, and captures the panoramic view inside the oven from a bird's-eye view, that is, the acquisition range of the image acquisition device includes each grill area in the oven. Therefore, no matter which grill area the user places the baking tray on, it will be completely captured by the image acquisition device.
当智能烤箱接收到用户指示的待测食材种类时,控制图像采集装置对图4示出的烘焙区域进行图像采集,得到烘焙区域的目标图像。When the smart oven receives the type of food to be tested indicated by the user, it controls the image acquisition device to acquire an image of the baking area shown in FIG. 4 to obtain a target image of the baking area.
需要说明的是,上述图像采集装置的具体安置方式仅为本申请的一个示例,并非对安置方式进行限定。实际应用中,仅需保证图像采集装置能够完整捕捉每层烤架区域即可。It should be noted that the specific placement of the above-mentioned image acquisition device is only an example of the present application and does not limit the placement method. In practical applications, it is only necessary to ensure that the image acquisition device can completely capture each grill area.
步骤302:将所述目标图像输入已训练的目标检测模型进行特征识别,得到所述目标图像中每份食材的食材信息;其中,所述食材信息包括食材的种类和表征食材所在位置的检测框;Step 302: Input the target image into a trained target detection model for feature recognition to obtain food information of each food in the target image; wherein the food information includes the type of food and a detection frame representing the location of the food;
由于成熟度检测的目的在于智能的给出用户需求的食材温度,而大型智能烤箱中通常包括多层烤架,在相同烘焙温度下,食材在不同烤架处的受热情况是不同的。故,本申请实施例将食材所在烤架层数作为食材成熟度的评价指标之一。Since the purpose of maturity detection is to intelligently provide the food temperature required by the user, and large-scale intelligent ovens usually include multiple layers of grills, the heating conditions of the food in different grills are different at the same baking temperature. Therefore, the embodiment of the present application uses the number of grill layers where the food is located as one of the evaluation indicators of food maturity.
基于此,本申请实施例以多任务深度学习框架构建本申请的目标检测模型,具体如图5所示,该目标检测模型结合了食材的类别检测和层架识别两种分类任务,可以在训练中联合利用两个任务的信息,并通过共享两个任务之间的有用信息来提升模型性能,缩短最优模型出现的时间。Based on this, the embodiment of the present application constructs the target detection model of the present application with a multi-task deep learning framework. As shown in Figure 5, the target detection model combines the two classification tasks of food category detection and shelf recognition. The information of the two tasks can be jointly utilized in training, and the model performance can be improved by sharing useful information between the two tasks, thereby shortening the time it takes for the optimal model to appear.
其中,食材检测主要关注食材本身的特征,层架分类主要关注食材的背景(即烤盘位置、烤架滑轨位置等)信息,通过将两个任务进行结合可以在特征提取模块全面提取整个画面的信息,在训练阶段通过层架数的学习帮助食材检测模型更快的定位食材的位置范围,使分类学习所学到的强判别特征进一步提升目标检测的精度,从而提升算法的性能和泛化能力。Among them, food detection mainly focuses on the characteristics of the food itself, and shelf classification mainly focuses on the background information of the food (i.e. the position of the baking tray, the position of the grill slide, etc.). By combining the two tasks, the feature extraction module can fully extract the information of the entire picture. In the training stage, the learning of the number of shelves helps the food detection model to locate the position range of the food more quickly, so that the strong discriminant features learned by classification learning can further improve the accuracy of target detection, thereby improving the performance and generalization ability of the algorithm.
如图5所示,该模型结构中左下方为食材检测模块,右下方为层架分类模块。通过共享特征提取模块的特征信息并通过损失函数反向传播更新整个模型的参数,在这个过程层架的信息与食材位置的信息会相互影响,促进模型参数的更新速度,二者有机结合在一起。在加载数据之后,引入了transform数据增强,该数据增强方式对目标检测模块是有益的,通过不同的数据增强方式从现有数据中提取更多的特征信息。但是数据增强的一些缩放、裁剪、拉伸等操作会使输入模型的图像尺寸大小不一致,而在分类模块的全连接层之前需要有固定大小食材特征的输入,因此在层架分类模块中引入了自适应平均池化,将不同输入的食材特征在自适应平均池化之后得到统一大小的食材特征,方便后续的全连接层提取分类特征。As shown in Figure 5, the lower left of the model structure is the food detection module, and the lower right is the shelf classification module. By sharing the feature information of the feature extraction module and updating the parameters of the entire model through the back propagation of the loss function, the information of the shelf and the information of the food position will affect each other in this process, promoting the update speed of the model parameters, and the two are organically combined. After loading the data, transform data enhancement is introduced. This data enhancement method is beneficial to the target detection module. More feature information is extracted from the existing data through different data enhancement methods. However, some scaling, cropping, stretching and other operations of data enhancement will make the image size of the input model inconsistent, and fixed-size food features are required before the fully connected layer of the classification module. Therefore, adaptive average pooling is introduced in the shelf classification module. The food features of different inputs are obtained after adaptive average pooling. The food features of uniform size are obtained, which is convenient for the subsequent fully connected layer to extract classification features.
具体的说,上述目标检测网格主要包括数据加载、特征提取、层架分类、食材检测和检测头五部分组成。实施时,预先构建数据加载模块,通过该模块加载训练样本的图像信息继而对加载数据进行transform数据增强,数据增加过程具体包括如裁剪、翻转、尺寸变换、修改亮度、对比度和饱和度、mosaic数据增强、将图片顺序打乱等图像处理操作。Specifically, the target detection grid consists of five parts: data loading, feature extraction, shelf classification, food detection, and detection head. During implementation, a data loading module is pre-built, through which the image information of the training samples is loaded and then the loaded data is transformed for data enhancement. The data enhancement process specifically includes image processing operations such as cropping, flipping, resizing, modifying brightness, contrast and saturation, mosaic data enhancement, and disrupting the order of pictures.
接下来构建如图6所示的特征提取模块,本申请的特征提取模块中引入了残差连接、密集连接和SE通道注意力机制。其中,残差连接作为一种模型集成的方式,可以有效缓解梯度消失问题;而密集连接可以聚合具有不同感受野的中间特征,在信息传播和特征融合阶段起到良好的作用;SE通道注意力机制(图6中示出的Effective SE),可以自适应学习不同通道之间的依赖关系和重要程度,根据重要程度让模型有目的性的去增强对某些特征通道上的特征学习。通过将上述残差连接和密集连接相结合,作为一个局部的CSPRes函数处理模块。并在每个CSPRes函数处理模块之后均引入SE通道注意力机制模块。上述CSPRes函数处理模块作为对图像的主干和局部特征进行提取并聚合的基础模块,可有效提高检测的精度。主干命名为。特征聚合模块采用PAN结构进行特征聚合。Next, a feature extraction module as shown in Figure 6 is constructed. Residual connection, dense connection and SE channel attention mechanism are introduced in the feature extraction module of this application. Among them, residual connection, as a model integration method, can effectively alleviate the gradient vanishing problem; dense connection can aggregate intermediate features with different receptive fields, and play a good role in information propagation and feature fusion stages; SE channel attention mechanism (Effective SE shown in Figure 6) can adaptively learn the dependencies and importance between different channels, and let the model purposefully enhance the feature learning on certain feature channels according to the importance. By combining the above residual connection and dense connection as a local CSPRes function processing module. And the SE channel attention mechanism module is introduced after each CSPRes function processing module. The above CSPRes function processing module is a basic module for extracting and aggregating the backbone and local features of the image, which can effectively improve the detection accuracy. The backbone is named. The feature aggregation module uses the PAN structure for feature aggregation.
在特征提取模块之后接入了前述图5示出的层架分类和食材检测两个模块。层架分类模块包括卷积、归一化、relu激活函数、自适应平均池化、flatten函数(用于提取的特征图拉扁至一维向量)、全连接层、交叉熵损失函数。由于前述对输入的样本图像进行transform数据增强过程中,会使图像在处理后存在尺寸差异,继而导致特征提取得到的特征图尺寸不一致。另由于模型训练任务中,全连接层需要设置固定的输入尺寸方可进行参数学习,故本申请实施例在该模块内引入自适应平均池化,通过自适应平均池化可以对特征图的空间维度进行压缩并同时取出对应维度的均值,以此得到尺寸固定的特征图,继而传入全连接层进行后续操作。After the feature extraction module, the two modules of shelf classification and food detection shown in the above-mentioned Figure 5 are connected. The shelf classification module includes convolution, normalization, relu activation function, adaptive average pooling, flatten function (used to flatten the extracted feature map to a one-dimensional vector), fully connected layer, and cross entropy loss function. Due to the aforementioned transform data enhancement process of the input sample image, the image will have size differences after processing, which will lead to inconsistent feature map sizes obtained by feature extraction. In addition, since in the model training task, the fully connected layer needs to set a fixed input size before parameter learning can be performed, the embodiment of the present application introduces adaptive average pooling in this module. Through adaptive average pooling, the spatial dimension of the feature map can be compressed and the mean of the corresponding dimension can be taken out at the same time, so as to obtain a feature map of fixed size, which is then passed to the fully connected layer for subsequent operations.
具体如图7所示,本申请实施例的食材检测模块在Yoloy3的传统检测模型基础上,新增了用于金字塔池化的SPP模块和改进的PAN模块。其中SPP模块如图8所示,包含3个最大池化层,用于将输入的特征图经过滑窗大小为1x1、3x3、5x5、9x9的最大池化层,再将不同尺度的特征图进行Concat函数处理。本申请实施例中的SPP模块代替了现有Yolov3结构中卷积层后的常规池化层,可以增加感受野,更能获取多尺度特征的融合,训练速度也较快。而PAN模块的引入会对不同层次的特征进行强有力的融合,其在FPN模块的基础上增加了自底向上的特征金字塔结构,保留了更多的浅层位置特征,将整体特征提取能力进一步提升。并且,相较于传统的Yolov3结构,本申请将特征图提取后的融合操作由传统的add函数处理替换为Conca函数处理,这样能够基于通道数来对特征图进行拼接,从而提取到更为丰富的图像特征。As shown in FIG. 7, the food detection module of the embodiment of the present application adds an SPP module and an improved PAN module for pyramid pooling on the basis of the traditional detection model of Yoloy3. The SPP module, as shown in FIG. 8, includes three maximum pooling layers, which are used to pass the input feature map through the maximum pooling layer with sliding window sizes of 1x1, 3x3, 5x5, and 9x9, and then perform Concat function processing on the feature maps of different scales. The SPP module in the embodiment of the present application replaces the conventional pooling layer after the convolution layer in the existing Yolov3 structure, which can increase the receptive field, obtain the fusion of multi-scale features, and the training speed is also faster. The introduction of the PAN module will strongly fuse the features of different levels. It adds a bottom-up feature pyramid structure on the basis of the FPN module, retains more shallow position features, and further improves the overall feature extraction capability. In addition, compared with the traditional Yolov3 structure, the present application replaces the fusion operation after the feature map extraction by the traditional add function processing with the Conca function processing, so that the feature map can be spliced based on the number of channels, thereby extracting richer image features.
图9示出了本申请实施例的检测头模块,检测头模块用于与前述图7示出的食材检测模块进行连接,本申请实施例的检测头模块由三个尺寸的检测头构成,各检测头用于对接收的特征图进行1/8、1/16和1/32尺寸的缩放。假设在特征提取模块输入的图像的尺寸为608x608,则输出的三个检测头的特征图的尺寸为76*76、38*38、19*19。特征图的通道数计算公式为:(4+1+classnum)*3。4代表检测框的长、宽、高和深度信息,1代表当前位置是否有待检测目标,classnum为检测的目标个数,3代表每个检测头分配的三个检测框中每一检测框的上述信息。FIG9 shows a detection head module of an embodiment of the present application, and the detection head module is used to connect with the food detection module shown in FIG7 . The detection head module of the embodiment of the present application is composed of detection heads of three sizes, and each detection head is used to scale the received feature map to 1/8, 1/16 and 1/32. Assuming that the size of the image input to the feature extraction module is 608x608, the size of the feature maps of the three detection heads output is 76*76, 38*38, and 19*19. The calculation formula for the number of channels of the feature map is: (4+1+classnum)*3. 4 represents the length, width, height and depth information of the detection frame, 1 represents whether there is a target to be detected at the current position, classnum is the number of targets to be detected, and 3 represents the above information of each of the three detection frames assigned to each detection head.
目标检测模型的总体损失函数由两个模块的子损失函数通过加权得到,即Loss总=αLoss1+βLoss2。其中α和β为前述两个任务(即图5示出的食材检测和层架分类模块)的权重系数。一种可选的替代方式中,可将Loss1和Loss2两个子损失函数交替进行反向传播,各自更新该子损失函数能够反向传播辐射的范围,两个子损失函数通过范数(例如:二范数)进行约束相互之间的关系,避免二者之间的差异太大,对模型的影响不均衡。如果为了强调某个功能的重要性,可以在反向传播之前给该模块的子损失函数以更大的权重。The overall loss function of the target detection model is obtained by weighting the sub-loss functions of the two modules, that is, Loss total = α Loss 1 + β Loss 2 . Among them, α and β are the weight coefficients of the above two tasks (i.e., the food detection and shelf classification modules shown in Figure 5). In an optional alternative, the two sub-loss functions of Loss 1 and Loss 2 can be back-propagated alternately, and each updates the range of the sub-loss function that can be back-propagated. The two sub-loss functions are constrained by the norm (for example: the second norm) to avoid the difference between the two being too large and the impact on the model being uneven. If you want to emphasize the importance of a certain function, you can give the sub-loss function of the module a greater weight before back-propagation.
本申请实施例对食材检测任务的损失函数(即上述Loss1)进行了改进,具体如下述公式(1)所示,共计六行;其中,公式(1)的首行定义了对于预测值与真实值的中心点横坐标的偏移量的预测误差;第二行定义了当前检测框的中心点纵坐标的偏移量的预测误差;第三行定义了当前检测框的宽、高与标签的相对偏移量误差,第四行和第五行分别表征当前位置是否具有待检测目标,以及对应的置信度;最后一行则为针对待检测目标的分类损失。The embodiment of the present application improves the loss function of the food detection task (i.e., the above-mentioned Loss 1 ), as shown in the following formula (1), which has a total of six lines; wherein, the first line of formula (1) defines the prediction error of the offset of the horizontal coordinate of the center point of the predicted value and the true value; the second line defines the prediction error of the offset of the vertical coordinate of the center point of the current detection frame; the third line defines the relative offset error of the width and height of the current detection frame and the label; the fourth and fifth lines respectively represent whether there is a target to be detected at the current position and the corresponding confidence; the last line is the classification loss for the target to be detected.
需要说明的是,上述公式(1)中最后一行的求取分类损失的部分使用的是本申请改进后的交叉熵损失函数。Yolov3中原始的交叉熵损失函数定义为如下述公式(2)所示,而;而本申请改进后的交叉熵损失函数定义如下述公式(3)所示:It should be noted that the part of calculating the classification loss in the last line of the above formula (1) uses the improved cross entropy loss function of this application. The original cross entropy loss function in Yolov3 is defined as shown in the following formula (2); and the improved cross entropy loss function of this application is defined as shown in the following formula (3):
其中,L为待检测目标(食材)的分类损失,Pi为模型预测的食材种类,qi为图像内食材的真实食材种类,Wi为样本图像中Pi类别的图像占样本图像总数的比重的倒数。Among them, L is the classification loss of the target (ingredient) to be detected, Pi is the type of ingredient predicted by the model, qi is the actual type of ingredient in the image, and Wi is the reciprocal of the proportion of images of category Pi in the sample image to the total number of sample images.
步骤303:根据目标图像中的目标检测框确定待测图像;其中,目标检测框为待测食材的检测框。Step 303: determining the image to be tested according to the target detection frame in the target image; wherein the target detection frame is a detection frame of the food to be tested.
前述图5已说明,本申请的目标检测模型是多任务检测的模型结构,其不仅具备传统的目标检测能力,同时具备对食材所在层架数的识别能力。在模型使用阶段,通过将目标图像输入已训练的目标检测模型进行特征识别,即可得到每种食材所在的层架数和每种食材对应的检测框Anchor。As shown in FIG5 above, the target detection model of the present application is a multi-task detection model structure, which not only has the traditional target detection capability, but also has the ability to identify the number of shelves where the ingredients are located. In the model use stage, by inputting the target image into the trained target detection model for feature recognition, the number of shelves where each ingredient is located and the detection frame Anchor corresponding to each ingredient can be obtained.
例如前述步骤301中得到的目标图像如图10所示,该目标图像中包含的食材两块茶杯蛋糕和一份奶油蛋糕。通过将该目标图像输入目标检测模型进行特征识别,得到每份茶杯蛋糕和奶油蛋糕所在烤架的层架数,以及各食材对应的检测框。For example, the target image obtained in the aforementioned step 301 is shown in FIG10 , and the target image contains two cupcakes and one cream cake. By inputting the target image into the target detection model for feature recognition, the number of racks where each cupcake and cream cake are located, as well as the detection frame corresponding to each ingredient are obtained.
通过上述流程获取目标图像之后,根据目标图像中的目标检测框确定待测图像,具体如图11所示,包括下述步骤:After the target image is acquired through the above process, the image to be tested is determined according to the target detection frame in the target image, as shown in FIG11, including the following steps:
步骤111:获取每个目标检测框在所述目标图像的像素坐标系中的顶点坐标信息;Step 111: obtaining vertex coordinate information of each target detection frame in the pixel coordinate system of the target image;
其中,所述顶点坐标信息包括所述目标检测框上各第一顶点的最小横坐标和最小纵坐标,以及各第二顶点中的最大横坐标和最大纵坐标;所述第一顶点为所述目标检测框中指定两条边框的夹角顶点,所述第一顶点和所述第二顶点的连线为所述目标检测框的对角线。Among them, the vertex coordinate information includes the minimum horizontal coordinate and the minimum vertical coordinate of each first vertex on the target detection frame, and the maximum horizontal coordinate and the maximum vertical coordinate of each second vertex; the first vertex is the angle vertex of two specified borders in the target detection frame, and the line connecting the first vertex and the second vertex is the diagonal line of the target detection frame.
本申请实施例的目标检测框即为包含待测食材的检测框,以前述图10为例,假设用户指示的待测食材为奶油蛋糕,则图10中示出的奶油蛋糕的检测框Anchor2即为目标检测框。The target detection frame of the embodiment of the present application is the detection frame including the food to be tested. Taking the aforementioned FIG. 10 as an example, assuming that the food to be tested indicated by the user is a cream cake, the detection frame Anchor2 of the cream cake shown in FIG. 10 is the target detection frame.
上述步骤111中的第一顶点和第二顶点均为目标检测框的顶点,且第一顶点和第二顶点的连线为目标检测框的对角线。由于检测模型输出的检测框为规则矩形,故第一顶点和第二顶点为矩形任两个对顶角的顶点。The first vertex and the second vertex in the above step 111 are both vertices of the target detection frame, and the line connecting the first vertex and the second vertex is the diagonal line of the target detection frame. Since the detection frame output by the detection model is a regular rectangle, the first vertex and the second vertex are the vertices of any two opposite corners of the rectangle.
步骤112:根据各目标检测框的顶点坐标信息确定目标图像中包含全部目标检测框的最小外接矩形区域;Step 112: determining the minimum circumscribed rectangular area of all target detection frames in the target image according to the vertex coordinate information of each target detection frame;
下面以第一顶点为目标检测框的左上角顶点为例进行说明,由于第一顶点为目标检测框的左上角顶点,所以第二顶点为目标检测框的右下角顶点。The following is an example in which the first vertex is the upper left vertex of the target detection frame. Since the first vertex is the upper left vertex of the target detection frame, the second vertex is the lower right vertex of the target detection frame.
假设待测食材为茶杯蛋糕,如图12所示的目标图像中包含n个茶杯蛋糕,设(xi,yi)为目标图像中第i个茶杯蛋糕所在目标检测框的中心点坐标,Wi为目标检测框的宽度,Hi为目标检测框的高度。则目标检测框的左上角坐标可表示为(xi-0.5Wi,yi-0.5Hi)、右下角坐标表示为(xi+0.5Wi,yi+0.5Hi)。Assume that the food to be tested is a cupcake, and the target image shown in FIG12 contains n cupcakes. Let ( xi , yi ) be the coordinates of the center point of the target detection frame where the i-th cupcake is located in the target image, Wi be the width of the target detection frame, and Hi be the height of the target detection frame. Then the coordinates of the upper left corner of the target detection frame can be expressed as (xi - 0.5Wi , yi - 0.5Hi ), and the coordinates of the lower right corner can be expressed as ( xi + 0.5Wi , yi +0.5Hi ) .
接下来如图13所示,从各目标检测框的左上角坐标中找到最小的左上角横坐标Min(xi-0.5Wi)和最小的左上角纵坐标Min(yi+0.5Hi)。将该横、纵坐标指示的点A作为最小外接矩形区域的左上角坐标,并采用相同的方式,将最大的右下角横坐标Max(xi+0.5Wi)和最大的右下角纵坐标Max(yi+0.5Hi)指示的点B作为最小外接矩形区域的右下角坐标。Next, as shown in FIG13 , the smallest upper left corner horizontal coordinate Min( xi- 0.5Wi ) and the smallest upper left corner vertical coordinate Min( yi +0.5Hi ) are found from the upper left corner coordinates of each target detection frame. Point A indicated by the horizontal and vertical coordinates is used as the upper left corner coordinate of the minimum circumscribed rectangular area, and in the same way, point B indicated by the largest lower right corner horizontal coordinate Max( xi +0.5Wi ) and the largest lower right corner vertical coordinate Max( yi + 0.5Hi ) is used as the lower right corner coordinate of the minimum circumscribed rectangular area.
另如图13所示,通过上述方式确定最小外接矩形区域的左上角顶点A和右下角顶点B之后,根据点A和B的坐标确定最小外接矩形区域的中心点C。然后通过已知三点采用最小外接矩形计算公式即可得到包含全部待测食材的最小外接矩形区域。As shown in FIG13 , after determining the upper left corner vertex A and the lower right corner vertex B of the minimum circumscribed rectangular area in the above manner, the center point C of the minimum circumscribed rectangular area is determined according to the coordinates of points A and B. Then, the minimum circumscribed rectangular area containing all the ingredients to be tested can be obtained by using the minimum circumscribed rectangular calculation formula with the three known points.
步骤113:根据最小外接矩形区域确定第一图像,并根据第一图像中的目标检测框确定第二图像。Step 113: Determine the first image according to the minimum circumscribed rectangular area, and determine the second image according to the target detection frame in the first image.
具体如图14所示,实施时可将该最小外接矩形区域向外扩展预设尺寸,然后将该最小外接矩形区域对应的图像内容作为第一图像。由于第一图像中包含多个待测食材(茶杯蛋糕),故可从中选取任一待测食材的目标检测框,通过对该目标检测框所在区域进行一定尺寸的扩充,并将扩充后的区域对应的图像内容作为第二图像。Specifically, as shown in FIG14 , during implementation, the minimum bounding rectangular area can be expanded outward by a preset size, and then the image content corresponding to the minimum bounding rectangular area is used as the first image. Since the first image contains multiple ingredients to be tested (cup cakes), a target detection frame of any ingredient to be tested can be selected from the first image, and the area where the target detection frame is located is expanded to a certain size, and the image content corresponding to the expanded area is used as the second image.
此外,考虑到实际应用中存在同一烤架内放置有多种食材的情况,即裁剪后的第一图像可能如图15所示,不仅包含茶杯蛋糕还包含非待测食材奶油蛋糕。此时可在根据最小外接矩形区域确定第一图像之前,将最小外接矩形区域中的指定区域的灰度值调整至预设数值。In addition, considering that there are multiple ingredients placed in the same grill in actual applications, the cropped first image may include not only cupcakes but also cream cakes that are not ingredients to be tested, as shown in FIG15. In this case, before determining the first image according to the minimum bounding rectangular area, the grayscale value of the specified area in the minimum bounding rectangular area may be adjusted to a preset value.
具体实施时,可如图15中示出的将指定区域的灰度值调到0,以使指定区域显示为全黑。需要说明的是,该指定区域是根据指定检测框确定的,指定检测框即为最小外接矩形区域中每种非待测食材对应的检测框,即图15中奶油蛋糕的检测框。这样,可以在后续对待测食材进行特征识别时减少非待测食材的特征干扰,继而提高食材成熟度的检测精度。In specific implementation, the grayscale value of the designated area can be adjusted to 0 as shown in FIG15, so that the designated area is displayed in full black. It should be noted that the designated area is determined according to the designated detection frame, which is the detection frame corresponding to each non-test food in the minimum circumscribed rectangular area, that is, the detection frame of the cream cake in FIG15. In this way, the feature interference of non-test food can be reduced during the subsequent feature recognition of the test food, thereby improving the detection accuracy of the maturity of the food.
由于检测任务中模型输出会携带有针对输出结果的置信度,故本申请实施例的食材信息中还可以包括目标检测模型针对每一检测框的置信度。Since the model output in the detection task will carry the confidence level for the output result, the food information in the embodiment of the present application may also include the confidence level of the target detection model for each detection frame.
接下来如图16所示,根据第一图像中的目标检测框确定第二图像时,可以从第一图像中选取置信度最高的目标检测框,然后对该目标检测框进行一定尺寸的扩充,最后根据扩充后的区域对应的图像内容确定第二图像。由此,通过上述流程能够得到包含全部待测食材的第一图像和包含一份待测食材的第二图像。Next, as shown in FIG16 , when determining the second image based on the target detection frame in the first image, the target detection frame with the highest confidence can be selected from the first image, and then the target detection frame is expanded to a certain size, and finally the second image is determined based on the image content corresponding to the expanded area. Thus, the first image containing all the ingredients to be tested and the second image containing one portion of the ingredients to be tested can be obtained through the above process.
步骤202:基于预设的像素调整方式对所述待测图像中像素点的色彩值HSV进行改变处理,使所述像素点在HSV值改变之前进行颜色值RGB转换得到的颜色,与所述像素点在HSV值改变之后进行所述RGB转换得到的颜色相同;Step 202: changing the color value HSV of the pixel point in the image to be tested based on a preset pixel adjustment method, so that the color obtained by performing the color value RGB conversion of the pixel point before the HSV value is changed is the same as the color obtained by performing the RGB conversion of the pixel point after the HSV value is changed;
由于食材的颜色是其成熟度的评价指标之一,烤箱内部的光照环境较为复杂,如红外加热管的光照强度、托盘和锡纸的光反射、外界光源等因素均会影响食材在图像采集过程中的成像效果,这会直接影响检测模型对图像中食材特征提取的准确性,继而降低模型对食材成熟度检测的精度。Since the color of food is one of the evaluation indicators of its maturity, the lighting environment inside the oven is relatively complex. Factors such as the light intensity of the infrared heating tube, the light reflection of the tray and tin foil, and external light sources will affect the imaging effect of the food during the image acquisition process. This will directly affect the accuracy of the detection model in extracting food features in the image, thereby reducing the accuracy of the model in detecting the maturity of the food.
而食材的HSV值(色调H、饱和度S和明度V)与颜色值RGB间可以相互转换,且HSV值与RGB值具备如图17示出的区间对应关系。具体的说,像素点的RGB值可以反映该像素点的颜色。通过对像素点的HSV值进行小幅度的改变之后,再对该像素点进行HSV转RGB操作。该像素点在RGB转换后得到的像素值虽然与HSV改变前会存在不同,但对应的颜色值可以为相同颜色。以前述图17为例,色调H在26~34之间对应的颜色均为黄色,假设当前像素点的色调H为26,则对其进行5%的增强后变为27.3。对其进行RGB转换后虽然像素值相比于调整前存在区别,但其对应的颜色与仍相同(仍为黄色)。The HSV value (hue H, saturation S and brightness V) of the food and the color value RGB can be converted to each other, and the HSV value and the RGB value have an interval correspondence as shown in Figure 17. Specifically, the RGB value of a pixel can reflect the color of the pixel. After a small change in the HSV value of the pixel, the HSV to RGB operation is performed on the pixel. Although the pixel value obtained after the RGB conversion is different from that before the HSV change, the corresponding color value can be the same color. Taking Figure 17 as an example, the colors corresponding to hues H between 26 and 34 are all yellow. Assuming that the hue H of the current pixel is 26, it will be enhanced by 5% to 27.3. Although the pixel value after the RGB conversion is different from that before the adjustment, the corresponding color is still the same (still yellow).
因此,可在保证食材颜色不变的前提下,通过对像素点的HSV值进行微调,使各像素点间的图像特征差异增大,从而对食材起到整体特征增强的效果。具体实施时,可对像素点的HSV值进行多轮迭代调整,在每轮迭代过程中确定HSV值在调整前后进行颜色值RGB转换得到的颜色是否相同。Therefore, under the premise of ensuring that the color of the food remains unchanged, the HSV value of the pixel point can be fine-tuned to increase the difference in image characteristics between the pixels, thereby enhancing the overall characteristics of the food. In specific implementation, the HSV value of the pixel point can be adjusted for multiple rounds of iterations, and in each round of iterations, it is determined whether the color obtained by converting the HSV value to RGB before and after the adjustment is the same.
若不相同则进入下一轮迭代,若相同则将本轮得到的HSV值作为像素点调整后的HSV值;其中,任一轮迭代调整包括:If they are not the same, the next round of iteration will be entered. If they are the same, the HSV value obtained in this round will be used as the HSV value after pixel adjustment. Among them, any round of iterative adjustment includes:
根据当前迭代轮数确定本轮校正值和本轮调整方式;其中,首轮的校正值为预设值,非首轮的校正值为首轮校正值的指定倍数;首轮的调整方式为对HSV值进行增大或减小,非首轮的调整方式与首轮调整方式相反;The correction value and adjustment method of this round are determined according to the current iteration round number; the correction value of the first round is a preset value, and the correction value of the non-first round is a specified multiple of the correction value of the first round; the adjustment method of the first round is to increase or decrease the HSV value, and the adjustment method of the non-first round is opposite to the adjustment method of the first round;
具体的,可对像素点的HSV中的部分或全部数值进行5%的增大或减小,假设首次调整采用的方式为增大5%。即首轮校正值为5%,首轮调整方式为增大。Specifically, some or all of the HSV values of the pixel points may be increased or decreased by 5%, assuming that the first adjustment is to increase by 5%, that is, the first round of correction value is 5%, and the first round of adjustment is to increase.
采用本轮调整方式以本轮校正值对前一轮得到的HSV值进行调整。The current round adjustment method is used to adjust the HSV value obtained in the previous round with the current round correction value.
如果改变后的HSV值进行RGB转换后得到的颜色改变,则需要进入第二轮调整,此时当前调整轮次为2,当前轮的校正值为首轮校正值的一半,即2.5%。当前轮的调整方式与首轮调整方式相反,即缩小。If the color obtained after the changed HSV value is converted to RGB changes, it is necessary to enter the second round of adjustment. At this time, the current adjustment round is 2, and the correction value of the current round is half of the correction value of the first round, that is, 2.5%. The adjustment method of the current round is opposite to that of the first round, that is, reduction.
此时对变更后的HSV值进行反向调整,如果调整后的HSV值进行RGB转换得到的颜色与迭代调整前的颜色相同,则结束迭代流程。否则进入下一轮迭代,由此,可在保证食材颜色不变的前提下,通过对像素点的HSV值进行微调,使各像素点间的图像特征差异增大。At this time, the changed HSV value is adjusted in reverse. If the color obtained by RGB conversion of the adjusted HSV value is the same as the color before the iterative adjustment, the iterative process ends. Otherwise, the next round of iteration is entered. In this way, the image feature differences between pixels can be increased by fine-tuning the HSV value of the pixel while ensuring that the color of the food remains unchanged.
步骤203:将处理后的待测图像输入已训练的成熟度检测模型进行特征识别,得到待测食材的成熟度检测结果。Step 203: input the processed image to be tested into the trained maturity detection model for feature recognition to obtain the maturity detection result of the food to be tested.
本申请实施例的成熟度检测模型结构具体如图18所示,其通过分别对第一图像和第二图像进行特征提取,得到待测食材在第一图像中的第一特征,以及待测食材在第二图像中的第二特征。由于第一图像包含全部待测食材,而第二图像包含一份待测食材,故通过采用第二特征对第一特征进行注意力修正,使食材整体特征更加丰富,最后对提取的特征通过卷积、上采样、自适应平均池化、扁平化处理、全连接层等常规模型处理方式对注意力修正后的食材特征进行特征识别,得到待测食材的成熟度检测结果。其中,图18中示出的CBS为特征提取模块,用于对输入图像进行卷积、归一化处理和SILU函数激活得到输入图像中待测食材的特征。The structure of the maturity detection model of the embodiment of the present application is specifically shown in FIG18, which extracts features from the first image and the second image respectively to obtain the first feature of the food to be tested in the first image and the second feature of the food to be tested in the second image. Since the first image contains all the food to be tested, and the second image contains a portion of the food to be tested, the attention of the first feature is corrected by using the second feature to make the overall feature of the food richer. Finally, the extracted features are processed by conventional models such as convolution, upsampling, adaptive average pooling, flattening, and fully connected layers to perform feature recognition on the attention-corrected food features to obtain the maturity detection result of the food to be tested. Among them, the CBS shown in FIG18 is a feature extraction module, which is used to perform convolution, normalization, and SILU function activation on the input image to obtain the features of the food to be tested in the input image.
本申请实施例的注意力修改流程如图19所示,在获取相同三维(高度H、宽度W和通道数C)的第一特征和第二特征后,通过Reshape函数将其处理为相同高度和通道数的二维特征。通过对处理后的二维的第一特征和第二特征进行Softmax归一化处理,并将归一化处理结果和第一特征以预设的权重系数进行特征融合,然后通过对特征融合的结果进行特征识别得到成熟度检测结果。The attention modification process of the embodiment of the present application is shown in FIG19. After obtaining the first and second features of the same three dimensions (height H, width W, and number of channels C), they are processed into two-dimensional features of the same height and number of channels through the Reshape function. The processed two-dimensional first and second features are subjected to Softmax normalization, and the normalization result and the first feature are subjected to feature fusion with a preset weight coefficient, and then feature recognition is performed on the result of feature fusion to obtain the maturity detection result.
实施时,可将调整HSV后的第二图像进行多张生成的处理。具体的,可在对第二图像进行HSV调整后,对调整后的第二图像进行多张生成处理,使第二图像的数量为偶数。然后将偶数张第二图像和原始的待测图像(1张)一同输入模型进行成熟度检测,这样可得到针对奇数图像的成熟度检测结果,然后选出数量最多的相同成熟度检测结果作为待测食材最终的成熟度检测结果。例如对4张第二图像和1张待测图像进行成熟度检测,得到3份成熟的结果和2份未成熟的结果,则最终判定待测食材已烘焙至成熟。此外,还可结合每张图像对应成熟度检测的置信度进行加权,制定合理的决策方案,本申请对此不作限定。During implementation, the second image after HSV adjustment can be processed to generate multiple images. Specifically, after the HSV adjustment is performed on the second image, the adjusted second image can be processed to generate multiple images so that the number of second images is an even number. Then the even-numbered second images and the original image to be tested (1 image) are input into the model together for maturity detection, so that the maturity detection results for the odd-numbered images can be obtained, and then the largest number of the same maturity detection results are selected as the final maturity detection results of the food to be tested. For example, a maturity test is performed on 4 second images and 1 image to be tested, and 3 mature results and 2 immature results are obtained, then it is finally determined that the food to be tested has been baked to maturity. In addition, the confidence level of the maturity detection corresponding to each image can be weighted to formulate a reasonable decision-making plan, which is not limited in this application.
得到待测食材的成熟度检测结果后,若确定该成熟度检测结果表征待测食材已达到指定的烘焙状态,则控制智能烤箱输出表征食材烘焙完成的提示信息。另当烤盘中仅包含同种类食材,即烤箱内只有待测食材时,可控制智能烤箱在确定待测食材达到指定的烘焙状态后停止烘焙。After obtaining the maturity test result of the food to be tested, if it is determined that the maturity test result indicates that the food to be tested has reached the specified baking state, the smart oven is controlled to output a prompt message indicating that the food is baked. In addition, when the baking tray contains only the same type of food, that is, there is only the food to be tested in the oven, the smart oven can be controlled to stop baking after determining that the food to be tested has reached the specified baking state.
上述流程中,通过以增大或缩小的方式对像素点的HSV值进行微调,并在调整过程中保证对调整前后的HSV值进行RGB转换可以得到相同的颜色。由于食材颜色是衡量其成熟度的评价指标,由此可在不影响食材自身成熟度指标的判定基础上对食材的图像特征进行增强,继而提高食材成熟度检测的精度。In the above process, the HSV value of the pixel is fine-tuned by increasing or decreasing it, and during the adjustment process, it is ensured that the RGB conversion of the HSV value before and after the adjustment can obtain the same color. Since the color of the food is an evaluation index to measure its maturity, the image features of the food can be enhanced without affecting the determination of the maturity index of the food itself, thereby improving the accuracy of the food maturity detection.
接下来从本申请技术方案应用过程中的可信赖特性进行分析。经试验测得,将本申请技术方案应用与烘焙设备中,通过烘焙设备内置摄像头对待测图像进行采集并传输至处理器之后可在500毫秒内得到成熟度检测结果,满足可信赖特性中实时性的特质。另通过对试验数据进行统计发现,从全画面角度对待测图像中的食材种类和成熟度判定,其准确率能够达到100%,符合可信赖特性中可靠性和可泛化性的特点。Next, the trust characteristics of the application process of the technical solution of this application are analyzed. Through experimental measurements, the technical solution of this application is applied to baking equipment. After the image to be tested is collected by the built-in camera of the baking equipment and transmitted to the processor, the maturity test result can be obtained within 500 milliseconds, which meets the real-time characteristics of the trust characteristics. In addition, through statistical analysis of the test data, it is found that the accuracy of judging the type and maturity of the food in the image to be tested from the perspective of the whole screen can reach 100%, which meets the characteristics of reliability and generalizability in the trust characteristics.
此外,处理器将成熟度检测结果反馈至前端(如烘焙设备的显示屏)之后,可以由用户选择接受智能建议或者不采用,工作过程可以被人类或其它智能体(用户)干预,符合可信赖特性中可控性的特点。另在复现性环境中试验发现,将相同食材放置在烘焙设备的不同位置(例如烤箱的不同层架)、不同容器中、随着烘培温度的升高以及外部灯光开关等不同因素下,并未对检测结果造成干扰,符合可信赖特性中可复现性的特点。In addition, after the processor feeds back the maturity test results to the front end (such as the display screen of the baking equipment), the user can choose to accept the intelligent suggestions or not, and the working process can be intervened by humans or other intelligent agents (users), which is in line with the controllability feature of the trustworthy characteristics. In addition, in the reproducible environment, the test found that placing the same ingredients in different positions of the baking equipment (such as different shelves of the oven), in different containers, with the increase of baking temperature and external light switches, did not interfere with the test results, which is in line with the reproducibility feature of the trustworthy characteristics.
基于相同的发明构思,本申请实施例提供了一种烘焙设备160具体如图20所示,包括:数据传输单元161和处理器162;Based on the same inventive concept, the embodiment of the present application provides a baking device 160 as shown in FIG. 20 , including: a data transmission unit 161 and a processor 162 ;
所述数据传输单元161被配置为:响应于检测指示,获取待测图像;其中,所述待测图像中包含待测食材;The data transmission unit 161 is configured to: acquire an image to be tested in response to a detection indication; wherein the image to be tested includes the food to be tested;
所述处理器162被配置为:基于预设的像素调整方式对所述待测图像中像素点的色彩值HSV进行改变处理,使所述像素点在HSV值改变之前进行颜色值RGB转换得到的颜色,与所述像素点在HSV值改变之后进行所述RGB转换得到的颜色相同;The processor 162 is configured to: change the color value HSV of the pixel point in the image to be tested based on a preset pixel adjustment method, so that the color obtained by performing the color value RGB conversion of the pixel point before the HSV value is changed is the same as the color obtained by performing the RGB conversion of the pixel point after the HSV value is changed;
将处理后的待测图像输入已训练的成熟度检测模型进行特征识别,得到待测食材的成熟度检测结果。The processed image to be tested is input into the trained maturity detection model for feature recognition to obtain the maturity detection result of the food to be tested.
在一些可能的实施例中,所述待测图像是通过下述方式获取的:In some possible embodiments, the image to be tested is obtained by:
接收用户指示的待测食材种类;Receiving the type of food to be tested indicated by the user;
对所述智能烤箱的烘焙区域进行图像采集,得到目标图像;Capturing an image of a baking area of the smart oven to obtain a target image;
将所述目标图像输入已训练的目标检测模型进行特征识别,得到所述目标图像中每份食材的食材信息;其中,所述食材信息包括食材的种类和表征食材所在位置的检测框;Inputting the target image into a trained target detection model for feature recognition to obtain food information of each food in the target image; wherein the food information includes the type of food and a detection frame representing the location of the food;
根据所述目标图像中的目标检测框确定所述待测图像;其中,所述目标检测框对应食材的种类为所述待测食材种类。The image to be tested is determined according to a target detection frame in the target image; wherein the type of food corresponding to the target detection frame is the type of food to be tested.
在一些可能的实施例中,所述待测图像包括第一图像和第二图像;所述第一图像包含所述目标图像中的全部待测食材,所述第二图像包含所述第一图像中的任一待测食材;In some possible embodiments, the image to be tested includes a first image and a second image; the first image includes all the food to be tested in the target image, and the second image includes any food to be tested in the first image;
其中,所述成熟度检测结果是通过下述方式获取的:The maturity test result is obtained in the following way:
分别对所述第一图像和所述第二图像进行特征提取,得到所述待测食材在所述第一图像中的第一特征,以及所述待测食材在所述第二图像中的第二特征;Performing feature extraction on the first image and the second image respectively to obtain a first feature of the food to be tested in the first image and a second feature of the food to be tested in the second image;
对所述第一特征和所述第二特征进行归一化处理,并将归一化处理结果和所述第一特征进行特征融合;Normalizing the first feature and the second feature, and fusing the normalized result with the first feature;
通过对特征融合的结果进行特征识别得到所述成熟度检测结果。The maturity detection result is obtained by performing feature recognition on the result of feature fusion.
在一些可能的实施例中,执行所述根据所述目标图像中的目标检测框确定所述待测图像,所述处理器162被配置为:In some possible embodiments, to determine the image to be detected according to the target detection frame in the target image, the processor 162 is configured to:
获取每个目标检测框在所述目标图像的像素坐标系中的顶点坐标信息;其中,所述顶点坐标信息包括所述目标检测框上各第一顶点的最小横坐标和最小纵坐标,以及各第二顶点中的最大横坐标和最大纵坐标;所述第一顶点为所述目标检测框中指定两条边框的夹角顶点,所述第一顶点和所述第二顶点的连线为所述目标检测框的对角线;Acquire vertex coordinate information of each target detection frame in the pixel coordinate system of the target image; wherein the vertex coordinate information includes the minimum horizontal coordinate and the minimum vertical coordinate of each first vertex on the target detection frame, and the maximum horizontal coordinate and the maximum vertical coordinate of each second vertex; the first vertex is the angle vertex of two specified borders in the target detection frame, and the line connecting the first vertex and the second vertex is the diagonal line of the target detection frame;
根据各所述目标检测框的顶点坐标信息确定所述目标图像中包含全部目标检测框的最小外接矩形区域;Determining the minimum circumscribed rectangular area of all target detection frames in the target image according to the vertex coordinate information of each target detection frame;
根据所述最小外接矩形区域确定所述第一图像,并根据所述第一图像中的目标检测框确定所述第二图像。The first image is determined according to the minimum circumscribed rectangular area, and the second image is determined according to the target detection frame in the first image.
在一些可能的实施例中,执行所述根据所述最小外接矩形区域确定所述第一图像之前,所述处理器162还被配置为:In some possible embodiments, before determining the first image according to the minimum circumscribed rectangular area, the processor 162 is further configured to:
将所述最小外接矩形区域中指定区域的灰度值调整至预设数值;Adjusting the grayscale value of the designated area within the minimum circumscribed rectangular area to a preset value;
其中,所述指定区域是根据指定检测框确定的,所述指定检测框为所述最小外接矩形区域中每种非待测食材对应的检测框。The designated area is determined according to a designated detection frame, and the designated detection frame is a detection frame corresponding to each non-to-be-tested food in the minimum circumscribed rectangular area.
在一些可能的实施例中,所述食材信息中还包括所述目标检测模型针对每一检测框的检测置信度;执行所述根据所述第一图像中的目标检测框确定所述第二图像,所述处理器162被配置为:In some possible embodiments, the food information further includes a detection confidence of the target detection model for each detection frame; and to perform determining the second image according to the target detection frame in the first image, the processor 162 is configured to:
根据所述第一图像中检测置信度最高的目标检测框确定所述第二图像。The second image is determined according to the target detection box with the highest detection confidence in the first image.
在一些可能的实施例中,所述基于预设的像素调整方式对所述待测图像中像素点的色彩值HSV进行改变处理,所述处理器162被配置为:In some possible embodiments, the color value HSV of the pixel point in the image to be tested is changed based on a preset pixel adjustment method, and the processor 162 is configured as follows:
对所述像素点的HSV值进行多轮迭代调整,在每轮迭代过程中确定所述HSV值在调整前后进行颜色值RGB转换得到的颜色是否相同;若不相同则进入下一轮迭代,若相同则将本轮得到的HSV值作为所述像素点调整后的HSV值;Perform multiple rounds of iterative adjustments on the HSV value of the pixel point, and determine in each round of iteration whether the colors obtained by converting the color value RGB before and after the adjustment of the HSV value are the same; if they are not the same, enter the next round of iteration; if they are the same, use the HSV value obtained in this round as the adjusted HSV value of the pixel point;
其中,任一轮迭代调整包括:Among them, any round of iterative adjustment includes:
根据当前迭代轮数确定本轮校正值和本轮调整方式;其中,首轮的校正值为预设值,非首轮的校正值为首轮校正值的指定倍数;首轮的调整方式为对所述HSV值进行增大或减小,非首轮的调整方式与首轮调整方式相反;Determine the current round correction value and current round adjustment method according to the current iteration round number; wherein the first round correction value is a preset value, and the non-first round correction value is a specified multiple of the first round correction value; the first round adjustment method is to increase or decrease the HSV value, and the non-first round adjustment method is opposite to the first round adjustment method;
采用本轮调整方式以本轮校正值对前一轮得到的HSV值进行调整。The current round adjustment method is used to adjust the HSV value obtained in the previous round with the current round correction value.
在一些可能的实施例中,执行所述得到待测食材的成熟度检测结果之后,所述处理器162还被配置为:In some possible embodiments, after obtaining the maturity test result of the food to be tested, the processor 162 is further configured to:
若所述成熟度检测结果表征所述待测食材已达到指定烘焙状态,则控制所述智能烤箱输出表征待测食材烘焙完成的提示信息。If the maturity detection result indicates that the food to be tested has reached a specified baking state, the intelligent oven is controlled to output a prompt message indicating that baking of the food to be tested is complete.
上述烘焙设备160也可以与一个或多个外部设备(例如键盘、指向设备等)通信,还可与一个或者多个使得用户能与烘焙设备160交互的设备通信,和/或与使得该烘焙设备160能与一个或多个其它烘焙设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口进行。并且,烘焙设备160还可以通过网络适配器与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。网络适配器通过总线与用于烘焙设备160的其它模块通信。应当理解,尽管图中未示出,可以结合烘焙设备160使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理器、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The baking device 160 can also communicate with one or more external devices (e.g., keyboards, pointing devices, etc.), and can also communicate with one or more devices that enable users to interact with the baking device 160, and/or communicate with any device (e.g., routers, modems, etc.) that enables the baking device 160 to communicate with one or more other baking devices. Such communication can be performed through an input/output (I/O) interface. In addition, the baking device 160 can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and/or public networks, such as the Internet) through a network adapter. The network adapter communicates with other modules for the baking device 160 through a bus. It should be understood that, although not shown in the figure, other hardware and/or software modules can be used in conjunction with the baking device 160, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
在示例性实施例中,还提供了一种包括指令的计算机可读存储介质,例如包括指令的存储器,上述指令可由上述装置的处理器162执行以完成上述方法。可选地,计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the instructions can be executed by the processor 162 of the above-mentioned device to complete the above-mentioned method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
在示例性实施例中,还提供一种计算机程序产品,包括计算机程序/指令,所述计算机程序/指令被处理器162执行时实现如本申请提供的一种食材成熟度检测方法中的任一方法。In an exemplary embodiment, a computer program product is also provided, including a computer program/instruction, which, when executed by the processor 162, implements any of the methods for detecting the maturity of food provided in the present application.
在示例性实施例中,本申请提供的一种食材成熟度检测方法的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当程序产品在计算机设备上运行时,程序代码用于使计算机设备执行本说明书上述描述的根据本申请各种示例性实施方式的一种食材成熟度检测方法中的步骤。In an exemplary embodiment, various aspects of a method for detecting the maturity of food provided in the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of a method for detecting the maturity of food according to various exemplary embodiments of the present application described above in this specification.
程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
本申请的实施方式的用于食材成熟度检测的程序产品可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在烘焙设备上运行。然而,本申请的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。The program product for detecting the maturity of food materials of the embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a baking device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.
可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括——但不限于——电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein readable program code is carried. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于——无线、有线、光缆、RF等等,或者上述的任意合适的组合。The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言的任意组合来编写用于执行本申请操作的程序代码,程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如语言或类似的程序设计语言。程序代码可以完全地在用户烘焙设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户烘焙设备上部分在远程烘焙设备上执行、或者完全在远程烘焙设备或服务端上执行。在涉及远程烘焙设备的情形中,远程烘焙设备可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户烘焙设备,或者,可以连接到外部烘焙设备(例如利用因特网服务提供商来通过因特网连接)。The program code for performing the operations of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also conventional procedural programming languages such as language or similar programming languages. The program code can be executed entirely on the user baking device, partially on the user device, as a separate software package, partially on the user baking device and partially on the remote baking device, or entirely on the remote baking device or server. In the case of a remote baking device, the remote baking device can be connected to the user baking device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external baking device (for example, using an Internet service provider to connect through the Internet).
应当注意,尽管在上文详细描述中提及了装置的若干单元或子单元,但是这种划分仅仅是示例性的并非强制性的。实际上,根据本申请的实施方式,上文描述的两个或更多单元的特征和功能可以在一个单元中具体化。反之,上文描述的一个单元的特征和功能可以进一步划分为由多个单元来具体化。It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
此外,尽管在附图中以特定顺序描述了本申请方法的操作,但是,这并非要求或者暗示必须按照该特定顺序来执行这些操作,或是必须执行全部所示的操作才能实现期望的结果。附加地或备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,和/或将一个步骤分解为多个步骤执行。In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and/or one step may be decomposed into multiple steps.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程图像缩放设备的处理器以产生一个机器,使得通过计算机或其他可编程图像缩放设备的处理器执行的指令产生用于实现在流程图一个或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to the flowcharts and/or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of the processes and/or boxes in the flowchart and/or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable image scaling device to produce a machine, so that the instructions executed by the processor of the computer or other programmable image scaling device produce a device for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程图像缩放设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable image scaling device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程图像缩放设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable image scaling device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows in the flowchart and/or one or more blocks in the block diagram.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310315809.2A CN118736563A (en) | 2023-03-28 | 2023-03-28 | A method, device and medium for detecting food maturity |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310315809.2A CN118736563A (en) | 2023-03-28 | 2023-03-28 | A method, device and medium for detecting food maturity |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118736563A true CN118736563A (en) | 2024-10-01 |
Family
ID=92868016
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310315809.2A Pending CN118736563A (en) | 2023-03-28 | 2023-03-28 | A method, device and medium for detecting food maturity |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118736563A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119131121A (en) * | 2024-11-12 | 2024-12-13 | 深圳市凯度电器有限公司 | A method and related device for detecting oven performance based on image processing |
-
2023
- 2023-03-28 CN CN202310315809.2A patent/CN118736563A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119131121A (en) * | 2024-11-12 | 2024-12-13 | 深圳市凯度电器有限公司 | A method and related device for detecting oven performance based on image processing |
CN119131121B (en) * | 2024-11-12 | 2025-02-18 | 深圳市凯度电器有限公司 | Oven performance detection method and related device based on image processing |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Santo et al. | Deep photometric stereo network | |
Li et al. | Insulator defect detection for power grid based on light correction enhancement and YOLOv5 model | |
CN103942755B (en) | Brightness of image adjusting method and device | |
CN110046673A (en) | No reference tone mapping graph image quality evaluation method based on multi-feature fusion | |
JP7512150B2 (en) | Information processing device, information processing method, and program | |
CN112991218B (en) | Image processing method, device, equipment and storage medium | |
CN112730251A (en) | Device and method for detecting color defects of screen | |
CN111898525A (en) | Smoke recognition model construction method, smoke detection method and smoke detection device | |
CN116189160A (en) | Infrared dim target detection method based on local contrast mechanism | |
CN118154687B (en) | Target positioning and obstacle avoidance method and system for food delivery robot based on monocular vision | |
CN113609904B (en) | Single-target tracking algorithm based on dynamic global information modeling and twin network | |
CN106157264A (en) | Large area image uneven illumination bearing calibration based on empirical mode decomposition | |
CN117523298A (en) | A steel surface defect detection method and system | |
WO2024060978A1 (en) | Key point detection model training method and apparatus and virtual character driving method and apparatus | |
CN118736563A (en) | A method, device and medium for detecting food maturity | |
CN117475354A (en) | Automatic control system and method for food processing equipment | |
CN119180793A (en) | Fan blade defect detection system and method based on multi-mode sensing | |
CN118172608A (en) | A method and system for analyzing Helicobacter pylori bacterial culture images | |
CN110319933A (en) | A kind of light source light spectrum optimization method based on CAM02-UCS colored quantum noise | |
CN117237939B (en) | Image data-based detection method and device for food maturity of young cooker | |
CN112949641B (en) | Image segmentation method, electronic device, and computer-readable storage medium | |
CN115456058A (en) | A cross-modal data optimization method, device and storage medium in automatic driving technology | |
CN120070222B (en) | Color compensation system and method based on self-adaptive color matching | |
JP2015125513A (en) | Image processing method, image processor and program | |
JP2025031493A (en) | Image processing device, image processing system, and image processing 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 |