[go: up one dir, main page]

TWI908581B - Dual-band image sensing device, image analysis method and applications thereof - Google Patents

Dual-band image sensing device, image analysis method and applications thereof

Info

Publication number
TWI908581B
TWI908581B TW114100724A TW114100724A TWI908581B TW I908581 B TWI908581 B TW I908581B TW 114100724 A TW114100724 A TW 114100724A TW 114100724 A TW114100724 A TW 114100724A TW I908581 B TWI908581 B TW I908581B
Authority
TW
Taiwan
Prior art keywords
image
unit
infrared
visible light
dual
Prior art date
Application number
TW114100724A
Other languages
Chinese (zh)
Inventor
李宗憲
蔡宛頻
李益銘
Original Assignee
國立臺灣科技大學
Filing date
Publication date
Application filed by 國立臺灣科技大學 filed Critical 國立臺灣科技大學
Application granted granted Critical
Publication of TWI908581B publication Critical patent/TWI908581B/en

Links

Abstract

A dual-band image sensing device comprises a containing unit and a light source and image capturing module positioned above the containing unit, capable of viewing the testing object. The device of the present invention includes at least an infrared light source unit, a visible light source unit, and an image capturing unit for acquiring infrared and visible light images of the testing object. An image analysis and machine learning module is signal-connected to the image capturing unit and includes an image preprocessing unit and an image analysis model unit. The present invention enhances predictive performance by meticulously preprocessing the captured images to effectively eliminate various interferences and noise. The image analysis method not only improves image quality but also facilitates the optimization of subsequent data analysis and applications, thereby achieving more accurate and reliable predictions of the object’s state.

Description

雙波段影像感測裝置、其影像分析方法與應用Dual-band image sensing device, its image analysis methods and applications

一種影像感測裝置,特別是一種使用雙波段進行感測與分析的影像感測裝置。An image sensing device, particularly an image sensing device that uses dual-band sensing and analysis.

隨著國人所得提高及飲食習慣西化,加上近年來國際知名品牌咖啡館引進市場,櫛比鱗次的土洋咖啡館已成為常見的街景之一。咖啡產業的專業度也持續提高,國人對於咖啡豆的選豆、烘豆與沖泡技術已可比擬美國、歐洲等咖啡發源地,足以可證實我國的咖啡產業盛行現象。With rising incomes and Westernized eating habits, coupled with the introduction of internationally renowned coffee brands into the market in recent years, numerous coffee shops, both domestic and international, have become a common sight on the streets. The professionalism of the coffee industry has also continued to improve. The skills of Taiwanese people in selecting, roasting, and brewing coffee beans are now comparable to those in coffee-producing regions such as the United States and Europe, which is sufficient proof of the flourishing coffee industry in Taiwan.

目前烘豆的過程中,主要依賴咖啡師肉眼判斷咖啡豆的焙度,然而這種方法存在眾多不確定因素,如咖啡師的經驗水平和當時環境的光源影響,也往往導致每批次的烘豆狀況不同而影響口味,無法穩定保持咖啡豆的品質。Currently, the roasting process mainly relies on baristas to judge the roast level of coffee beans by sight. However, this method has many uncertainties, such as the barista's experience level and the influence of ambient light. This often leads to different roasting conditions for each batch of beans, affecting the taste and making it impossible to maintain the quality of coffee beans consistently.

為了解決目前烘豆過程中高度人為經驗介入以及環境光源因素而產生品質不穩定的問題,有必要提供一種更準確且客觀的檢測方法,以提高咖啡品質和生產效率。To address the issue of inconsistent coffee quality caused by the high degree of human intervention and environmental lighting factors in the current coffee roasting process, it is necessary to provide a more accurate and objective testing method to improve coffee quality and production efficiency.

本發明首先提供一種雙波段影像的分析方法,其步驟包含: 取該待測物的紅外光影像及/或可見光影像並傳輸至一影像分析與機器學習模組; 該影像分析與機器學習模組中的一影像前處理單元將紅外光影像及/或可見光影像進行前處理,其步驟包含: 步驟S1-1 影像裁剪、步驟S1-2 紅外光影像閾值挑選與設定以及步驟S1-3 可見光影像像素點取樣; 接著,該影像分析與機器學習模組中的一影像分析模型單元將前處理完成的影像進行分析,其步驟包含: 步驟S2-1 訓練資料集建立、步驟S2-2 訓練資料集輸入迴歸訓練模型比對得到該待測物的均勻度分佈。 This invention first provides a method for analyzing dual-band images, the steps of which include: Acquiring an infrared image and/or a visible light image of the object under test and transmitting it to an image analysis and machine learning module; An image preprocessing unit in the image analysis and machine learning module preprocesses the infrared image and/or the visible light image, the steps of which include: Step S1-1 Image cropping, Step S1-2 Infrared image threshold selection and setting, and Step S1-3 Visible light image pixel sampling; Then, an image analysis model unit in the image analysis and machine learning module analyzes the preprocessed image, the steps of which include: Step S2-1 Training dataset establishment, Step S2-2... The uniformity distribution of the test object is obtained by comparing the input training dataset with the regression training model.

其中,步驟1-2對紅外光影像及/或可見光影像中陰影或過曝區域,以其紅外光影像設定有效分析影像區域閾值範圍進行過濾;該閾值範圍係取得該待測物的紅外光影像在不同區間中像素點資訊的最大與最小值作為近紅外光強度的閾值範圍,並定義最終的有效區域閾值範圍。In step 1-2, shadow or overexposed areas in infrared and/or visible light images are filtered using an effective analysis image region threshold range set by the infrared image. This threshold range is determined by obtaining the maximum and minimum values of pixel information in different regions of the infrared image of the test object as the threshold range of near-infrared light intensity, and defining the final effective region threshold range.

其中,步驟1-3係取該閾值範圍內的像素座標值,並將這些座標值比對到可見光影像。Steps 1-3 involve taking the pixel coordinates within the threshold range and comparing these coordinates with the visible light image.

其中,步驟S2-1是分別將該待測物的紅外光影像及/或可見光影像提取篩選後的紅外光(IR)或近紅外公(NIR)以及R(紅色)、G(綠色)、B(藍色)的RGB通道的資訊,與該待測物的一標準值(Standard Value)整合後得到以下式(1)、式(2)、式(3)與式(4)計算出的數種資料集: RGB_input = [R G B]n×3…式(1); (N)IR_input = [(N)IR]n×1…式(2); RGB (N)IR_input = [R G B (N)IR]n×4…式(3); RGB (N)IR SV_input = [R G B (N)IR Standard Value]n×5…式(4);其中上述式(1)至式(4)中n為取得的該待測物的影像數量。 Step S2-1 involves extracting and filtering infrared (IR) or near-infrared (NIR) light and RGB channel information (R (red), G (green), B (blue)) from the infrared and/or visible light images of the test object, respectively. This information is then integrated with a standard value of the test object to obtain several datasets calculated using the following equations (1), (2), (3), and (4): RGB_input = [R G B]n×3…Equation (1); (N)IR_input = [(N)IR]n×1…Equation (2); RGB (N)IR_input = [R G B (N)IR]n×4…Equation (3); RGB (N)IR SV_input = [R G B (N)IR Standard Value]n×5…Equation (4); where n in equations (1) to (4) above represents the number of images of the object under test obtained.

其中,步驟S2-2迴歸訓練模型比對係將步驟2-1的數種資料集輸入至少一種迴歸模型進行數種資料集的模型比對。In step S2-2, the regression training model comparison involves inputting the various datasets from step 2-1 into at least one regression model to perform model comparisons across the various datasets.

較佳地,該迴歸模型包含多元線性迴歸模型、多項式迴歸模型和偏最小平方法迴歸模型的一種或多種組合。Preferably, the regression model includes one or more combinations of multiple linear regression models, polynomial regression models, and partial least squares regression models.

其中,進一步地,步驟S2-3可選地將該待測物的均勻度分佈進行平均數、眾數及/或中位數的計算。Furthermore, step S2-3 may optionally calculate the mean, mode, and/or median of the uniformity distribution of the test object.

本發明也提供一種雙波段影像感測裝置,用以執行前述雙波段影像的分析方法,其包含: 一容置單元,用以盛裝一待測物; 一光源暨影像擷取模組,設置於該容置單元上方且可視該待測物的範圍;其至少包含一紅外光源單元、一可見光源單元及一影像擷取單元;該紅外光源單元與該可見光源單元向該待測物發射紅外光及/或可見光,並由該影像擷取單元擷取紅外光影像及/或可見光影像;以及 一影像分析與機器學習模組,其與該影像擷取單元訊號連接,並包含電性與訊號連接的一影像前處理單元以及一影像分析模型單元。 This invention also provides a dual-band image sensing device for performing the aforementioned dual-band image analysis method, comprising: a housing unit for holding a test object; a light source and image acquisition module disposed above the housing unit and having a view of the test object; comprising at least an infrared light source unit, a visible light source unit, and an image acquisition unit; the infrared light source unit and the visible light source unit emitting infrared light and/or visible light to the test object, and the image acquisition unit acquiring infrared light images and/or visible light images; and an image analysis and machine learning module, signal-connected to the image acquisition unit, and comprising an image preprocessing unit and an image analysis model unit electrically and signal-connected.

其中,在某些較佳實施例中該容置單元與該光源暨影像擷取模組間設有一光罩單元。In some preferred embodiments, a photomask unit is provided between the accommodating unit and the light source and image capturing module.

其中,數個該可見光源單元以環狀設置為一可見光燈環;以及該紅外光源單元至少一個設置於該可見光源單元側鄰近位置。本發明進一步地提供一種咖啡烘焙裝置,其包含前述雙波段影像感測裝置。The visible light source units are arranged in a ring to form a visible light ring; and at least one infrared light source unit is disposed adjacent to the visible light source units. The present invention further provides a coffee roasting apparatus comprising the aforementioned dual-band image sensing device.

藉由上述說明可知,本發明具有以下有益功效與優點:As can be seen from the above description, the present invention has the following beneficial effects and advantages:

1. 本發明結合光學感測器、演算法和光學系統設計,開發一套高效且可靠的咖啡豆或咖啡粉焙度檢測系統,可以排除目前咖啡烘豆時,人為經驗和環境光源等不確定因素,並確實提高咖啡焙度檢測的精確性。本發明透過感測器即時讀取咖啡豆/咖啡粉的反射波段,利用演算法進行數據分析和預測,結合優化的光學系統設計,實現對咖啡豆焙度的準確量測。同時,本發明所提供的方法可取得該待測物的狀態值均勻度分佈,詳細的針對各樣品的各咖啡豆間的進行焙度預測,相較於既有的咖啡豆焙度值檢測裝置,本發明可以改善其僅針對各樣品的單一區域感測所造成的焙度偏差,藉此本發明可以促進咖啡品質的提升,同時也有助於咖啡生產過程的自動化和智能化,推動咖啡產業邁向更加科技化的未來1. This invention combines optical sensors, algorithms, and optical system design to develop a highly efficient and reliable coffee bean or coffee powder roasting degree detection system. It eliminates uncertainties such as human experience and ambient light sources during current coffee roasting processes, effectively improving the accuracy of coffee roasting degree detection. This invention uses a sensor to read the reflection wavelength of coffee beans/coffee powder in real time, utilizes algorithms for data analysis and prediction, and combines this with an optimized optical system design to achieve accurate measurement of coffee bean roasting degree. Meanwhile, the method provided by this invention can obtain the uniformity distribution of the state value of the test object, and make detailed predictions of the roast level of each coffee bean in each sample. Compared with existing coffee bean roast level detection devices, this invention can improve the roast level deviation caused by sensing only a single area of each sample. Therefore, this invention can promote the improvement of coffee quality, and also contribute to the automation and intelligentization of the coffee production process, driving the coffee industry towards a more technological future.

2. 本發明透過對影像感測器捕捉到的影像進行細致的前處理,能夠在影像中有效地消除各種干擾和雜訊,進而顯著提高預測性能,使其達到更為卓越的水準。影像處理的過程不僅能夠改善影像的品質,還有助於優化後續的資料分析和應用,從而實現更準確、可靠的結果。2. This invention, through detailed preprocessing of images captured by an image sensor, effectively eliminates various interferences and noise in the images, thereby significantly improving prediction performance and achieving a superior level. The image processing not only improves image quality but also helps optimize subsequent data analysis and applications, thus achieving more accurate and reliable results.

本發明以下將以數個較佳實施例進行技術詳細的說明與描述,所附圖示僅僅是本發明的一些示例性代表或實施例,對於本發明所屬領域具有通常知識者來講,在不付出進步性勞動的前提下,還可以根據這些附圖將本發明應用於其它類似情形。The present invention will be described and illustrated in detail below with reference to several preferred embodiments. The accompanying drawings are merely some exemplary representations or embodiments of the present invention. Those skilled in the art to which the present invention pertains can apply the present invention to other similar situations without making any further efforts.

以下本發明使用的“系統”、“裝置”、“單元”和/或“模組”是用於區分不同級別的不同組件、元件、部件、部分或裝配的一種方法。然而,如果其他詞語可實現相同的目的,則可通過其他表達來替換所述詞語。如本發明中所示,除非上下文明確提示例外情形,“一”、“一個”、“一種”和/或“該”等詞並非特指單數,也可包括複數。一般說來,術語“包括”與“包含”僅提示包括已明確標識的步驟和元素,而這些步驟和元素不構成一個排它性的羅列,方法或者設備也可能包含其它的步驟或元素。The terms “system,” “device,” “unit,” and/or “module” used in this invention are one method of distinguishing different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions. As shown in this invention, unless the context clearly indicates otherwise, words such as “a,” “an,” “an,” and/or “the” do not specifically refer to the singular and may also include the plural. Generally, the terms “comprising” and “including” only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

本發明中使用了流程圖用來說明根據本發明的實施例的系統所執行的操作。應當理解的是,前面或後面操作不一定按照順序來精確地執行。相反,可以按照倒序或同時處理各個步驟。同時,也可以將其他操作添加到這些過程中,或從這些過程移除某一步或數步操作。Flowcharts are used in this invention to illustrate the operations performed by the system according to embodiments of the invention. It should be understood that the preceding or subsequent operations are not necessarily performed precisely in sequence. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

雙波段影像感測裝置< Dual-band image sensing device >

請參考圖1,其為本發明一種雙波段影像感測裝置100的較佳實施例示意圖。為了能清楚解釋與說明本發明雙波段影像感測裝置100,此實施例是以咖啡豆焙度檢測裝置為例,唯本發明所提供的雙波段影像感測裝置100除了檢測咖啡豆外,亦可檢測其他具有相同或近似影像特徵的豆狀、粒狀或粉狀食品,與此不限定。Please refer to Figure 1, which is a schematic diagram of a preferred embodiment of the dual-band image sensing device 100 of the present invention. In order to clearly explain and illustrate the dual-band image sensing device 100 of the present invention, this embodiment uses a coffee bean roasting degree detection device as an example. However, the dual-band image sensing device 100 provided by the present invention can detect other bean-shaped, granular or powdered food products with the same or similar image characteristics in addition to coffee beans, and is not limited thereto.

本發明該雙波段影像感測裝置100的較佳實施例至少包含: 一容置單元10,用以盛裝一待測物O; 一光源暨影像擷取模組20,設置於該容置單元10上方且可視該待測物O的範圍;其至少包含一紅外光源單元21、一可見光源單元22以及一影像擷取單元23;該紅外光源單元21與該可見光源單元22向該待測物O發射紅外光及/或可見光,並由該影像擷取單元23擷取紅外光影像及/或可見光影像;以及 一影像分析與機器學習模組40,其與該影像擷取單元23訊號連接,並包含電性與訊號連接的一影像前處理單元41以及一影像分析模型單元42。 A preferred embodiment of the dual-band image sensing device 100 of the present invention includes at least: a housing unit 10 for holding a test object O; a light source and image capture module 20, disposed above the housing unit 10 and having a view of the test object O; comprising at least an infrared light source unit 21, a visible light source unit 22, and an image capture unit 23; the infrared light source unit 21 and the visible light source unit 22 emitting infrared light and/or visible light to the test object O, and the image capture unit 23 capturing infrared light images and/or visible light images; and an image analysis and machine learning module 40, signal-connected to the image capture unit 23, and including an image preprocessing unit 41 and an image analysis model unit 42 electrically and signal-connected.

較佳地,一些優選的情況下,該容置單元10與該光源暨影像擷取模組20之間設有一光罩單元30,以更好的使該光源暨影像擷取模組20捕捉該容置單元10上的該待測物O狀態的紅外光影像及/或可見光影像。Preferably, in some preferred cases, a photomask unit 30 is provided between the accommodating unit 10 and the light source and image capture module 20, so as to better enable the light source and image capture module 20 to capture the infrared light image and/or visible light image of the test object O state on the accommodating unit 10.

該紅外光源單元21較佳可以是紅外光發光二極體(LEDs);該可見光源單元22較佳包含可見光發光二極體(LEDs);該影像擷取單元23可擷取至少可見光波段及/或紅外光波段的影像,且較佳地,在光線亮度不足的時候(即暗環境缺乏可見光波段的情況下),該影像擷取單元23可僅擷取紅外光波段的影像。更佳地,本發明另一較佳實施例中,該紅外光源單元21可發出紅外光或近紅外光,例如波長850nm的近紅外光,本發明於此不限定。The infrared light source unit 21 is preferably an infrared light-emitting diode (LED); the visible light source unit 22 preferably includes visible light-emitting diodes (LEDs); the image capture unit 23 can capture images of at least the visible light band and/or the infrared light band, and preferably, when the light brightness is insufficient (i.e., in a dark environment where the visible light band is lacking), the image capture unit 23 can capture images of only the infrared light band. More preferably, in another preferred embodiment of the present invention, the infrared light source unit 21 can emit infrared light or near-infrared light, such as near-infrared light with a wavelength of 850nm, which is not limited herein.

其中,該可見光源單元22除了至少一個設置於該容置單元10上方外,也可以如圖1較佳實施例所示,數個該可見光源單元22以環狀設置為一可見光燈環,該紅外光源單元21則至少一個設置於該可見光源單元22側鄰近位置。In addition to at least one visible light source unit 22 being disposed above the receiving unit 10, as shown in the preferred embodiment of Figure 1, several visible light source units 22 may be arranged in a ring to form a visible light ring, and at least one infrared light source unit 21 may be disposed on the side or adjacent to the visible light source unit 22.

雙波段影像感測裝置影像分析方法< Image Analysis Method for Dual-Band Image Sensing Devices >

請參考圖2,該影像分析與機器學習模組40的該影像前處理單元41將該影像擷取單元23所擷取的該待測物O的紅外光影像及/或可見光影像進行前處理,其步驟包含: 步驟S1-1: 影像裁剪; 步驟S1-2: 紅外光影像閾值挑選與設定;以及 步驟S1-3: 可見光影像像素點取樣。 Referring to Figure 2, the image preprocessing unit 41 of the image analysis and machine learning module 40 performs preprocessing on the infrared and/or visible light images of the object under test O captured by the image capture unit 23. The steps include: Step S1-1: Image cropping; Step S1-2: Infrared image threshold selection and setting; and Step S1-3: Visible light image pixel sampling.

其中,步驟1-1影像裁剪中,主要是將所拍攝的紅外光影像及/或可見光影像移除非該待測物O影像的無效影像區,僅保留可分析的該待測物O影像。In step 1-1, image cropping mainly involves removing invalid image areas from the captured infrared and/or visible light images that are not images of the object under test (O), retaining only the analyzable image of the object under test (O).

步驟1-2的紅外光影像閾值挑選與設定中,為了避免該待測物O影像因為顆粒與顆粒之間或粉體與粉體之間交疊遮擋所產生的陰影區域,以及未交疊區域可能過曝的色彩資訊失準的問題而影響分析結果,進一步地,針對這些陰影或過曝區域,以其紅外光影像設定有效分析影像區域閾值進行過濾。In the infrared image threshold selection and setting of steps 1-2, in order to avoid the analysis results being affected by the shadow areas caused by the overlapping and occlusion between particles or powders in the image of the test object O, as well as the inaccurate color information due to overexposure in the non-overlapping areas, further, the infrared image setting is used to effectively analyze the image area threshold for filtering these shadow or overexposed areas.

由於紅外光,例如近紅外光影像中,像素點的資訊可以做為閾值挑選的參考。近紅外光影像的像素點中僅存取拍攝時紅外光的強度值,強度值範圍為0~255,可用於過濾掉過曝或陰影區域的像素點。實施時主要是取得該待測物O的紅外光影像在不同區間中像素點資訊的最大與最小值作為近紅外光強度的閾值範圍,並定義最終的有效區域閾值範圍。Because of infrared light, such as near-infrared light images, pixel information can be used as a reference for threshold selection. Near-infrared images only store the intensity value of the infrared light at the time of capture, with an intensity range of 0-255, which can be used to filter out overexposed or shadowed pixels. In practice, the main approach is to obtain the maximum and minimum values of pixel information in different regions of the infrared image of the object under test O as the threshold range for near-infrared light intensity, and to define the final effective threshold range.

步驟S1-3可見光影像像素點取樣及資料集建立的步驟中,定義了有效區域閾值後,提取該閾值範圍內的像素座標值,並將這些座標值應用比對到可見光影像中。In step S1-3, which involves sampling pixels in the visible light image and establishing a dataset, after defining the effective area threshold, the pixel coordinates within the threshold range are extracted, and these coordinates are applied to the visible light image.

接著,請參考圖1與圖3,該影像分析模型單元42係包含於桌上或可攜式的電腦、筆電、平板或手機等裝置並執行以下之分析與運算。Next, please refer to Figures 1 and 3. The image analysis model unit 42 is included on a desktop or portable device such as a computer, laptop, tablet or mobile phone and performs the following analysis and calculation.

經過該影像前處理單元41前處理的影像由該影像分析模型單元42進行分析,其步驟包含:The image preprocessed by the image preprocessing unit 41 is analyzed by the image analysis model unit 42, and the steps include:

步驟S2-1: 訓練資料集建立;Step S2-1: Establish training dataset;

步驟S2-2: 訓練資料集輸入迴歸訓練模型比對,以獲取該待測物O的均勻度分佈;Step S2-2: Input training dataset and compare with regression training model to obtain the uniformity distribution of the test object O;

其中,上述步驟S2-1訓練資料集建立主要是分別將該待測物O的紅外光影像及/或可見光影像提取篩選後的紅外光(IR)或近紅外公(NIR)以及R(紅色)、G(綠色)、B(藍色)的RGB通道的資訊,與該待測物O的一標準值(Standard Value)整合後得到以下式(1)、式(2)、式(3)與式(4)計算出的數種資料集,以進行後續訓練模型建立與評估分析。The training dataset establishment step S2-1 mainly involves extracting and filtering infrared (IR) or near-infrared (NIR) and RGB channel information of R (red), G (green), and B (blue) from the infrared and/or visible light images of the test object O, and integrating it with a standard value of the test object O to obtain several datasets calculated by the following formulas (1), (2), (3) and (4) for subsequent training model establishment and evaluation analysis.

RGB_input = [R G B]n×3…式(1);RGB_input = [R G B]n×3…Formula (1);

(N)IR_input = [(N)IR]n×1…式(2);(N)IR_input = [(N)IR]n×1…Equation (2);

RGB (N)IR_input = [R G B (N)IR]n×4…式(3);RGB (N)IR_input = [R G B (N)IR]n×4...Equation (3);

RGB (N)IR SV_input = [R G B (N)IR Standard Value]n×5…式(4);其中上述式(1)至式(4)中n為取得的該待測物O的影像數量。RGB (N)IR SV_input = [R G B (N)IR Standard Value]n×5…Equation (4); where n in the above equations (1) to (4) is the number of images of the object under test O obtained.

其中,步驟S2-2迴歸訓練模型比對,主要是將步驟2-1的數種資料集輸入至少一種迴歸模型進行數種資料集的模型比對。該迴歸模型包含但不限於多元線性迴歸模型(Multiple Linear Regression, MLR)、多項式迴歸模型(Polynomial Regression, PR)和偏最小平方法迴歸模型(Partial Least Square, PLS)的一種或多種組合。Step S2-2, regression training model comparison, mainly involves inputting several datasets from step 2-1 into at least one regression model for model comparison across these datasets. This regression model includes, but is not limited to, one or more combinations of multiple linear regression (MLR), polynomial regression (PR), and partial least squares (PLS) regression models.

進一步地,步驟S2-3可選地將所得出的均勻度分佈進行平均數、眾數及/或中位數的計算,以驗證各該待測物O狀態值精準度。Furthermore, step S2-3 may optionally calculate the mean, mode, and/or median of the obtained uniformity distribution to verify the accuracy of the O state value of each analyte.

實施例一< Implementation Example 1 >

本發明一較佳實施例係該待測物O為咖啡豆,此實施例以16種不同烘焙程度的咖啡豆進行其焙度狀態分析。In a preferred embodiment of the present invention, the test substance O is coffee beans, and the roasting status of coffee beans with 16 different roasting levels is analyzed.

首先以前述該雙波段影像感測裝置100取得此16種不同烘焙程度的咖啡豆的紅外光影像及/或可見光影像。接著,該些紅外光影像及/或可見光影像傳輸至該影像分析與機器學習模組40進行分析。First, infrared and/or visible light images of the 16 different roasting levels of coffee beans are acquired using the aforementioned dual-band image sensing device 100. Then, these infrared and/or visible light images are transmitted to the image analysis and machine learning module 40 for analysis.

請參考圖4A、4B與以下表1,在該影像前處理單元41將該些紅外光影像及/或可見光影像進行裁剪出有效影像區域後,接著進行紅外光影像閾值挑選與設定步驟取得數個不同咖啡豆較佳實施例的紅外光影像像素點強度值有效區域閾值範圍。此實施例的16種不同烘焙程度的咖啡豆紅外光影像像素點強度值之最小與最大值為35-245,並以此設定為有效區域閾值範圍。Please refer to Figures 4A and 4B and Table 1 below. After the image preprocessing unit 41 crops the infrared and/or visible light images to obtain the effective image area, it then performs infrared image threshold selection and setting steps to obtain the effective area threshold range of infrared image pixel intensity values for several preferred embodiments of different coffee beans. In this embodiment, the minimum and maximum values of the infrared image pixel intensity values for 16 different roasting levels of coffee beans are 35-245, and these values are set as the effective area threshold range.

表1。 樣品名 紅外光影像像素點強度值範圍 Elf 90-200 Flw 140-225 Gsha 120-220 Sld 140-215 Yag 130-210 Purcase01_Brz 135-220 Purcase01_EthopiaWater 160-235 Purcase01_Gua 150-245 (最大值) Purcase02_ColumbiaGsha 135-235 Purcase02_Costalightmedium 115-225 Purcase02_Costamedium 145-215 Purcase02_EthopiaSun 135-240 Self01_light 90-245 Self01_lightmedium 100-230 Self01_roast 70-160 Self01_roastmedium (最小值)35-130 Table 1. Sample Name Infrared image pixel intensity range Elf 90-200 Flw 140-225 Gsha 120-220 Sld 140-215 Yag 130-210 Purcase01_Brz 135-220 Purcase01_EthopiaWater 160-235 Purcase01_Gua 150-245 (maximum value) Purcase02_ColumbiaGsha 135-235 Purcase02_Costalightmedium 115-225 Purcase02_Costamedium 145-215 Purcase02_EthopiaSun 135-240 Self01_light 90-245 Self01_lightmedium 100-230 Self01_roast 70-160 Self01_roastmedium (Minimum value) 35-130

接著,經過該影像前處理單元41前處理的影像由該影像分析模型單元42進行分析。請參考圖5A此實施例的原可見光影像、圖5B近紅外光強度篩選影像與圖5C可見光影像座標篩選影像。透過這些影像取得的RGB三通道資訊與NIR資訊數值,與咖啡豆標準焙度值(Standard RD)之標準資料集整合。此實施例共取得了如上表1所示的16種咖啡豆,每種咖啡豆100張,總共1600張影像的資料,以上述式(1)~式(4)進行整合為以下式(5)~式(8),便可得到此實施例一6種咖啡豆所彙集完整的該資料集。Next, the image preprocessed by the image preprocessing unit 41 is analyzed by the image analysis model unit 42. Please refer to Figure 5A for the original visible light image of this embodiment, Figure 5B for the near-infrared light intensity filtered image, and Figure 5C for the visible light image coordinate filtered image. The RGB three-channel information and NIR information values obtained through these images are integrated with the standard data set of coffee bean standard roast value (Standard RD). This embodiment obtained data of 16 types of coffee beans as shown in Table 1 above, 100 images of each type of coffee bean, for a total of 1600 images. The data is integrated using the above equations (1) to (4) into the following equations (5) to (8), thus obtaining the complete data set of the 6 types of coffee beans in this embodiment.

…式(5); …Equation (5);

…式(6); …Equation (6);

…式(7); …Equation (7);

…式(8)。 …Formula (8).

前述建立不同輸入資料集的模型之後,此實施例將16張不同焙度的咖啡豆驗證影像,用來評估模型的預測精確度。這16張影像在經過像素點篩選後,會將所有像素點的R、G、B和NIR四個通道的值依次輸入前述步驟S2-2的至少一種迴歸模型中以推測各咖啡豆樣品的焙度均勻度分佈。最後為驗證準確性,可選地將該均勻度分佈作平均數、中位數及/或眾數,並與標準焙度值比對來驗證該咖啡豆焙度推測值。After establishing models with different input datasets, this embodiment uses 16 verification images of coffee beans at different roast levels to evaluate the model's prediction accuracy. After pixel filtering, the values of the R, G, B, and NIR channels of all pixels are sequentially input into at least one regression model in step S2-2 to infer the roast uniformity distribution of each coffee bean sample. Finally, to verify accuracy, the uniformity distribution can optionally be calculated as the mean, median, and/or mode, and compared with the standard roast value to verify the coffee bean roast prediction.

請參考圖6A~圖6P以及下表2,此實施例分別以多元線性迴歸模型、多項式迴歸模型和偏最小平方法迴歸模型搭配 RGB+NIR 四通道輸入資料集並以平均數驗證作為視覺化咖啡豆焙度均勻度分佈,計算出 16種不同咖啡豆烘焙度推測值。同時比較了以目前商業市售的紅外線咖啡豆烘焙度測試機所檢測的標準焙度值,證實本發明所提供的裝置與方法確實能夠推測出準確的該待測物O的狀態值。唯此實施例以平均數進行驗證,但中位數與眾數也驗證有效。Please refer to Figures 6A-6P and Table 2 below. This embodiment uses a multivariate linear regression model, a polynomial regression model, and a partial least squares regression model, combined with an RGB+NIR four-channel input dataset, and verifies the visual distribution of coffee bean roast uniformity using the mean, calculating 16 different estimated values for coffee bean roast. It also compares the results with the standard roast value detected by currently commercially available infrared coffee bean roast testing machines, confirming that the device and method provided by this invention can indeed accurately predict the state value of the test object O. While this embodiment uses the mean for verification, the median and mode are also verified as valid.

表2。 編號 標準焙度值 本發明推測值 咖啡豆影像與焙度均勻度分布圖 1 50.7 55.2 如圖6A所示 2 50.0 57.2 如圖6B所示 3 57.6 59.9 如圖6C所示 4 54.7 56.5 如圖6D所示 5 52.1 54.4 如圖6E所示 6 56.2 54.0 如圖6F所示 7 55.4 59.4 如圖6G所示 8 57.8 60.4 如圖6H所示 9 62.9 59.6 如圖6I所示 10 55.3 57.6 如圖6J所示 11 52.6 53.2 如圖6K所示 12 64.8 61.1 如圖6L所示 13 67.2 59.5 如圖6M所示 14 55.6 50.2 如圖6N所示 15 39.5 36.8 如圖6O所示 16 24.5 28.2 如圖6P所示 Table 2. Number Standard roast value The invention's predicted value Image of coffee beans and distribution of roast uniformity 1 50.7 55.2 As shown in Figure 6A 2 50.0 57.2 As shown in Figure 6B 3 57.6 59.9 As shown in Figure 6C 4 54.7 56.5 As shown in Figure 6D 5 52.1 54.4 As shown in Figure 6E 6 56.2 54.0 As shown in Figure 6F 7 55.4 59.4 As shown in Figure 6G 8 57.8 60.4 As shown in Figure 6H 9 62.9 59.6 As shown in Figure 6I 10 55.3 57.6 As shown in Figure 6J 11 52.6 53.2 As shown in Figure 6K 12 64.8 61.1 As shown in Figure 6L 13 67.2 59.5 As shown in Figure 6M 14 55.6 50.2 As shown in Figure 6N 15 39.5 36.8 As shown in Figure 60 16 24.5 28.2 As shown in Figure 6P

本發明中使用了流程圖用來說明根據本發明的實施例的系統所執行的操作。應當理解的是,前面或後面操作不一定按照順序來精確地執行。相反,可以按照倒序或同時處理各個步驟。同時,也可以將其他操作添加到這些過程中,或從這些過程移除某一步或數步操作。Flowcharts are used in this invention to illustrate the operations performed by the system according to embodiments of the invention. It should be understood that the preceding or subsequent operations are not necessarily performed precisely in sequence. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

一些實施例中使用了描述成分、屬性數量的數字,應當理解的是,此類用於實施例描述的數字,在一些示例中使用了修飾詞“大約”、“近似”或“大體上”來修飾。除非另外說明,“大約”、“近似”或“大體上”表明所述數字允許有±20%的變化。相應地,在一些實施例中,說明書和請求項中使用的數值參數均為 近似值,該近似值根據個別實施例所需特點可以發生改變。在一些實施例中,數值參數應考慮規定的有效數位並採用一般位數保留的方法。儘管本發明一些實施例中用於確認其範圍廣度的數值域和參數為 近似值,在具體實施例中,此類數值的設定在可行範圍內盡可能精確。In some embodiments, numbers describing the quantity of components and attributes are used. It should be understood that such numbers used in the embodiments are modified in some examples with the modifiers "approximately," "approximately," or "substantially." Unless otherwise stated, "approximately," "approximately," or "substantially" indicates that the number is allowed to vary by ±20%. Correspondingly, in some embodiments, the numerical parameters used in the specifications and requests are approximate values, which may vary depending on the specific characteristics required by the individual embodiments. In some embodiments, numerical parameters should take into account the specified significant digits and adopt a general method of digit reservation. Although the numerical ranges and parameters used to confirm their scope in some embodiments of the invention are approximate values, in specific embodiments, the settings of such numerical values are as accurate as feasible.

最後,應當理解的是,本發明中所述實施例僅用以說明本發明實施例的原則。其他的變形也可能屬本發明的範圍。因此,作為示例而非限制,本發明實施例的替代配置可視為與本發明的教導一致。相應地,本發明的實施例不僅限於本發明明確介紹和描述的實施例。Finally, it should be understood that the embodiments described herein are merely illustrative of the principles of the embodiments of the present invention. Other variations may also fall within the scope of the present invention. Therefore, alternative configurations of the embodiments of the present invention, as examples and not limitations, may be considered consistent with the teachings of the present invention. Accordingly, the embodiments of the present invention are not limited to those expressly described and illustrated herein.

100:雙波段影像感測裝置 10:容置單元 20:光源暨影像擷取模組 21:紅外光源單元 22:可見光源單元 23:影像擷取單元 30:光罩單元 40:影像分析與機器學習模組 41:影像前處理單元 42:影像分析模型單元 O:待測物 S1-1~S1-3、S2-1~S2-3:步驟 100: Dual-band image sensing device 10: Reception unit 20: Light source and image acquisition module 21: Infrared light source unit 22: Visible light source unit 23: Image acquisition unit 30: Photomask unit 40: Image analysis and machine learning module 41: Image preprocessing unit 42: Image analysis model unit O: Object under test S1-1~S1-3, S2-1~S2-3: Steps

為了更清楚地說明本發明實施例的技術方案,下面將對實施例描述中所需要使用的附圖作簡單的介紹。顯而易見地,下面描述中的附圖僅僅是本發明的一些示例或實施例,並非絕對用以限定本發明的技術範圍。除非從前後文顯而易見或另做說明,圖中相同標號代表相同結構或操作。其中: 圖1為本發明雙波段影像感測裝置的較佳實施例示意圖。 圖2為本發明影像分析與機器學習模組中影像前處理單元進行前處理步驟流程圖。 圖3為本發明影像分析模型單元進行影像分析的步驟流程示意圖。 圖4A及圖4B為本發明實施例一中數個咖啡豆樣品的影像有效區域值範圍。 圖5A、圖5B及圖5C分別為本發明實施例一中咖啡豆樣品的原可見光影像、近紅外光強度篩選影像、可見光影像座標篩選影像。 圖6A至圖6P分別為本發明實施例一中數個咖啡豆樣品的咖啡豆影像與焙度均勻度分布圖。 To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some examples or embodiments of the present invention and are not intended to absolutely limit the technical scope of the present invention. Unless it is obvious from the context or otherwise explained, the same reference numerals in the figures represent the same structure or operation. Among them: Figure 1 is a schematic diagram of a preferred embodiment of the dual-band image sensing device of the present invention. Figure 2 is a flowchart of the preprocessing steps performed by the image preprocessing unit in the image analysis and machine learning module of the present invention. Figure 3 is a schematic flowchart of the image analysis steps performed by the image analysis model unit of the present invention. Figures 4A and 4B show the effective area value range of several coffee bean samples in Embodiment 1 of the present invention. Figures 5A, 5B, and 5C are the original visible light image, near-infrared light intensity filtered image, and visible light image coordinate filtered image of the coffee bean sample in Embodiment 1 of the present invention, respectively. Figures 6A to 6P are the coffee bean images and roast uniformity distribution diagrams of several coffee bean samples in Embodiment 1 of the present invention, respectively.

100:雙波段影像感測裝置 100: Dual-band image sensing device

10:容置單元 10: Containment Unit

20:光源暨影像擷取模組 20: Light Source and Image Capture Module

21:紅外光源單元 21: Infrared Light Source Unit

22:可見光源單元 22: Visible Light Source Unit

23:影像擷取單元 23: Image Capture Unit

30:光罩單元 30: Photomask Unit

40:影像分析與機器學習模組 40: Image Analysis and Machine Learning Module

41:影像前處理單元 41: Image Preprocessing Unit

42:影像分析模型單元 42: Image Analysis Model Unit

O:待測物 O: Analyzer Test Item

Claims (11)

一種雙波段影像分析方法,其步驟包含: 擷取一待測物的紅外光影像及可見光影像並傳輸至一影像分析與機器學習模組,其包含訊號連接的一影像前處理單元與一影像分析模型單元; 該影像分析與機器學習模組中的該影像前處理單元將該紅外光影像及可見光影像進行前處理,其步驟包含: 步驟S1-1:影像裁剪,將該紅外光影像及可見光影像移除非該待測物影像的無效影像區,僅保留可分析的該待測物影像; 步驟S1-2:紅外光影像閾值挑選與設定,以過濾該紅外光影像中的陰影或過曝區域;以及 步驟S1-3:可見光影像像素點取樣; 該影像分析模型單元將前處理完成的該影像進行分析,其步驟包含: 步驟S2-1:訓練資料集建立;以及 步驟S2-2:訓練資料集輸入迴歸訓練模型比對得到該待測物狀態的均勻度分佈。A dual-band image analysis method includes the following steps: capturing an infrared image and a visible light image of a test object and transmitting them to an image analysis and machine learning module, which includes an image preprocessing unit and an image analysis model unit connected by signals; the image preprocessing unit in the image analysis and machine learning module preprocesses the infrared image and the visible light image, including the following steps: Step S1-1: image cropping, removing invalid image areas from the infrared image and the visible light image that are not images of the test object, retaining only the analyzable image of the test object; Step S1-2: infrared image threshold selection and setting to filter out shadow or overexposed areas in the infrared image; and Step S1-3: visible light image pixel sampling; The image analysis model unit analyzes the pre-processed image, and the steps include: Step S2-1: Establishing the training dataset; and Step S2-2: Inputting the training dataset into the regression training model and comparing it to obtain the uniformity distribution of the state of the object under test. 如請求項1所述的雙波段影像分析方法,其中:步驟1-2對紅外光影像及可見光影像中陰影或過曝區域,以其紅外光影像設定有效分析影像區域閾值範圍進行過濾;該閾值範圍係取得該待測物的紅外光影像在不同區間中像素點資訊的最大與最小值作為近紅外光強度的閾值範圍,並定義最終的有效區域閾值範圍。The dual-band image analysis method as described in claim 1, wherein: step 1-2 filters the shadow or overexposed areas in the infrared and visible light images by setting an effective analysis image region threshold range using the infrared image; the threshold range is obtained by taking the maximum and minimum values of pixel information in different regions of the infrared image of the test object as the threshold range of near-infrared light intensity, and defining the final effective region threshold range. 如請求項1所述的雙波段影像分析方法,其中:步驟1-3係取該閾值範圍內的像素座標值,並將這些座標值比對到可見光影像。The dual-band image analysis method as described in claim 1, wherein: steps 1-3 involve taking pixel coordinate values within the threshold range and comparing these coordinate values with the visible light image. 如請求項1所述的雙波段影像分析方法,其中:步驟S2-1是分別將該待測物的紅外光影像及可見光影像提取篩選後的紅外光(IR)或近紅外公(NIR)以及R(紅色)、G(綠色)、B(藍色)的RGB通道的資訊,與該待測物的一標準值(Standard Value)整合後得到以下式(1)、式(2)、式(3)與式(4)計算出的數種資料集: RGB_input = [R G B]n×3…式(1); (N)IR_input = [(N)IR]n×1…式(2); RGB (N)IR_input = [R G B (N)IR]n×4…式(3); RGB (N)IRSV_input = [R G B (N)IR Standard Value]n×5…式(4);其中上述式(1)至式(4)中n為取得的該待測物的影像數量。As described in claim 1, the dual-band image analysis method includes the following steps: Step S2-1 involves extracting and filtering infrared (IR) or near-infrared (NIR) and RGB channel information (R (red), G (green), B (blue)) from the infrared and visible light images of the object under test, and integrating this information with a standard value of the object under test to obtain several datasets calculated by the following formulas (1), (2), (3), and (4): RGB_input = [R G B]n×3…Formula (1); (N)IR_input = [(N)IR]n×1…Formula (2); RGB (N)IR_input = [R G B (N)IR]n×4…Formula (3); RGB (N)IRSV_input = [R G B (N)IR Standard…Formula (3) Value]n×5…Equation (4); where n in the above equations (1) to (4) is the number of images of the object to be tested. 如請求項1所述的雙波段影像分析方法,其中:步驟S2-2迴歸訓練模型比對係將步驟2-1的數種資料集輸入至少一種迴歸模型進行數種資料集的模型比對;以及該迴歸模型包含多元線性迴歸模型、多項式迴歸模型和偏最小平方法迴歸模型的一種或多種組合。The dual-band image analysis method as described in claim 1, wherein: step S2-2, regression training model comparison, involves inputting several datasets from step 2-1 into at least one regression model for model comparison of the several datasets; and the regression model includes one or more combinations of multiple linear regression models, polynomial regression models, and partial least squares regression models. 如請求項1~5中任一項所述的雙波段影像分析方法,其中:進一步地將該待測物狀態的均勻度分佈進行平均數、眾數及/或中位數的計算。The dual-band image analysis method as described in any one of claims 1 to 5, wherein: the mean, mode and/or median of the uniformity distribution of the state of the object under test are further calculated. 一種雙波段影像感測裝置,用以執行如請求項1~6所述的雙波段影像分析方法,其包含: 一容置單元,用以盛裝一待測物; 一光源暨影像擷取模組,設置於該容置單元上方且可視該待測物的範圍;其至少包含一紅外光源單元、一可見光源單元及一影像擷取單元;該紅外光源單元與該可見光源單元向該待測物發射紅外光及/或可見光,並由該影像擷取單元擷取紅外光影像及/或可見光影像;以及 一影像分析與機器學習模組,其與該影像擷取單元訊號連接,並包含電性與訊號連接的一影像前處理單元以及一影像分析模型單元。A dual-band image sensing device for performing the dual-band image analysis method as described in claims 1-6, comprising: a receiving unit for holding a test object; a light source and image capture module disposed above the receiving unit and having a view of the test object; comprising at least an infrared light source unit, a visible light source unit, and an image capture unit; the infrared light source unit and the visible light source unit emitting infrared light and/or visible light to the test object, and the image capture unit capturing infrared light images and/or visible light images; and an image analysis and machine learning module signal-connected to the image capture unit, comprising an image preprocessing unit and an image analysis model unit electrically and signal-connected. 如請求項7所述的雙波段影像感測裝置,其中:該容置單元與該光源暨影像擷取模組間設有一光罩單元。The dual-band image sensing device as described in claim 7, wherein: a photomask unit is provided between the accommodating unit and the light source and image acquisition module. 如請求項7或8所述的雙波段影像感測裝置,其中:該紅外光源單元發出紅外光及/或近紅外光。The dual-band image sensing device as described in claim 7 or 8, wherein: the infrared light source unit emits infrared light and/or near-infrared light. 如請求項7或8所述的雙波段影像感測裝置,其中:數個該可見光源單元以環狀設置為一可見光燈環;以及該紅外光源單元至少一個設置於該可見光源單元側鄰近位置。The dual-band image sensing device as described in claim 7 or 8, wherein: a plurality of visible light source units are arranged in a ring to form a visible light ring; and at least one infrared light source unit is disposed adjacent to the visible light source unit. 一種咖啡焙度檢測裝置,其包含如請求項7-10任一項所述的雙波段影像感測裝置。A coffee roasting degree detection device comprising a dual-band image sensing device as described in any one of claims 7-10.
TW114100724A 2025-01-08 Dual-band image sensing device, image analysis method and applications thereof TWI908581B (en)

Publications (1)

Publication Number Publication Date
TWI908581B true TWI908581B (en) 2025-12-11

Family

ID=

Similar Documents

Publication Publication Date Title
US10890537B2 (en) Appearance inspection device, lighting device, and imaging lighting device
US20230368426A1 (en) Hyperspectral imaging spectrophotometer and system
EP3261333B1 (en) Thermal anomaly detection
KR101650679B1 (en) Method for scoring and controlling quality of food products in a dynamic production line
JP6574163B2 (en) Substrate inspection method
JP5043755B2 (en) Resin material inspection device and program
CN118758429B (en) An online detection system, method and medium for color difference in printing and dyeing
WO2019151393A1 (en) Food inspection system, food inspection program, food inspection method and food production method
US20180156735A1 (en) Colour measurement of gemstones
CN106679816B (en) A kind of mobile phone temp detection method and system
JPWO2016133175A1 (en) Fruit sorting system, fruit sorting device, and fruit sorting method
CN112930572A (en) Method and device for performing analytical measurements
CN114445330A (en) Method and system for detecting appearance defects of components
TW201939020A (en) Method and devices for performing an analytical measurement
CN109461156B (en) Vision-based thread sealing plug assembly inspection method
CN104428657B (en) Grain Appearance Measuring Device
TWI908581B (en) Dual-band image sensing device, image analysis method and applications thereof
CN101102664A (en) Device for determining consistency of batch of seeds
JP6715001B2 (en) Food inspection system and food inspection method
JPH0534281A (en) Appearance evaluation device for melon
SG193874A1 (en) Probe mark inspection
JP2006201130A (en) Nondestructive judgment method and apparatus for ginger damaged grains
CN110849808A (en) Colorimetric measurement analysis mobile platform equipment
CN109975299A (en) Luminescent source detection system and method
CN110807817B (en) Machine vision method for target color recognition adapting to illumination change