TWI774088B - Food content identifying method and food content identifying system - Google Patents
Food content identifying method and food content identifying system Download PDFInfo
- Publication number
- TWI774088B TWI774088B TW109136048A TW109136048A TWI774088B TW I774088 B TWI774088 B TW I774088B TW 109136048 A TW109136048 A TW 109136048A TW 109136048 A TW109136048 A TW 109136048A TW I774088 B TWI774088 B TW I774088B
- Authority
- TW
- Taiwan
- Prior art keywords
- food
- image
- distance
- data processing
- processing module
- Prior art date
Links
- 235000013305 food Nutrition 0.000 title claims abstract description 196
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000012545 processing Methods 0.000 claims description 87
- 238000001514 detection method Methods 0.000 claims description 81
- 235000013361 beverage Nutrition 0.000 claims description 42
- 235000016709 nutrition Nutrition 0.000 claims description 16
- 235000015097 nutrients Nutrition 0.000 claims description 3
- 239000004615 ingredient Substances 0.000 claims 3
- 238000013507 mapping Methods 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 8
- 235000003166 Opuntia robusta Nutrition 0.000 description 5
- 244000218514 Opuntia robusta Species 0.000 description 5
- 235000012054 meals Nutrition 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 3
- 235000012041 food component Nutrition 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 238000000926 separation method Methods 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000005034 decoration Methods 0.000 description 1
- 238000010191 image analysis Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
Images
Landscapes
- Image Analysis (AREA)
- Image Processing (AREA)
- General Preparation And Processing Of Foods (AREA)
- Confectionery (AREA)
Abstract
Description
本發明有關於餐飲內容的自動識別,特別是關於一種餐飲內容識別方法以及其餐飲內容識別系統。 The invention relates to automatic identification of catering content, in particular to a catering content identification method and a catering content identification system.
在需要快速記錄取用餐飲內容的場合,例如自助式取餐的計價、個人飲食內容管理,往往需要人工辨識並記錄食物的種類、重量,以進一步彙整成其餘的關連資訊,例如餐飲價格、餐飲營養組成。 In the occasions where it is necessary to quickly record the content of catering, such as the pricing of self-service catering, and the management of personal food content, it is often necessary to manually identify and record the type and weight of food, so as to further aggregate other related information, such as catering prices, catering Nutritional composition.
先前技術提出幾種自動識別食物並以量取重量的技術方案。多種技術方案之一是以對應的容器盛裝不同食物,容器上設置機器可判讀標籤,例如條碼、RFID,以供讀取機器快速判讀,透過標籤判讀得到食物種類,並以電子秤等裝置進行重量的量測,藉以區分食物種類以及食物重量。此一方法需要設置相對複雜的設備,同時,食物也必須事先放置於正確的容器中,需要較複雜的前置作業流程。 The prior art proposes several technical solutions for automatically recognizing food and taking its weight. One of the various technical solutions is to store different foods in corresponding containers. Machine-readable labels, such as barcodes and RFID, are installed on the containers, so that the reading machine can quickly interpret them. The types of food can be read through the labels and weighed by electronic scales and other devices. measurement to distinguish food types and food weights. This method requires relatively complicated equipment, and at the same time, the food must be placed in the correct container in advance, which requires a relatively complicated pre-operation process.
另一種技術方案是以影像識別方式分辨食物以及判讀食物體積,再利用食物體積與食物資訊換算食物重量。影像識別需要在完整的待分析影像中排除非屬於食物的部份,而需要較高的運算資源進行影像處理以及影像識別,處理效能受限於硬體效能。而判讀食物體積也依賴影像 識別,透過影像識別分析食物體積帶來了額外的運算負載。同時,為了避免判讀錯誤,食物的三維形狀也受到限制,導致了需要額外的前置作業流程進行食物的處理。 Another technical solution is to use image recognition to distinguish food and interpret food volume, and then use food volume and food information to convert food weight. Image recognition needs to exclude parts that do not belong to food in the complete image to be analyzed, and requires high computing resources for image processing and image recognition, and the processing performance is limited by hardware performance. And interpreting food volume also relies on images Recognition, analyzing food volume through image recognition brings additional computational load. At the same time, in order to avoid misinterpretation, the three-dimensional shape of the food is also limited, resulting in the need for additional pre-processing procedures for food processing.
先前技術中的自動識別食物並以量取重量的技術方案存在著需要設置相對複雜的設備、需要較高的運算資源、或增加額外處理食物的額外前置作業流程的問題。 The technical solution of automatically recognizing food and taking weight in the prior art has the problems of setting up relatively complex equipment, requiring high computing resources, or adding additional pre-processing procedures for additional food processing.
基於上述技術問題,本發明提出一種餐飲內容識別方法,包含:取得一偵測區域上的多個距離值,以產生一距離分佈,並擷取包含偵測區域之一待分析影像;將距離分佈映射至待分析影像;設定一門檻距離,以在待分析影像中定義各距離值小於門檻距離的部份作為至少一待辨識區塊;對至少一待辨識區塊進行影像辨識,識別位於待辨識區塊的一食物的種類;以及依據距離分佈,取得食物的體積。 Based on the above technical problems, the present invention proposes a method for recognizing food and beverage content, comprising: obtaining a plurality of distance values on a detection area to generate a distance distribution, and capturing an image to be analyzed including the detection area; mapping to the image to be analyzed; setting a threshold distance to define a portion of the image to be analyzed whose distance value is smaller than the threshold distance as at least one block to be identified; performing image recognition on at least one block to be identified, and identifying the part located in the image to be identified A type of food in the block; and according to the distance distribution, obtain the volume of the food.
在至少一實施例中,於取得多個距離值之前,持續擷取待分析影像,分析待分析影像是否包含偵測區域。 In at least one embodiment, before obtaining a plurality of distance values, the image to be analyzed is continuously captured, and it is analyzed whether the image to be analyzed includes a detection area.
在至少一實施例中,擷取待分析影像包含以一影像擷取裝置擷取待分析影像,且影像擷取裝置與偵測區域的一表面之間具有一實際基準距離值,門檻距離小於或等於實際基準距離值。 In at least one embodiment, capturing the image to be analyzed includes capturing the image to be analyzed with an image capturing device, and there is an actual reference distance value between the image capturing device and a surface of the detection area, and the threshold distance is less than or Equal to the actual base distance value.
在至少一實施例中,偵測區域的長度以及寬度在待分析影像內佔據的像素數分別為Xn×Yn,且影像擷取裝置與偵測區域的表面之間具有一預設基準距離值,偵測區域於預設基準距離值下的一實際長度以及 一實際寬度在待分析影像內佔據的像素數分別是L×W,實際基準距離值與預設基準距離值之間的關係為:z0'=z0×(L/Xn);或是z0'=z0×(W/Yn);其中,z0為預設基準距離值,z0’為實際基準距離值。 In at least one embodiment, the number of pixels occupied by the length and width of the detection area in the image to be analyzed are respectively Xn×Yn, and there is a predetermined reference distance value between the image capturing device and the surface of the detection area, an actual length of the detection area under the preset reference distance value, and The number of pixels occupied by an actual width in the image to be analyzed is L×W respectively, and the relationship between the actual reference distance value and the preset reference distance value is: z0'=z0×(L/Xn); or z0'= z0×(W/Yn); wherein, z0 is the preset reference distance value, and z0' is the actual reference distance value.
在至少一實施例中,餐飲內容識別方法更包含判斷每一距離值是否介於一距離上限值以及一距離下限值之間的範圍區間;若任一距離值超出距離上限值以及距離下限值的範圍區間,重新取得多個距離值以及重新擷取待分析影像。 In at least one embodiment, the method for identifying food and beverage content further includes determining whether each distance value is within a range between an upper distance value and a lower distance value; if any distance value exceeds the upper distance value and the distance The range interval of the lower limit value, re-acquiring multiple distance values and re-acquiring the image to be analyzed.
在至少一實施例中,餐飲內容識別方法更包含依據距離分佈以及至少一標準容器資訊,識別至少一待辨識區塊是否符合一正確放置的標準容器。 In at least one embodiment, the method for identifying food and beverage content further includes identifying whether at least one block to be identified conforms to a correctly placed standard container according to the distance distribution and at least one standard container information.
在至少一實施例中,識別位於待辨識區塊的食物的種類的步驟包含:載入至少一食物資訊;其中,至少一食物資訊至少包含食物的種類以及一樣本影像;比對待辨識區塊的影像以及樣本影像是否相近似,以於待辨識區塊識別出食物的種類。 In at least one embodiment, the step of identifying the type of food located in the block to be identified includes: loading at least one piece of food information; wherein the at least one piece of food information at least includes the type of food and a sample image; Whether the image and the sample image are similar, so that the type of food can be identified in the block to be identified.
在至少一實施例中,餐飲內容識別方法,更包含:載入至少一食物資訊;其中,至少一食物資訊更包含食物的食物密度;以及將食物密度乘以食物的體積以得到食物的重量。 In at least one embodiment, the food content identification method further includes: loading at least one food information; wherein the at least one food information further includes food density of the food; and multiplying the food density by the volume of the food to obtain the weight of the food.
在至少一實施例中,餐飲內容識別方法,更包含:載入至少一食物資訊;其中,至少一食物資訊還包含營養成分、單位重量價格;以及以營養成分乘以食物的重量,以得到食物的一營養組成;以單位重量價 格乘以食物的重量,以得到食物的價格;以及關連食物的種類、重量、營養組成以及價格於一用餐者,並上傳至一管理平台。 In at least one embodiment, the method for identifying food and beverage content further includes: loading at least one piece of food information; wherein, the at least one food information further includes nutritional components, price per unit weight; and multiplying the nutritional components by the weight of the food to obtain the food A nutritional composition of ; price per unit weight The grid is multiplied by the weight of the food to obtain the price of the food; and the type, weight, nutritional composition and price of the food are associated with a diner and uploaded to a management platform.
在至少一實施例中,餐飲內容識別方法更包含分析至少一待辨識區塊是否符合正確擺放的一標準容器;當至少一待辨識區塊不符合正確擺放的標準容器,產生一錯誤提示。 In at least one embodiment, the method for recognizing food and beverage content further includes analyzing whether at least one block to be identified conforms to a correctly placed standard container; when at least one block to be identified does not conform to a correctly placed standard container, an error message is generated .
本發明還提出一種餐飲內容識別系統,包含一三維掃瞄器、一影像擷取裝置以及一資料處理模組。 The present invention also provides a food and beverage content recognition system, which includes a three-dimensional scanner, an image capture device and a data processing module.
三維掃瞄器用以取得一偵測區域上的多個距離值,以產生一距離分佈。影像擷取裝置用以擷取偵測區域之一待分析影像。資料處理模組電性連接於三維掃瞄器以及影像擷取裝置;其中,資料處理模組將距離分佈映射至待分析影像;資料處理模組並設定一門檻距離,以在待分析影像中定義各距離值小於門檻距離的部份作為至少一待辨識區塊;且資料處理模組對至少一待辨識區塊進行影像辨識,識別位於至少一待辨識區塊的一食物的種類,並依據距離分佈,取得食物的體積。 The three-dimensional scanner is used to obtain a plurality of distance values on a detection area to generate a distance distribution. The image capturing device is used for capturing an image to be analyzed in the detection area. The data processing module is electrically connected to the 3D scanner and the image capture device; wherein, the data processing module maps the distance distribution to the image to be analyzed; the data processing module sets a threshold distance to be defined in the image to be analyzed The portion of each distance value smaller than the threshold distance is used as at least one block to be identified; and the data processing module performs image recognition on the at least one block to be identified, and identifies a type of food located in the at least one block to be identified, and the distance distribution to obtain the volume of the food.
在至少一實施例中,於取得多個距離值之前,影像擷取裝置持續擷取待分析影像,且資料處理模組分析待分析影像是否包含偵測區域。 In at least one embodiment, before obtaining a plurality of distance values, the image capturing device continuously captures the image to be analyzed, and the data processing module analyzes whether the image to be analyzed includes the detection area.
在至少一實施例中,影像擷取裝置與偵測區域的一表面之間具有一實際基準距離值,門檻距離小於或等於實際基準距離值。 In at least one embodiment, there is an actual reference distance between the image capturing device and a surface of the detection area, and the threshold distance is less than or equal to the actual reference distance.
在至少一實施例中,偵測區域的長度以及寬度在待分析影像內佔據的像素數分別為Xn×Yn,且影像擷取裝置與偵測區域的表面之間具有一預設基準距離值,偵測區域於預設基準距離值下的一實際長度以及 一實際寬度在待分析影像內佔據的像素數分別是L×W,實際基準距離值與預設基準距離值之間的關係為:z0'=z0×(L/Xn);或是z0'=z0×(W/Yn);其中,z0為預設基準距離值,z0’為實際基準距離值。 In at least one embodiment, the number of pixels occupied by the length and width of the detection area in the image to be analyzed are respectively Xn×Yn, and there is a predetermined reference distance value between the image capturing device and the surface of the detection area, an actual length of the detection area under the preset reference distance value, and The number of pixels occupied by an actual width in the image to be analyzed is L×W respectively, and the relationship between the actual reference distance value and the preset reference distance value is: z0'=z0×(L/Xn); or z0'= z0×(W/Yn); wherein, z0 is the preset reference distance value, and z0' is the actual reference distance value.
在至少一實施例中,資料處理模組判斷每一距離值是否介於一距離上限值以及一距離下限值之間的範圍區間;若任一距離值超出距離上限值以及距離下限值的範圍區間,以三維掃瞄器以及影像擷取裝置重新取得多個距離值以及重新擷取待分析影像。 In at least one embodiment, the data processing module determines whether each distance value is within a range interval between a distance upper limit value and a distance lower limit value; if any distance value exceeds the distance upper limit value and the distance lower limit The range interval of the value is obtained by using the 3D scanner and the image capturing device to re-acquire a plurality of distance values and re-capture the image to be analyzed.
在至少一實施例中,資料處理模組由載入至少一標準容器資訊,並依據距離分佈以及至少一標準容器資訊,識別至少一待辨識區塊是否符合一正確放置的標準容器。 In at least one embodiment, the data processing module loads at least one standard container information, and identifies whether at least one block to be identified conforms to a correctly placed standard container according to the distance distribution and the at least one standard container information.
在至少一實施例中,資料處理模組載入食物的種類以及一樣本影像,並比對待辨識區塊的影像以及樣本影像是否相近似,以於待辨識區塊識別出食物的種類。 In at least one embodiment, the data processing module loads the type of food and a sample image, and compares the image of the block to be identified and the sample image to determine whether the image of the block to be identified is similar, so as to identify the type of food in the block to be identified.
在至少一實施例中,資料處理模組載入食物的食物密度,並將食物密度乘以食物的體積以得到食物的重量。 In at least one embodiment, the data processing module loads the food density of the food, and multiplies the food density by the volume of the food to obtain the weight of the food.
在至少一實施例中,資料處理模組載入營養成分、單位重量價格,以營養成分乘以食物的重量以得到食物的一營養組成,並以單位重量價格乘以食物的重量以得到食物的價格;且資料處理模組關連食物的種類、重量、營養組成以及價格於一用餐者,並上傳至一管理平台。 In at least one embodiment, the data processing module loads the nutrients and the price per unit weight, multiplies the nutrients by the weight of the food to obtain a nutritional composition of the food, and multiplies the price per unit weight by the weight of the food to obtain the weight of the food. price; and the data processing module relates the type, weight, nutritional composition and price of food to a diner, and uploads it to a management platform.
在至少一實施例中,資料處理模組分析至少一待辨識區塊是否符合正確擺放的一標準容器;當至少一待辨識區塊不符合正確擺放的標準容器,產生一錯誤提示。 In at least one embodiment, the data processing module analyzes whether the at least one block to be identified conforms to a correctly placed standard container; when the at least one block to be identified does not conform to the correctly placed standard container, an error message is generated.
本發明透過三維掃瞄以及影像擷取的結合,由擷取的影像以及三維掃瞄資訊的對應關係,在待分析影像中的偵測區域標記出標準容器所佔有的區域,而僅對標準容器所對應的待辨識區塊進行影像辨識,取代對整個待分析影像進行影像辨識,以判斷食物的種類。因此,本發明可以降低進行影像識別所需要的運算負載,而可加速識別食物過程。同時,透過標準容器的應用,三維掃瞄所取得的距離分佈可以用於有效地且相對精確地計算食物的體積,配合食物資訊之關連,即可快速地分析完整餐飲的資訊,藉以結合用餐者識別資訊進行後端管理。 Through the combination of 3D scanning and image capture, the present invention marks the area occupied by the standard container in the detection area in the image to be analyzed based on the corresponding relationship between the captured image and the 3D scanning information, while only the standard container is detected. Image recognition is performed on the corresponding block to be recognized, instead of performing image recognition on the entire image to be analyzed, so as to determine the type of food. Therefore, the present invention can reduce the computing load required for image recognition, and can speed up the food recognition process. At the same time, through the application of standard containers, the distance distribution obtained by 3D scanning can be used to effectively and relatively accurately calculate the volume of food. With the correlation of food information, the information of the complete meal can be quickly analyzed, so as to combine the diners. Identify information for back-end management.
100:餐飲內容識別系統 100: Catering Content Recognition System
110:三維掃瞄器 110: 3D Scanner
120:影像擷取裝置 120: Image capture device
130:資料處理模組 130:Data processing module
140:支架 140: Bracket
150:容器資料庫 150: Container Repository
160:食物資料庫 160: Food Database
200:食物 200: Food
301,302,303:標準容器 301, 302, 303: Standard Containers
304:非標準容器 304: Non-standard container
400:管理平台 400: Management Platform
A,A’:偵測區域 A,A': detection area
B:待辨識區塊 B: block to be identified
C:待分析影像 C: Image to be analyzed
D:間隔距離 D: separation distance
L:偵測區域A的實際長度 L: Actual length of detection area A
Xn:偵測區域A’的長度 Xn: length of detection area A'
W:偵測區域A的實際寬度 W: Actual width of detection area A
Yn:偵測區域A’的寬度 Yn: Width of detection area A'
P:距離分佈 P: distance distribution
S:放置台 S: Placement table
X:長度方向 X: length direction
Y:寬度方向 Y: width direction
Z:高度方向 Z: height direction
△a:網格區域面積 △a: area of grid area
h:網格高度 h: grid height
z(x,y):距離值 z(x,y): distance value
zmax:門檻距離 zmax: threshold distance
z0:預設基準距離值 z0: preset reference distance value
z0’:實際基準距離值 z0’: Actual reference distance value
Step 112~Step 170:步驟 Step 112~Step 170: Steps
圖1是本發明實施例的餐飲內容識別系統的側面示意圖。 FIG. 1 is a schematic side view of a food and beverage content recognition system according to an embodiment of the present invention.
圖2是本發明實施例的餐飲內容識別系統的俯視示意圖。 FIG. 2 is a schematic top view of a food and beverage content recognition system according to an embodiment of the present invention.
圖3是本發明實施例的餐飲內容識別系統的系統方塊圖。 3 is a system block diagram of a food and beverage content identification system according to an embodiment of the present invention.
圖4是本發明實施例中,映射距離至待分析影像的示意圖。 FIG. 4 is a schematic diagram of mapping distances to images to be analyzed according to an embodiment of the present invention.
圖5是本發明實施例中,校正多個距離值的示意圖。 FIG. 5 is a schematic diagram of correcting a plurality of distance values in an embodiment of the present invention.
圖6是本發明實施例的餐飲內容識別方法的流程圖(一)。 FIG. 6 is a flowchart (1) of a method for recognizing food and beverage content according to an embodiment of the present invention.
圖7是本發明實施例的餐飲內容識別方法中,依據距離門檻定義至少一待辨識區塊的示意圖。 7 is a schematic diagram of defining at least one block to be identified according to a distance threshold in the method for identifying food and beverage content according to an embodiment of the present invention.
圖8是本發明實施例的餐飲內容識別方法中,食物資料庫中的資訊對照表。 FIG. 8 is an information comparison table in a food database in the method for identifying food and beverage content according to an embodiment of the present invention.
圖9是本發明實施例的餐飲內容識別方法中,依據距離分佈取得食物的體積的示意圖。 FIG. 9 is a schematic diagram of obtaining the volume of food according to the distance distribution in the method for recognizing food and beverage content according to an embodiment of the present invention.
圖10是本發明實施例的餐飲內容識別方法的流程圖(二)。 FIG. 10 is a flowchart (2) of a method for recognizing food and beverage content according to an embodiment of the present invention.
圖11是本發明實施例的餐飲內容識別方法的流程圖(三)。 FIG. 11 is a flowchart (3) of a method for recognizing food and beverage content according to an embodiment of the present invention.
圖12是本發明實施例的餐飲內容識別方法的流程圖(四)。 FIG. 12 is a flowchart (4) of a method for recognizing food and beverage content according to an embodiment of the present invention.
圖13是本發明實施例的餐飲內容識別方法中,識別偵測區域的示意圖。 FIG. 13 is a schematic diagram of a recognition detection area in the method for recognizing food and beverage content according to an embodiment of the present invention.
圖14是本發明實施例的餐飲內容識別方法中,定義至少一待辨識區塊的示意圖。 14 is a schematic diagram of defining at least one block to be identified in the method for identifying food and beverage content according to an embodiment of the present invention.
圖15是本發明實施例的餐飲內容識別方法中,分析至少一待辨識區塊是否符合正確擺放的一標準容器的示意圖。 15 is a schematic diagram of analyzing whether at least one block to be identified conforms to a correctly placed standard container in the method for identifying food and beverage content according to an embodiment of the present invention.
以下說明使用的術語「模組」可以是指專用積體電路(ASIC)、電子電路、微處理器,執行一個或多個軟體或韌體程式的晶片、電路設計。模組被配置為執行各種演算法、變換和/或邏輯處理以生成一或多個訊號。當模組以軟體實現時,模組可以作為晶片、電路設計可讀取的程式碼而透過程式碼執行實現於記憶體中。 The term "module" used in the following description may refer to an application specific integrated circuit (ASIC), electronic circuit, microprocessor, chip or circuit design that executes one or more software or firmware programs. The modules are configured to perform various algorithms, transformations and/or logical processing to generate one or more signals. When the module is implemented in software, the module can be implemented in a memory as a code readable by a chip or circuit design through code execution.
如圖1、圖2以及圖3所示,為本發明實施例所揭露的一種餐飲內容識別系統100,用以執行一餐飲內容識別方法,識別位於一偵測區域A中的至少一食物200的種類。餐飲內容識別系統100包含三維掃瞄器110、影像擷取裝置120以及資料處理模組130。
As shown in FIG. 1 , FIG. 2 , and FIG. 3 , a food and beverage
如圖1、圖2以及圖3所示,三維掃瞄器110以及影像擷取裝置120設置於一支架140上,並且三維掃瞄器110以及影像擷取裝置120朝向放置台S,而偵測區域A位於放置台S。
As shown in FIG. 1 , FIG. 2 and FIG. 3 , the
如圖1、圖2、圖3以及圖4所示,三維掃瞄器110用於對於偵測區域A進行三維掃瞄,取得偵測區域A上的多個偵測點的多個距離值z(x,y),以產生一距離分佈。距離分佈,亦即些距離值z(x,y)以及於偵測區域A對應的位置,形成一點雲(point cloud),可呈現偵測區域A的起伏狀態,藉以供資料處理模組130判斷偵測區域A上是否有擺設物件,並且可用於分析物件的三維形態。三維掃瞄器110可以是但不限於深度攝影相機(Stereo Camera)、飛行測距(Time of Flight,TOF)攝影相機、光達、或其他的光學、聲學測距裝置,只要可以偵測多個深度值即可。
As shown in FIG. 1 , FIG. 2 , FIG. 3 and FIG. 4 , the three-
如圖1、圖2、圖3以及圖4所示,影像擷取裝置120用以擷取包含偵測區域A的一待分析影像C。於一具體實施例中,影像擷取裝置120是RGB彩色攝影機,而可擷取彩色的待分析影像C,以利執行影像分析。影像擷取裝置120不限定為彩色攝影機,不排除是單色攝影機,使待分析影像C為單色(黑白)影像。
As shown in FIG. 1 , FIG. 2 , FIG. 3 and FIG. 4 , the
如圖1、圖2、圖3以及圖4所示,資料處理模組130電性連接於三維掃瞄器110以及影像擷取裝置120,用以接收距離分佈以及待分析影像C。架設於支架140上的三維掃瞄器110以及影像擷取裝置120大致上位於相同高度(相對於偵測區域A),但於水平方向上會間隔一間隔距離D。
As shown in FIG. 1 , FIG. 2 , FIG. 3 and FIG. 4 , the
如圖4所示,資料處理模組130可以依據間隔距離D,對距離分佈以及待分析影像C的平面座標關係進行平移(Shift),映射(Mapping)距離分佈P至待分析影像C。
As shown in FIG. 4 , the
如圖5所示,此外,資料處理模組130也利用偵測區域A於待分析影像C的像素資訊與偵測區域A的實際尺寸,校正距離值z(x,y)的基準面,亦即取得影像擷取裝置120至偵測區域A的表面的實際基準距離值z0’。
As shown in FIG. 5 , in addition, the
一般而言,偵測區域A通常為矩型,而有固定的長度以及寬度。例如,本發明實施例以餐盤的表面作為偵測區域A。標準化的餐盤會有固定的長度以及寬度。 Generally speaking, the detection area A is usually rectangular and has a fixed length and width. For example, in the embodiment of the present invention, the surface of the dinner plate is used as the detection area A. Standardized plates have fixed lengths and widths.
如圖5所示,在標準作業狀態下,餐盤平穩地擺設在一平台上,使得偵測區域A的表面至影像擷取裝置120之間具有一預設基準距離值z0。此時,在長度方向X以及寬度方向Y上,偵測區域A的實際長度以及實際寬度在待分析影像C內佔據的像素數分別是L×W。
As shown in FIG. 5 , in a standard operating state, the dinner plate is stably placed on a platform so that there is a predetermined reference distance z0 between the surface of the detection area A and the
實際操作本發明的餐飲內容識別系統100時,使用者可能不會將餐盤完整平放在平台上,也許是手拖著餐盤在某個高度。此時,偵測區域A的平面至影像擷取裝置120之間的距離將會縮小,而使得預設基準距離值z0不適用,導致後續的門檻距離zmax設定錯誤,影響後續的判斷以及計算作業。
When actually operating the food and beverage
如圖5所示,當餐盤被提高而位於較高的高度時,作為偵測區域A’的平面至影像擷取裝置120之間的距離會縮小成為實際基準距離值z0’。此時,資料處理模組130所擷取的待分析影像C中,偵測區域A’會
放大,而使得偵測區域A’的長度以及寬度在待分析影像C內佔據的像素數分別改變為Xn×Yn。
As shown in FIG. 5 , when the dinner plate is raised to a higher height, the distance between the plane serving as the detection area A' and the
在此種情況下,原先儲存於資料處理模組130中的預設基準距離值z0不適用,而需要取得實際基準距離值z0’。此時,實際基準距離值z0’與預設基準距離值z0之間的關係為可利用像素數比例表示如下:z0'=z0×(L/Xn);或是z0'=z0×(W/Yn)。
In this case, the preset reference distance value z0 originally stored in the
如圖2以及圖3所示,不同的食物200分別以不同的標準容器301,302,303裝填,標準容器301,302,303的開口朝向偵測區域A的上方,以使得三維掃瞄器110以及影像擷取裝置120可以偵測標準容器301,302,303的內部的狀況。此外,每一標準容器301,302,303都具有環繞內部空間側壁,使得標準容器301,302,303在偵測區域A中形成一個高於偵測區域A的環狀區域。具體而言,資料處理模組130可內建或連接於一容器資料庫150,容器資料庫150中儲存有標準容器301,302,303的資訊,例如開口的面積與形狀、側壁厚度、容置空間的截面積大小。理想的標準容器301,302,303中,容置空間的截面積較佳地是於高度方向Z上維持一致,如柱狀,而可有利於後續的分析與計算。但不排除容置空間呈現倒置的錐狀,亦即由開口至底部截面積係呈現漸縮,前述的截面積與高度之間的關係只要預先儲存於容器資料庫150,而可快速地經由查表或公式運算取得即可。
As shown in FIG. 2 and FIG. 3 ,
一般而言,例如在自助取餐的場合,用餐者是將所要取用的食物200連同其標準容器301,302,303放置在一餐盤上。因此,偵測區域
A可以設定為位於一餐盤的表面。透過顏色的差異化設定,可以讓餐盤的表面(即偵測區域A)與環境形成對比,而有利於標示出偵測區域A。同時,標準化的餐盤也可以讓偵測區域A具有固定的長度(L)以及寬度(W)。
Generally speaking, for example, in the case of self-service, the diners place the
以下說明本發明實施例所揭露的餐飲內容識別方法。 The following describes the catering content identification method disclosed in the embodiments of the present invention.
如圖1、圖2、圖4以及圖6所示,首先,資料處理模組130啟動並控制三維掃瞄器110以及影像擷取裝置120進行工作。依據資料處理模組130的控制,三維掃瞄器110對於偵測區域A進行三維掃瞄,取得偵測區域A上的多個距離值z(x,y),以產生距離分佈P,如步驟Step 112所示。而影像擷取裝置120擷取包含偵測區域A之一待分析影像C,如步驟Step 114所示。前述步驟Step 112以及步驟Step 114可以同時執行,也可以是依序執行。
As shown in FIG. 1 , FIG. 2 , FIG. 4 and FIG. 6 , first, the
如圖4以及圖6所示,接著,資料處理模組130映射距離分佈P至待分析影像C,如步驟Step 120所示。此一映射步驟,係用以使得每一距離值z(x,y)在待分析影像C上都有一個或一組對應的像素,亦即,每一距離值z(x,y)在待分析影像C上具有一個對應的座標值(x,y)。
As shown in FIG. 4 and FIG. 6 , next, the
如圖6以及圖7所示,資料處理模組130中設定有一門檻距離zmax。依據此一門檻距離zmax,資料處理模組130在待分析影像C中定義各距離值z(x,y)小於門檻距離zmax的部分作為一或多個待辨識區塊B,如步驟Step 130所示。
As shown in FIG. 6 and FIG. 7 , a threshold distance zmax is set in the
如圖7所示,門檻距離zmax可以是設定為落在偵測區域A的表面,也就是將實際基準距離值z0’設定為門檻距離zmax,或是設定一略
小於實際基準距離值z0’的數值作為門檻距離zmax。每一標準容器301,302,303都具有環繞其內部空間的側壁,使得標準容器301,302,303在偵測區域A中形成一個高於偵測區域A表面的環狀區域;即使是空標準容器301,302,303中內部空間的底部,也會因為標準容器301,302,303的實體厚度而高於偵測區域A表面;因此,只要高度高於零,亦即對應距離值z(x,y)小於門檻距離zmax的像素,都可以視為標準容器301,302,303所涵蓋的區域。因此,資料處理模組130可以將待分析影像C中相關像素佔有的部份分離出來作為待辨識區塊B,取代對整個待分析影像C進行分析。
As shown in Fig. 7, the threshold distance zmax can be set to fall on the surface of the detection area A, that is, the actual reference distance value z0' is set as the threshold distance zmax, or set slightly
A value smaller than the actual reference distance value z0' is used as the threshold distance zmax. Each
如圖6以及圖7所示,接著,資料處理模組130對待辨識區塊B進行影像辨識,識別位於待辨識區塊B的一食物200的種類,如步驟Step 140所示。
As shown in FIG. 6 and FIG. 7 , the
如圖6以及圖7所示於步驟Step 130中,資料處理模組130已經將可能放置餐飲的待辨識區塊B分割出來,而排除無關於食物200以及無關於標準容器301,302,303的像素區域。因此,在步驟Step 140中,資料處理模組130只需要對待辨識區塊B進行影像辨識而不需對整個待分析影像C進行影像辨識,資料處理模組130所需要耗損的運算資源較少,而可加速影像辨識效率,並且有效降低辨識錯誤的機率。
As shown in FIG. 6 and FIG. 7 , in
如圖3以及圖8所示,資料處理模組130內建或外接一食物資料庫160。食物資料庫160中儲存有多筆食物資訊。食物資訊包含食物200的種類、樣本影像、食物密度、營養成分、單位重量價格(例如元/100克)等資訊。經由比對待辨識區塊B的影像以及樣本影像是否相近似,資料處理模組130可於待辨識區塊B識別出食物200的種類。
As shown in FIG. 3 and FIG. 8 , the
如圖6所示,依據待辨識區塊B中的距離分佈P,資料處理模組130取得食物200的體積,如步驟Step 150所示。
As shown in FIG. 6 , according to the distance distribution P in the block B to be identified, the
如圖9所示,取得食物200的體積的具體實施例說明如下。待辨識區塊B可被切割為多個網格區域,每一網格區域對應一個距離值z(x,y)。依據標準容器資訊以及偵測區域A表面(即餐盤表面)之實際基準距離值z0’,資料處理模組130可換算出每一網格區域中,食物相對於標準容器301,302,303內部空間的底部的網格高度h。網格高度h乘以網格區域面積△a,即為網格區域中的局部食物200的體積。
As shown in FIG. 9 , a specific embodiment of obtaining the volume of the
最後資料處理模組130加總所有網格區域中的食物200的體積,即為標準容器301,302,303中的食物200的體積,如圖中所示的斜線部分。如前所述,容置空間的截面積較佳地是於高度方向Z上維持一致,如柱狀,而可有利於後續的分析與計算。但不排除容置空間呈現倒置的錐狀;此時,依據標準容器資訊,網格高度h可以依據斜面狀況修正,如圖9中位於邊緣的網格高度h被扣除斜面的平均高度。標準容器資訊可包含標準容器301,302,303以及容置空間的三維型態,因此,網格高度h可以依據三維型態修正,藉以得到正確的食物200的體積。前述圖5以及對應說明所述取得實際基準距離值z0’,就是要避免錯誤地採用預設基準距離值z0,而導致網格高度h被錯誤地增加致使食物200的體積計算錯誤。
Finally, the
如圖6以及圖8所示,最後,依據食物資料庫160載入的食物資訊,以及食物200的體積計算食物200的重量,如步驟Step 160所示。如前所述,食物資訊還包含食物密度、營養成分、單位重量價格等資訊,因此資料處理模組130將食物密度乘以食物200的體積就可以得到食物200
的重量。此外,成分組成中的營養成分分別乘以重量,就可以得到食物200的營養組成。同樣地,單位重量價格乘以重量可以得到食物200的價格。
As shown in FIG. 6 and FIG. 8 , finally, the weight of the
前述的用餐資訊,包含食物200的種類、重量、營養組成以及價格等,可關連於特定用餐者。資料處理模組130關連用餐者識別資訊以及餐飲內容,並上傳至一管理平台400,以進行用餐者的飲食管理或是餐飲費用管理,如步驟Step 170所示。特定用餐者的識別方式,可以是生物特徵辨識、讀取RFID、輸入帳號密碼等,用餐者的識別可於餐飲內容識別方法執行之前進行,且可以是在步驟Step 160之後進行。
The aforementioned meal information, including the type, weight, nutritional composition, and price of the
前述的餐飲內容識別方法係於理想狀態下進行。於實際應用場合,可能遭遇不同問題需要解決,以下進一步說明前述餐飲內容識別方法的變化例。 The above-mentioned method for recognizing food and beverage content is performed under ideal conditions. In practical applications, different problems may be encountered that need to be solved, and the following further describes the variation of the foregoing method for recognizing food and beverage content.
如圖10、圖11以及圖12所示,首先,餐飲內容識別方法的開始,可以是手動啟動,也可以是自動啟動。於自動啟動的場合,資料處理模組130啟動並控制三維掃瞄器110以及影像擷取裝置120進行工作,持續對放置台S進行偵測。影像擷取裝置120持續擷取待分析影像C,並且資料處理模組130持續分析待分析影像C是否包含偵測區域A,步驟Step 116所示。當偵測到待分析影像C包含偵測區域A,資料處理模組130便執行映射距離分佈P至待分析影像C,如步驟Step 120所示,並且繼續執行步驟Step 130。
As shown in FIG. 10 , FIG. 11 , and FIG. 12 , first, the start of the method for recognizing food and beverage content may be started manually or automatically. In the case of automatic activation, the
如圖13所示,偵測區域A為餐盤的表面,於俯視狀態下具有固定的形狀以及特定顏色。因此,資料處理模組130可以依據形狀以及顏色,判斷偵測區域A(即餐盤)是否出現在放置台S,而自動啟動後續辨
識程序。
As shown in FIG. 13 , the detection area A is the surface of the dinner plate, and has a fixed shape and a specific color in a plan view. Therefore, the
如圖5以及圖10所示,接著,資料處理模組130利用分析偵測區域A的影像中的像素資訊與偵測區域A的實際尺寸,以取得實際基準距離值z0’,如步驟Step 122所示。實際基準距離值z0’與預設基準距離值z0之間的關係為可利用像素數比例表示如下:z0'=z0×(L/Xn);或是z0'=z0×(W/Yn)。
As shown in FIG. 5 and FIG. 10 , then, the
如圖10所示,資料處理模組130依據實際基準距離值z0’分析距離值z(x,y)的分佈是否合理,如步驟Step 124所示。例如,依據餐盤厚度、標準容器301,302,303高度、食物可能的填裝量,每一距離值z(x,y)應介於一距離上限值以及一距離下限值之間的範圍區間,若距離值z(x,y)其中之一超出距離上限值以及距離下限值的範圍區間,則距離值z(x,y)為不合理,而需重新執行步驟Step 112以及Step 114。
As shown in FIG. 10, the
於步驟Step 130找出的一或多個待辨識區塊B,即有可能是標準容器301,302,303。標準容器301,302,303的開口朝向偵測區域A的上方,而有固定的俯視形狀。
The one or more to-be-identified blocks B found in
如圖14所示,此時,資料處理模組130可以依據步驟Step 116中所識別出的偵測區域A,去除待分析影像C中一或多個待辨識區塊B以外的部份,以作為後續影像之用。
As shown in FIG. 14 , at this time, the
如圖11所示,資料處理模組130由容器資料庫150載入標準容器301,302,303的資訊,例如開口的面積與形狀,分析待辨識區塊B是否符合標準容器301,302,303的開口的面積與形狀,以判斷每一待辨識區
塊B是否對應於正確擺放的標準容器301,302,303,如步驟Step 132所示。
As shown in FIG. 11 , the
如圖15所示,錯誤的擺放方式包含:標準容器301,302,303之間互相干涉交疊,使等標準容器301,302,303被共同定義為單一待辨識區塊B,導致俯視型態不符合任一標準容器301,302,303的開口形狀;標準容器301,302,303傾倒,導致俯視型態不符合任一標準容器301,302,303的開口形狀;標準容器301,302,303的放置超出偵測區域A,而導致位於偵測區域A的部份之形狀不符合標準容器301,302,303的開口形狀;或是,放置於偵測區域A的為錯誤的非標準容器304。
As shown in FIG. 15 , the wrong arrangement includes: the
如圖11以及圖15所示,當一或多個待辨識區塊B不符合任一標準容器301,302,303的開口形狀,資料處理模組130判斷至少一待辨識區塊B所對應於標準容器301,302,303未正確擺放,則資料處理模組130產生一錯誤提示,並驅動一顯示裝置或一警示裝置發出錯誤提示,如步驟Step 134所示。
As shown in FIG. 11 and FIG. 15 , when one or more blocks B to be identified do not conform to the opening shape of any
如圖11所示,若每一待辨識區塊B對應於正確擺放的標準容器301,302,303,資料處理模組130執行步驟Step 140,識別位於待辨識區塊B的一食物200的種類。當成功識別食物200的種類,則持續進行食物200的體積以及重量的計算,如步驟Step 142、Step 150、Step 160,並且基於用餐者的識別,關連用餐者識別資訊以及餐飲內容,上傳資料至管理平台400,如步驟Step 170所示。
As shown in FIG. 11 , if each block B to be identified corresponds to correctly placed
如圖11以及圖12所示,部分的食物200,可能是以特定的標準容器301,302,303承裝,因此,若步驟Step 142中判斷無法辨識食物200的種類,則資料處理模組130分析是否可依據標準容器資訊,由標準容器
301,302,303的種類判斷食物200的種類,如步驟Step 144所示。若可由標準容器301,302,303的種類判斷食物200的種類,則資料處理模組130繼續執行步驟Step 150、Step 160。若無法由標準容器301,302,303的種類判斷食物200的種類,則資料處理模組130執行步驟Step 134,產生錯誤提示。步驟Step 134也可以省略,於步驟Step 142中判斷無法辨識食物200的種類時,資料處理模組130就直接執行步驟Step 134。
As shown in FIG. 11 and FIG. 12 , some of the
本發明透過三維掃瞄以及影像擷取的結合,由擷取的影像以及三維掃瞄資訊的對應關係,在待分析影像中的偵測區域標記出標準容器所佔有的區域,而僅對標準容器所對應的待辨識區塊進行影像辨識,取代對整個待分析影像進行影像辨識,以判斷食物的種類。因此,本發明可以降低進行影像識別所需要的運算負載,而可加速識別食物過程。同時,透過標準容器的應用,三維掃瞄所取得的距離分佈可以用於有效地且相對精確地計算食物的體積,配合食物資訊之關連,即可快速地分析完整餐飲的資訊,藉以結合用餐者識別資訊進行後端管理。 Through the combination of 3D scanning and image capture, the present invention marks the area occupied by the standard container in the detection area in the image to be analyzed based on the corresponding relationship between the captured image and the 3D scanning information, while only the standard container is detected. Image recognition is performed on the corresponding block to be recognized, instead of performing image recognition on the entire image to be analyzed, so as to determine the type of food. Therefore, the present invention can reduce the computing load required for image recognition, and can speed up the food recognition process. At the same time, through the application of standard containers, the distance distribution obtained by 3D scanning can be used to effectively and relatively accurately calculate the volume of food. With the correlation of food information, the information of the complete meal can be quickly analyzed, so as to combine the diners. Identify information for back-end management.
Step 112~160:步驟 Step 112~160: Steps
Claims (16)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW109136048A TWI774088B (en) | 2020-10-16 | 2020-10-16 | Food content identifying method and food content identifying system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW109136048A TWI774088B (en) | 2020-10-16 | 2020-10-16 | Food content identifying method and food content identifying system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TW202217651A TW202217651A (en) | 2022-05-01 |
| TWI774088B true TWI774088B (en) | 2022-08-11 |
Family
ID=82558815
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW109136048A TWI774088B (en) | 2020-10-16 | 2020-10-16 | Food content identifying method and food content identifying system |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI774088B (en) |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8345930B2 (en) * | 2010-01-22 | 2013-01-01 | Sri International | Method for computing food volume in a method for analyzing food |
| CN107873101A (en) * | 2014-11-21 | 2018-04-03 | 克里斯多夫·M·马蒂 | Imaging systems for object recognition and evaluation |
-
2020
- 2020-10-16 TW TW109136048A patent/TWI774088B/en active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8345930B2 (en) * | 2010-01-22 | 2013-01-01 | Sri International | Method for computing food volume in a method for analyzing food |
| CN107873101A (en) * | 2014-11-21 | 2018-04-03 | 克里斯多夫·M·马蒂 | Imaging systems for object recognition and evaluation |
Non-Patent Citations (2)
| Title |
|---|
| 譯著 林華煒、廖珗洲,使用短距深度攝影機之用餐估算方法的研究,2017年,朝陽科技大學資訊工程系,https://hdl.handle.net/11296/qt8t6d * |
| 譯著 林華煒、廖珗洲,使用短距深度攝影機之用餐估算方法的研究,2017年,朝陽科技大學資訊工程系,https://hdl.handle.net/11296/qt8t6d。 |
Also Published As
| Publication number | Publication date |
|---|---|
| TW202217651A (en) | 2022-05-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11551453B2 (en) | Method and apparatus for shelf feature and object placement detection from shelf images | |
| CN109064509B (en) | Method, apparatus and system for identifying food volume and food calorie | |
| US20240020333A1 (en) | System and method for selecting an item from a plurality of identified items based on a similarity value | |
| US12524890B2 (en) | System and method for detecting a trigger event for identification of an item | |
| US12536674B2 (en) | System and method for identifying unmoved items on a platform during item identification | |
| US20240029276A1 (en) | System and method for identifying moved items on a platform during item identification | |
| US8792715B2 (en) | System and method for forms classification by line-art alignment | |
| US20240029405A1 (en) | System and method for selecting an item from a plurality of identified items by filtering out back images of the items | |
| US20240029277A1 (en) | System and method for camera re-calibration based on an updated homography | |
| US20240020858A1 (en) | System and method for search space reduction for identifying an item | |
| US20250024163A1 (en) | Imaging device for identifying an item | |
| US20240020978A1 (en) | System and method for space search reduction in identifying items from images via item height | |
| US20130101205A1 (en) | Label detecting system, apparatus and method thereof | |
| US20240020859A1 (en) | System and method for identifying an item based on interaction history of a user | |
| US20240020993A1 (en) | System and method for item identification using container-based classification | |
| US20220262088A1 (en) | Image recognition system, image recognition method, and storage medium | |
| US20250024160A1 (en) | Lighting for an imaging device | |
| US20200175318A1 (en) | Medicine inspection support device, image processing device, image processing method, and program | |
| CN108447056A (en) | Power distribution cabinet circular pressing plate state identification method based on geometric properties clustering | |
| CN107679479A (en) | A kind of objective full-filling recognition methods based on morphological image process | |
| KR102547130B1 (en) | Method for measuring volume of postal object | |
| US20190333004A1 (en) | Processing system, processing method, and non-transitory storage medium | |
| TWI774088B (en) | Food content identifying method and food content identifying system | |
| JP2019096162A (en) | Inventory detection program, inventory detection method and inventory detection apparatus | |
| CN114445614A (en) | Catering Content Recognition Method and Catering Content Recognition System |