Spectroscopic analysis method, and spectroscopic analyzer
The spectroscopic analysis method and device address the issue of noise components in complex-shaped objects by distinguishing and excluding unsuitable pixels based on reflectance thresholds, ensuring accurate analysis.
Patent Information
- Application Number
- JP2024009975
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-01-26
- Publication Date
- 2025-08-07
AI Technical Summary
Spectroscopic analysis devices struggle with complex-shaped objects that contain areas not requiring analysis, leading to noise components and errors due to diffuse reflection, especially in pellet-shaped objects.
A spectroscopic analysis method and device that acquire spectral images, calculate reflectance, determine a threshold to differentiate between analysis-required and non-required pixels, and perform analysis only on suitable pixels.
The method effectively excludes unsuitable pixels, ensuring accurate spectroscopic analysis by setting optimal reflectance thresholds, reducing errors and noise components in analysis results.
Smart Images

Figure 2025115496000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a spectroscopic analysis method and a spectroscopic analysis device. [Background technology]
[0002] Conventionally, spectroscopic analyzers that perform spectroscopic analysis of an object to be measured are known. For example, a spectroscopic analyzer described in Patent Document 1 irradiates an object to be measured transported along a transport path with infrared light and receives the infrared light reflected by the object to be measured. Then, based on the received infrared light, it is determined whether the object to be measured is a recycled resin. This device prepares reference data for absorption spectra in advance for multiple recycled resins with different thickness conditions, and performs a determination process for the object using the reference data corresponding to the thickness of the object.As a result, even if the object is a transparent resin and infrared light reflected from the transport path is received, the type of resin can be determined while reducing the noise component caused by the infrared light reflected from the transport path. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Application Laid-Open No. 2014-98555 Summary of the Invention [Problem to be solved by the invention]
[0004] However, when the object to be measured has a complex shape, it may contain areas that do not require analysis. For example, when the object to be measured is pellet-shaped, the fragments of the pellets undergo diffuse reflection of light, making it impossible to perform proper spectroscopic analysis, resulting in areas that do not require analysis. The spectroscopic analysis device of Patent Document 1 considers the case where the object to be measured is transparent, but does not take into account such areas that do not require spectroscopic analysis. In this case, the spectroscopic analysis results of the areas that do not require spectroscopic analysis will become noise components in the analysis results of the object to be measured, causing errors. [Means for solving the problem]
[0005] A spectroscopic analysis method according to a first aspect of the present disclosure includes an image acquisition step of acquiring spectroscopic images of an object to be measured for a plurality of spectroscopic wavelengths; a spectrum calculation step of extracting a spectroscopic spectrum of each pixel from the spectroscopic images corresponding to the plurality of spectroscopic wavelengths and calculating a reflectance of each pixel; a threshold determination step of determining a reflectance threshold for distinguishing between pixels that do not need to be analyzed and pixels that are to be analyzed, based on the reflectance of each pixel; a pixel classification step of classifying the plurality of pixels into pixels that do not need to be analyzed and pixels that are to be analyzed, based on the reflectance threshold; and an analysis step of performing a spectroscopic analysis of the object to be measured based on the pixels that are to be analyzed.
[0006] A spectroscopic analysis device according to a second aspect of the present disclosure includes an image acquisition unit that acquires spectroscopic images of an object to be measured for a plurality of spectroscopic wavelengths; a spectrum calculation unit that extracts a spectroscopic spectrum of each pixel from the spectroscopic images corresponding to the plurality of spectroscopic wavelengths and calculates a reflectance of each pixel; a threshold determination unit that determines a reflectance threshold that distinguishes between pixels that do not need to be analyzed and pixels that are to be analyzed, based on the reflectance of each pixel; a pixel classification unit that classifies the plurality of pixels into the pixels that do not need to be analyzed and the pixels that are to be analyzed, based on the reflectance threshold; and an analysis unit that performs spectroscopic analysis of the object to be measured based on the pixels that are to be analyzed. [Brief explanation of the drawings]
[0007] [Figure 1] FIG. 1 is a block diagram showing a schematic configuration of a spectroscopic analysis device according to a first embodiment. [Figure 2] 1 is a flowchart showing a spectroscopic analysis method according to a first embodiment. [Figure 3] FIG. 4 is a diagram showing an example of a spectral image of an object to be measured at a predetermined spectral wavelength. [Figure 4] FIG. 4 is a diagram showing an example of the spectral reflectance spectrum of each pixel. [Figure 5] FIG. 10 is a diagram showing an example of the number of pixels (pixel ratio) having a reflectance equal to or greater than the provisional threshold value when the provisional threshold value is changed for each spectral wavelength. [Figure 6]This is a schematic diagram showing the number of pixels (pixel ratio) whose reflectance is equal to or greater than the provisional threshold value when the provisional threshold value is changed for one spectral wavelength. [Figure 7] 10A and 10B are diagrams showing examples of information relating to flat portions when a provisional threshold value of reflectance is swept. [Figure 8] FIG. 10 is a block diagram showing a schematic configuration of a spectroscopic analysis device according to a second embodiment. [Figure 9] 10 is a flowchart showing a spectroscopic analysis method according to a second embodiment. [Figure 10] FIG. 10 is an explanatory diagram for explaining setting of a wavelength error range in the second embodiment. [Figure 11] 10 is a flowchart showing a spectroscopic analysis method according to a third embodiment. [Figure 12] FIG. 11 is an explanatory diagram for explaining a method for determining a reflectance threshold value according to the third embodiment. [Figure 13] FIG. 10 is a block diagram showing a schematic configuration of a spectroscopic analysis device according to a fourth embodiment. DETAILED DESCRIPTION OF THE INVENTION
[0008] [First embodiment] The first embodiment will be described below. FIG. 1 is a block diagram showing a schematic configuration of a spectroscopic analysis device 1 according to the first embodiment. The spectroscopic analysis device 1 of this embodiment includes a spectroscopic camera 10 that captures a spectroscopic image of the object W to be measured, and an analysis device 20 that analyzes the object W based on the captured spectroscopic image. This spectroscopic analysis device 1 uses a spectroscopic camera 10 to capture spectroscopic images of a plurality of spectral wavelengths of a measured object W transported along a transport path, and analyzes the measured object W from the captured spectroscopic images. When capturing a spectral image of the object W to be measured, pixels that are not suitable for analysis may be present in the captured spectral image. For example, taking a pellet-shaped resin molded product as an example, the pellet's end has multiple uneven surfaces, causing diffuse reflection of light, and pixels corresponding to the pellet's end in the spectral image have higher reflectance at each spectral wavelength than pixels on the side of the pellet. If such pixels are included as pixels to be analyzed, there is a high possibility that errors will be included in the analysis results of the object W to be measured. In the present disclosure, such pixels that are not suitable for analysis are excluded as pixels that do not need to be analyzed, and the object W to be measured is analyzed using only the analysis target pixels that are suitable for analysis. Such a spectroscopic analyzer 1 will be described in detail below.
[0009] [Configuration of Spectroscopic Camera 10] The spectroscopic camera 10 separates incident light from the object W under measurement into predetermined spectral wavelengths and captures an image of the separated incident light. The spectroscopic camera 10 is also capable of switching between spectral wavelengths and captures spectral images for a plurality of spectral wavelengths. In the spectroscopic camera 10, the configuration for separating incident light into light of different wavelengths is not particularly limited, and for example, a wavelength tunable interference filter (Fabry-Perot etalon), an AOTF (Acousto-Optic Tunable Filter), an LCTF (Liquid Crystal Tunable Filter), etc. can be used.
[0010] [Configuration of the analysis device 20] The analysis device 20 can be configured, for example, by a general computer such as a smartphone, a tablet terminal, or a personal computer, and as shown in FIG. 1, includes at least a memory unit 21 and one or more processors 22.
[0011] The storage unit 21 is an information storage device configured with a memory, a hard disk, and the like. The information stored in the storage unit 21 includes various programs including a spectroscopic analysis program for performing analysis processing by the analysis device 20, and various data used when executing the spectroscopic analysis program and other various programs. The various types of data include, for example, spectroscopic image data captured by the spectroscopic camera 10, analyzed pixel data including spectroscopically unnecessary pixels and spectroscopically target pixels determined for the spectroscopic image data, and threshold data that stores reflectance thresholds used to classify the spectroscopically unnecessary pixels and spectroscopically target pixels.
[0012] The spectroscopic image data is image data of a spectroscopic image captured by the spectroscopic camera 10. In this embodiment, the spectroscopic wavelength is switched for the imaging target, and spectroscopic images are captured for each of a plurality of spectroscopic wavelengths. Therefore, spectroscopic image data for a plurality of spectroscopic wavelengths for the same imaging target are recorded in association with each other by an image ID or the like. The analyzed pixel data is the spectral unnecessary pixels and spectral target pixels for the spectral image associated with the image ID, and indicates pixels extracted based on the reflectance threshold determined by the analysis device 20. The threshold data is the reflectance threshold used to extract the spectral unnecessary pixels and spectral target pixels for the spectral image associated with the image ID. These spectroscopic image data, analyzed pixel data, and threshold data are spectroscopic images, analyzed pixels, and reflectance thresholds for the object W that were used in spectroscopic analysis processes that were previously performed, and can be used as training data for machine learning. Note that the machine learning will be described in a fourth embodiment below.
[0013] Furthermore, the storage unit 21 may further store the emission spectrum of the illumination light, the sensitivity characteristics of the spectroscopic camera 10, the spectroscopic characteristics of the spectroscopic camera 10, and the like.
[0014] The processor 22 reads and executes the programs stored in the storage unit 21, thereby functioning as an image acquisition unit 221, a spectrum calculation unit 222, a threshold determination unit 223, a pixel classification unit 224, an analysis unit 225, and the like.
[0015] The image acquisition unit 221 acquires spectral images of a plurality of spectral wavelengths of the object to be measured W. In this embodiment, the image acquisition unit 221 acquires the spectral images by controlling the spectroscopic camera 10 to capture an image of the object to be measured W, but is not limited to this. For example, the image acquisition unit 221 may acquire the spectral images by downloading spectral images stored in a predetermined data server on the Internet, or may receive spectral images transmitted from another device.
[0016] The spectrum calculation unit 222 calculates the spectral spectrum and the spectral reflectance spectrum of each pixel based on the gradation value of each pixel of the spectral image for the acquired multiple spectral wavelengths. That is, by capturing spectral images of the object W at multiple spectral wavelengths in the same orientation, the same pixel in each spectral image becomes data indicating the same measurement position on the object W. Therefore, the spectral spectrum at each position on the object W can be extracted from the gradation values of the same pixel in these spectral images. The spectrum calculation unit 222 also calculates the spectral reflectance spectrum by converting the gradation values into reflectance. The conversion from gradation values to reflectance can be performed using known techniques, for example, by converting the gradation values for each spectral wavelength based on a white reference spectrum and a black reference spectrum. The white reference spectrum can be, for example, the illumination light emission spectrum or the imaging result of reflected light from a white reference plate. The black reference spectrum can be the imaging result obtained when incident light on the spectroscopic camera 10 is blocked. These white reference spectrum and black reference spectrum can be stored in advance in the storage unit 21.
[0017] The threshold value determination unit 223 determines a reflectance threshold value for classifying each pixel included in the spectral image into a pixel not requiring spectral analysis and a pixel to be spectral analyzed, based on the spectral reflectance spectrum of each pixel. As will be described in detail later, in this embodiment, the threshold determination unit 223 sets a provisional threshold and calculates the number of pixels at each spectral wavelength that exceed the provisional threshold. Note that the "number of pixels" in this disclosure not only means the number of pixels but also includes the proportion of the corresponding pixels to all pixels. That is, the threshold determination unit 223 may count the number of pixels that exceed the provisional threshold itself, or may calculate a pixel proportion, which is the proportion of the number of pixels that exceed the provisional threshold to the total number of pixels. Then, the threshold determination unit 223 determines the analysis wavelength and reflectance threshold used to classify pixels to be analyzed and pixels not requiring analysis, based on the number of pixels that exceed the provisional threshold when the provisional threshold is changed.
[0018] The pixel classification unit 224 binarizes the spectral image of the analysis wavelength based on the reflectance threshold determined by the threshold determination unit 223, and classifies the image into pixels to be analyzed and pixels not requiring analysis.
[0019] The analysis unit 225 performs various analysis processes based on the reflectance spectrum of the analysis target pixel classified by the pixel classification unit 224. The analysis processes are not particularly limited, and examples thereof include identifying the components that make up the object W, determining the content (composition ratio) of a predetermined component contained in the object W, and the like.
[0020] [Spectroscopy method] Next, a spectroscopic analysis method using the spectroscopic analysis device 1 of this embodiment will be described. FIG. 2 is a flowchart showing the spectroscopic analysis method of this embodiment. In the spectroscopic analysis method using the spectroscopic analyzer 1, first, the image acquisition unit 221 of the analyzer 20 acquires a spectroscopic image (step S1: spectroscopic image acquisition step). For example, in this embodiment, the image acquisition unit 221 controls the spectroscopic camera 10 to capture spectroscopic images of the object W while switching the spectroscopic wavelength. As a result, spectroscopic images for a plurality of spectra are captured, and the spectroscopic images for each spectroscopic wavelength are transmitted from the spectroscopic camera 10 to the analysis device 20. The timing for capturing the spectral image may be the timing when an imaging operation is input by a user, or, in the case where a manufactured product is used as the object W to be measured in a factory or the like and the manufactured product is to be inspected, the spectral image may be captured when the object W to be measured is transported to a predetermined position by a transport means such as a belt conveyor.
[0021] Next, the spectrum calculation unit 222 calculates the spectral reflectance spectrum of each pixel based on the captured spectral images of each spectral wavelength (step S2: spectrum calculation step). For example, for the spectral images of each spectral wavelength, the gradation value of each pixel is converted to a reflectance. For example, the spectrum calculation unit 222 calculates the reflectance S λ (x, y) is calculated using the following formula (1).
[0022] [Number 1] S λ (x,y)={E λ (x,y)-B(x,y)} / {W λ (x,y)-B(x,y)}…(1)
[0023] In addition, E λ (x, y) is the gradation value of pixel (x, y) in the spectral image of the object W captured at the spectral wavelength λ. λ (x, y) is the gradation value of pixel (x, y) in the spectral image of the spectral wavelength λ obtained by capturing the illumination light reflected by the white reference plate. B(x, y) is the gradation value of pixel (x, y) when the spectroscopic camera 10 captures a black image while blocking the light to the spectroscopic camera 10. As mentioned above, W λ (x, y) and B(x, y) may be stored in advance in the storage unit 21. If B(x, y) is sufficiently small, it may be ignored (omitted).
[0024] Next, the threshold value determining unit 223 sets the number of types to be measured among the components or structures contained in the object to be measured W (step S3). This step S3 may be performed before or after step S1. FIG. 3 shows an example of a spectral image of the object W at a predetermined spectral wavelength. For example, in the example shown in FIG. 3, the object W is a single type of resin pellet. In this case, to determine the type of resin, a reflectance threshold value for determining the type of resin is set, and the user simply inputs "1" in step S3. This allows the object W to be classified into portions unsuitable for analysis, such as the pellet ends (white portions), and portions suitable for analysis, such as the pellet side surfaces. Note that in FIG. 3, the container, stage, and other components are also reflected in the spectral image, and these portions, like the pellet ends, are determined to be unsuitable for analysis. While the example in FIG. 3 illustrates a single type of resin, for an object W that contains a mixture of two or more types of resin molded products, the user simply inputs "2" in step S3.
[0025] Next, the threshold value determination unit 223 determines the reflectance threshold value. A method for determining the reflectance threshold value will be described in detail with reference to FIGS. Fig. 4 is a diagram showing an example of the optical spectrum (reflectance spectrum) of each pixel. Fig. 5 is a diagram showing an example of the number of pixels (pixel ratio) whose reflectance is equal to or greater than the provisional threshold value when the provisional threshold value is changed for each optical wavelength. Fig. 6 is a diagram showing the number of pixels (pixel ratio) for one optical wavelength in an easier-to-understand manner. Fig. 7 is a diagram showing an example of each piece of information related to the flat portion when the provisional threshold value for reflectance is swept.
[0026] In this embodiment, step S2 calculates a spectral reflectance spectrum for each pixel as shown in Fig. 4. As shown in Fig. 4, the spectral reflectance spectrum for each pixel is different, and includes pixels to be spectrally analyzed and pixels not to be spectrally analyzed. In this embodiment, to separate such pixels to be spectrally analyzed from pixels not to be spectrally analyzed, the spectral image is binarized based on a reflectance threshold, and pixels that are equal to or greater than the threshold are considered pixels not to be spectrally analyzed, and pixels that are less than the threshold are considered pixels to be spectrally analyzed. In this embodiment, a preset value is not used as the reflectance threshold value, but an optimum value is set for each object W to be measured. Specifically, the threshold determination unit 223 sets a provisional threshold, binarizes the spectral image of each spectral wavelength using the provisional threshold, and counts the number of pixels that are equal to or greater than the provisional threshold. The threshold determination unit 223 also calculates the number of pixels when the provisional threshold is changed (for example, gradually increased) (step S4). For example, in this embodiment, the provisional threshold is set to "0" and the provisional threshold is gradually increased to count the number of pixels whose reflectance exceeds the provisional threshold. Note that for each spectral wavelength, the provisional threshold is gradually increased to count the number of pixels whose reflectance is equal to or greater than the provisional threshold. This yields the results shown in FIG. 5.
[0027] Figure 6 shows the number of pixels (pixel ratio) extracted for one spectral wavelength (440 nm) in Figure 5. By setting the provisional threshold to 0, all pixels are equal to or greater than the provisional threshold, so the number of pixels (pixel ratio) becomes 100%. When the provisional threshold is gradually increased from 0, the number of pixels (pixel ratio) remains at 100% for a while, but once the provisional threshold reaches a certain value or higher, the number of pixels (pixel ratio) begins to decrease. For example, in the example in Figure 6, the number of pixels (pixel ratio) decreases when the provisional threshold is set to 0.21 or higher. Then, when a certain provisional threshold is reached, the number of pixels (pixel percentage) may stop changing within a certain provisional threshold range. By gradually increasing the provisional threshold beyond this range where the number of pixels (pixel percentage) stops changing, the number of pixels (pixel percentage) decreases again, and finally the number of pixels (pixel percentage) becomes 0%. For example, in the example of Figure 6, the number of pixels (pixel percentage) does not change when the provisional threshold is between 0.28 and 0.38.
[0028] In this disclosure, the range of the provisional threshold value in which the number of pixels equal to or greater than the provisional threshold value does not change when the provisional threshold value is changed is referred to as the flat portion A (see FIG. 6). Note that the "range of the provisional threshold value in which the number of pixels equal to or greater than the provisional threshold value does not change" includes a predetermined tolerance range in addition to the number of pixels being strictly zero. Furthermore, the cases where the number of pixels (pixel ratio) is 0% and 100% are excluded from the flat portion A. Furthermore, the case where the provisional threshold range is too small is also excluded from the flat portion A. For example, in this embodiment, even if there is a range where the number of pixels (pixel ratio) does not change when the provisional threshold is gradually increased, if the range of the provisional threshold is 0.02 or less, it is not regarded as (excluded from) the flat portion A. The upper limit of the range of the provisional thresholds that make up the flat area A is R H The lower limit is R L The width of the flat part A (threshold width) is R W Then, as shown in Figure 7, for each spectral wavelength, the number of flat parts A and the upper limit value R of each flat part A are H , lower limit R L , and the threshold width R W are obtained respectively. In step S4, the threshold value determination unit 223 sweeps the provisional threshold value and calculates the number of pixels that are equal to or greater than the provisional threshold value, thereby acquiring various pieces of information relating to the flat portion A as shown in FIG.
[0029] Next, the threshold determination unit 223 determines the analysis wavelength (step S5). In this embodiment, in step S5, the threshold value determining unit 223 determines the threshold value width R W For example, in the examples of FIGS. 5 and 7, the spectral wavelength at which the threshold width R W The analysis wavelength is 440 nm, where is 0.10.
[0030] Next, the threshold value determining unit 223 determines a reflectance threshold value based on the flat portion A at the analysis wavelength (step S6). Steps S4 to S6 correspond to the threshold value determining step of the present disclosure. In step S6, the threshold value determining unit 223 determines, for example, the upper limit R of the flat portion A at the analysis wavelength. H and lower limit R L Using the average value ((R H +R L ) / 2) is set as the reflectance threshold. In the example of FIG. 6, the positions of both ends of the flat portion A are set to the upper limit value R H and lower limit R LHowever, the number of pixels that are equal to or greater than the provisional threshold may change gradually as the provisional threshold increases. In this case, the inflection points on both ends of the flat portion A are set to the upper limit value R H and lower limit R L It may also be used as.
[0031] The above is an example in which the number of types input in step S3 is one, but if the number of types is two or more, the reflectance threshold value may be determined based on the number of pixels of spectral wavelengths in which two or more flat portions A appear. In this case, the analysis wavelength is the threshold width R of each flat part A. W is equal to or greater than a predetermined value, and the threshold width R W The spectral wavelength at which the sum or average value of is maximum is defined as the analysis wavelength. In addition, the threshold width R of each flat part A of the analysis wavelength W Based on this, similarly to step S6, each reflectance threshold is determined.
[0032] Thereafter, the pixel classification unit 224 uses the reflectance threshold determined in step S6 to binarize the reflectance of each pixel of the spectral image of the analysis wavelength, and classifies the pixels into those to be analyzed that are less than the reflectance threshold and those that do not need to be analyzed that are greater than or equal to the reflectance threshold (step S7: pixel classification step). The spectral image of the analysis wavelength here is an image in which the gradation value of each pixel of the spectral image for the analysis wavelength is converted to reflectance in step S2. If the number of types is two or more in step S3, multiple reflectance thresholds are calculated. In this case, the pixel classification unit 224 classifies, for example, pixels with reflectance equal to or greater than the maximum threshold as pixels not requiring analysis, and pixels with reflectance less than the maximum threshold as pixels to be analyzed. Furthermore, the pixel classification unit 224 classifies the pixels to be analyzed into multiple groups based on other reflectance thresholds.
[0033] Thereafter, the analysis unit 225 performs various analysis processes on the object W based on the spectral reflectance spectrum of the pixel to be analyzed (step S8: analysis step).
[0034] [Effects of this embodiment] In the spectroscopic analysis device 1 of this embodiment, the processor 22 of the analysis device 20 loads and executes a program stored in the storage unit 21, thereby functioning as an image acquisition unit 221, a spectrum calculation unit 222, a threshold determination unit 223, a pixel classification unit 224, and an analysis unit 225. The image acquisition unit 221 performs an image acquisition step of acquiring a spectral image of the object W under measurement for a plurality of spectral wavelengths. The spectrum calculation unit 222 performs a spectrum calculation step of extracting a spectral spectrum of each pixel based on the spectral image corresponding to the plurality of spectral wavelengths and calculating the reflectance of each pixel. The threshold determination unit 223 performs a threshold determination step of determining a reflectance threshold for distinguishing between pixels not requiring analysis and pixels to be analyzed based on the reflectance of each pixel. The pixel classification unit 224 performs a pixel classification step of classifying a plurality of pixels into pixels not requiring analysis and pixels to be analyzed based on the reflectance threshold. The analysis unit 225 performs an analysis step of performing a spectral analysis of the object under measurement based on the pixels to be analyzed.
[0035] This allows each pixel in the captured image (spectral image) of the object W to be measured to be classified into spectral target pixels suitable for analysis and spectral non-required pixels unsuitable for analysis. Therefore, if the object W is, for example, a pellet-shaped resin molded product, even if the pellet edge has a portion unsuitable for analysis due to diffused light reflection, spectral analysis can be performed excluding that portion. Furthermore, if a predetermined fixed reflectance threshold is used, depending on the type and color of the object W, the imaging angle of the spectral image, and the like, pixels that are not actually suitable for analysis may be determined as analysis target pixels, and even pixels suitable for analysis may be determined as non-analysis pixels. In contrast, in this embodiment, a reflectance threshold is set for each spectral image of the object W, so that an optimal reflectance threshold can be determined regardless of the type and color of the object W or the imaging angle of the spectral image.
[0036] In this embodiment, in the threshold determination step, the threshold determination unit 223 binarizes multiple pixels based on a provisional threshold, and identifies a flat portion A, which is a range of provisional thresholds in which the number of pixels having a reflectance greater than or equal to the provisional threshold does not change when the provisional threshold is changed, and determines a reflectance threshold based on the range of provisional thresholds for the flat portion A. In this way, by changing the provisional threshold value, it is possible to determine the optimum threshold value range, which makes it possible to determine the optimum reflectance threshold value regardless of the type or color of the object W or the imaging angle of the spectral image, as described above.
[0037] In this embodiment, in the spectrum calculation step, the spectrum calculation unit 222 calculates the spectral reflectance corresponding to each of multiple spectral wavelengths for each pixel. In the threshold determination step, the threshold determination unit 223 identifies a flat portion A for each spectral wavelength based on the spectral reflectance corresponding to the multiple spectral wavelengths, and sets the spectral wavelength at which the range of the provisional threshold for the flat portion A is maximum as the analysis wavelength. Then, the reflectance threshold is determined based on the flat portion A at the analysis wavelength. In the pixel classification step, the pixel classification unit 224 classifies the spectral image for the analysis wavelength into pixels that do not need to be analyzed and pixels to be analyzed based on the reflectance threshold. In a spectral image of the object W to be measured, the reflectance varies for each spectral wavelength. Therefore, whether or not a reflectance threshold value that can appropriately classify pixels to be analyzed from pixels not requiring analysis can be set varies for each spectral wavelength. For example, in the example shown in FIG. 7, the spectral reflectance from 500 nm to 700 nm is not suitable for setting a reflectance threshold value. In this embodiment, the temporary threshold value is changed for each spectral wavelength to identify the flat portion A, so that the spectral wavelengths that are not suitable for setting a reflectance threshold value as described above can be excluded.
[0038] In this embodiment, the threshold value determination unit 223 determines the lower limit R of the range of the provisional threshold values of the flat portion A in the threshold value determination step. L and upper limit R H The average of and is determined as the reflectance threshold. As a result, the upper limit R of the provisional threshold for the flat area A H or lower limit R L As compared with the case where .gtoreq..times ...
[0039] In this embodiment, in the threshold determination step, if the width of the range of provisional threshold values in which the number of pixels having a reflectance equal to or greater than the provisional threshold value does not change is greater than a predetermined width, the threshold determination unit 223 identifies the range of provisional threshold values as flat portion A, and if the width of the range of provisional threshold values is less than the predetermined width, the threshold determination unit 223 excludes the range of provisional threshold values from flat portion A. When the provisional threshold value is changed, the portion where the width of the range of the provisional threshold value is less than the predetermined width is likely to be the reflectance of the background image of the mounting table on which the object W is placed, etc. By excluding such a portion from the flat portion A, it is possible to suitably classify the partial spectral unnecessary pixels of the object W.
[0040] [Second embodiment] Next, a second embodiment will be described. In the first embodiment, in step S4, the provisional threshold is gradually increased for all of the plurality of spectral wavelengths to detect the presence or absence of the flat portion A. In contrast, the second embodiment differs from the first embodiment in that the reflectance threshold is determined by narrowing the wavelength range to a certain extent, rather than targeting all of the spectral wavelengths.
[0041] FIG. 8 is a block diagram showing a schematic configuration of a spectroscopic analysis device 1A of the second embodiment. In the following description, the same reference numerals will be used to designate items that have already been described, and their description will be omitted or simplified. In this embodiment, the memory unit 21 of the analysis device 20A pre-stores the absorption peak wavelength of the object W to be measured. For example, when a resin product is used as the object W to be measured, the absorption peak wavelength for the resin of the resin product is pre-stored. Furthermore, when performing an analysis process on multiple types of objects W to be measured, the absorption peak wavelengths of the multiple types of resin may be stored, and the user may select which absorption peak wavelength or which type of resin to use. Furthermore, the absorption peak wavelength input by the user may be stored in the memory unit 21.
[0042] The processor 22 of the analysis device 20A of this embodiment reads and executes programs stored in the memory unit 21, thereby functioning as an image acquisition unit 221, a spectrum calculation unit 222, a threshold determination unit 223, a pixel classification unit 224, an analysis unit 225, a wavelength acquisition unit 226, and the like. The wavelength acquisition unit 226 acquires the absorption peak wavelength of the object W. As described above, when only one type of object W is to be analyzed, the absorption peak wavelength for that object W may be stored in the storage unit 21 in advance. In the case of a spectroscopic analysis device 1A capable of analyzing multiple types of objects W to be measured, the absorption peak wavelengths of multiple types of objects (e.g., resins, etc.) are stored in the storage unit 21. In this case, the wavelength acquisition unit 226 displays which object is to be analyzed on a display (not shown) or the like, and prompts the user to input the object to be analyzed. Then, the wavelength acquisition unit 226 acquires the absorption peak wavelength corresponding to the object to be analyzed input by the user. As described above, the configuration may also be such that the user inputs the absorption peak wavelength, in which case the wavelength acquisition section 226 acquires the absorption peak wavelength input by the user.
[0043] Alternatively, the wavelength acquisition unit 226 may automatically estimate the absorption peak wavelength. For example, in the same spectroscopic analysis method as in the first embodiment, the absorption peak wavelength is estimated based on the spectral reflectance spectrum of each pixel acquired in step S2 or the second derivative of the spectral reflectance spectrum. In this case, the peak wavelength (maximum wavelength or minimum wavelength) for each pixel is identified, and the most frequently occurring wavelength is identified as the absorption peak wavelength based on a histogram of the peak wavelengths.
[0044] In this embodiment, the threshold determination unit 223 determines the analysis wavelength and reflectance threshold based on the number of pixels having a reflectance exceeding the provisional threshold, with the absorption peak wavelength acquired by the wavelength acquisition unit 226 as the center and targeting spectral wavelengths included within a predetermined wavelength error range.
[0045] [Spectroscopy method] FIG. 9 is a flowchart showing the spectroscopic analysis method of this embodiment. In this embodiment, similarly to the first embodiment, steps S1 to S3 are carried out to acquire spectral images for each spectral wavelength, calculate the spectral spectrum for each pixel, and acquire the number of types input by the user.
[0046] In this embodiment, the peak absorption wavelength of the object W is then acquired (step S11: wavelength acquisition step). In step S11, as described above, if the object W has been determined in advance, the peak absorption wavelength for that object W is read from the storage unit 21. Alternatively, the peak absorption wavelength input by the user may be acquired, or the peak absorption wavelength corresponding to the type of object W selected by the user from the peak absorption wavelengths for multiple types of objects may be read into the storage unit 21. Alternatively, the peak wavelength may be identified based on the spectral reflectance spectrum of each pixel calculated in step S2 or its second derivative, and the most frequently occurring wavelength may be estimated as the peak absorption wavelength based on a histogram of the number of pixels for each identified peak wavelength.
[0047] Next, the wavelength acquisition unit 226 determines the wavelength error range (step S12). Although this wavelength error range may be read out in advance from the storage unit 21, it is more preferable to set the wavelength error range appropriately depending on the object W to be measured. FIG. 10 is an explanatory diagram for explaining the wavelength error range. In step S12, the wavelength acquisition unit 226 counts the number of pixels whose peak wavelength falls within the wavelength error range centered on the absorption peak wavelength set in step S11 while changing the wavelength error range. For example, when the wavelength error range is gradually increased from 0, the number of pixels whose peak wavelength falls within the wavelength error range centered on the absorption peak wavelength is counted. When the wavelength error range is 0, only pixels whose peak wavelength matches the absorption peak wavelength identified in step S11 are counted. By gradually increasing the wavelength error range, the number of pixels whose peak wavelength falls within the wavelength error range increases, as shown in FIG. 10. When a predetermined wavelength error range is reached, the number of pixels whose peak wavelength falls within the wavelength error range remains almost constant. By further expanding the wavelength error range, other absorption peak wavelengths are included within the wavelength error range, and the number of pixels whose peak wavelength falls within the wavelength error range begins to increase again. Furthermore, by further expanding the wavelength error range, there may be several times when the number of pixels whose peak wavelength falls within the wavelength error range remains almost constant.
[0048] In this embodiment, the wavelength acquisition unit 226 sets the wavelength error range E(x) based on the wavelength interval Aλ in which the number of pixels whose peak wavelengths fall within the wavelength error range first stops changing when the wavelength error range is gradually increased. Specifically, the wavelength acquisition unit 226 sets the average ((A1+A2) / 2) of the inflection points A1 and A2 at both ends of the wavelength interval Aλ as the wavelength error range E(x).
[0049] Thereafter, the threshold determination unit 223 binarizes the spectral images of spectral wavelengths included in the wavelength error range E(x) centered on the absorption peak wavelength using the set provisional threshold, and counts the number of pixels that are equal to or greater than the threshold (step S13). That is, in the first embodiment, the threshold determination unit 223 specified the flat portion A by sweeping the provisional threshold over the spectral images of all spectral wavelengths in step S4. In contrast, the threshold determination unit 223 in the second embodiment specifies the flat portion A by sweeping the provisional threshold over the spectral images of each spectral wavelength within the wavelength error range E(x) centered on the absorption peak wavelength. Therefore, compared to the first embodiment, the number of flat portions A to be specified is reduced, and the cost associated with calculations can be reduced. The processing from step S5 onwards is the same as in the first embodiment.
[0050] [Effects of this embodiment] In this embodiment, the processor 22 also functions as a wavelength acquisition unit 226, which further performs a wavelength acquisition step of acquiring a peak wavelength according to the type of the object to be measured W. Furthermore, in the threshold determination step, the threshold determination unit 223 identifies a flat portion A of a plurality of spectral wavelengths that are included in a predetermined wavelength error range centered on the peak wavelength. This allows the spectral wavelengths for identifying the flat portion A to be narrowed down in advance compared to when the flat portion A is identified for all spectral wavelengths, thereby reducing the load and time required for processing.
[0051] [Third embodiment] Next, a third embodiment will be described. In the first embodiment, the reflectance threshold value is determined by specifying the flat portion A by changing (e.g., gradually increasing) the provisional threshold value for the spectral image of each spectral wavelength. In contrast, the third embodiment differs from the first embodiment in that the reflectance threshold value is determined from a histogram of the reflectance of each spectral wavelength.
[0052] FIG. 11 is a flowchart showing a spectroscopic analysis method according to the third embodiment. FIG. 12 is a diagram illustrating a method for determining a reflectance threshold value according to the third embodiment, showing a histogram of reflectance. In this embodiment, similar to the first embodiment, the processes from step S1 to step S3 are carried out. Thereafter, the threshold determination unit 223 counts the number of pixels corresponding to the spectral reflectance based on the reflectance (spectral reflectance) of each pixel in each spectral image, and calculates the number of pixels when the reflectance is gradually increased (step S21). That is, the number of pixels with a predetermined reflectance is counted in the spectral image of each spectral wavelength, and the number of pixels corresponding to the reflectance is calculated for each spectral wavelength. Alternatively, a histogram showing the number of pixels relative to the reflectance may be created, with the reflectance as the first axis (e.g., the horizontal axis) and the number of pixels as the second axis (e.g., the vertical axis), as shown in FIG. Then, based on the number of pixels corresponding to the reflectance calculated in step S21, the threshold determination unit 223 detects peak reflectances equal to the number of types at which the number of pixels reaches a peak plus one (step S22). For example, if the number of types obtained in step S3 is one, two peak reflectances are calculated. Using the example histogram shown in FIG. 12 as an example, the reflectances of "R1" and "R2" are detected as peak reflectances. Here, the peak of reflectance centered on R2 includes pixels that contain unnecessary spectral pixels with high brightness values in the spectral image, such as the pellet edge, while the peak of reflectance centered on R1 includes pixels to be analyzed, such as the pellet side surface. Note that spectral wavelengths with one or fewer peak reflectances are wavelengths that are not suitable for determining the reflectance threshold or for classifying pixels to be analyzed and pixels not to be analyzed.
[0053] Next, threshold determination unit 223 identifies a continuous data section between detected peak reflectances R1 and R2 where the frequency is zero or an extremely small value (zero frequency section B in FIG. 12) (step S23). That is, a section between peak reflectances R1 and R2 where the number of pixels is equal to or less than a predetermined lower limit pixel number is identified as zero frequency section B. Thereafter, the threshold determination unit 223 determines the wavelength with the largest section width of the zero frequency section B among the spectral wavelengths as the analysis wavelength (step S24). Furthermore, the threshold value determining unit 223 determines the average ((R1+R2) / 2) of the peak reflectances R1 and R2 in the zero frequency section B of the analysis wavelength as the reflectance threshold value (step S25). The processing from step S7 onwards is the same as in the first embodiment.
[0054] Note that the above is an example in which the number of types input in step S3 is one, but if the number of types is two or more, three or more peak reflectivities should be detected in step S22 and two or more zero frequency sections B should be identified. In this case, the analysis wavelength is, for example, the spectral wavelength at which the section width of each zero frequency section B is equal to or greater than a predetermined value and the sum or average value of these section widths is maximum. Furthermore, similarly to step S25, each reflectance threshold is determined based on each zero frequency section B of the analysis wavelength.
[0055] [Effects of this embodiment] In this embodiment, in the threshold determination step, the threshold determination unit 223 calculates (counts) the number of pixels for each reflectance based on the reflectance of each pixel, and computes the number of pixels for that reflectance. The threshold determination unit 223 also detects peak reflectances A1 and A2 where the number of pixels reaches a peak value, and identifies a zero frequency section B between adjacent peak reflectances A1 and A2 where the number of pixels is less than a predetermined value. The threshold determination unit 223 then determines the reflectance threshold based on the identified zero frequency section B.
[0056] In this embodiment, similar to the first embodiment described above, each pixel of the captured image (spectral image) of the object W can be classified into spectral target pixels suitable for analysis and spectral unnecessary pixels unsuitable for analysis. Furthermore, by statistically processing the reflectance of each pixel included in each spectral image, an optimal reflectance threshold can be determined regardless of the type or color of the object W or the capturing angle of the spectral image.
[0057] In this embodiment, in the threshold determination step, the threshold determination unit 223 identifies a zero frequency section B for each spectral wavelength based on the spectral reflectances corresponding to the multiple spectral wavelengths, sets the spectral wavelength corresponding to the zero frequency section B at which the width of the zero frequency section B is greatest as the analysis wavelength, and determines the reflectance threshold based on the zero frequency section B for that analysis wavelength. Then, in the pixel classification step, the pixel classification unit 224 classifies the spectral image for the analysis wavelength into pixels that do not need to be analyzed and pixels to be analyzed based on the previous reflectance threshold.
[0058] In a spectral image of the object W to be measured, the reflectance differs for each spectral wavelength. Therefore, whether or not a reflectance threshold that can appropriately classify pixels to be analyzed from pixels not requiring analysis can be set differs for each spectral wavelength. In this embodiment, since the zero frequency section B is specified for each spectral wavelength, it is possible to exclude spectral wavelengths that are not suitable for setting a reflectance threshold, and pixel classification based on a spectral image that can appropriately classify pixels to be analyzed from pixels not requiring analysis is possible.
[0059] [Fourth embodiment] Next, a fourth embodiment will be described. FIG. 13 is a block diagram showing a schematic configuration of a spectroscopic analysis apparatus 1B according to the fourth embodiment. The spectroscopic analysis device 1B of this embodiment includes a spectroscopic camera 10 and an analysis device 20B, as in the first embodiment, and the processor 22 of the analysis device 20B further functions as a model generation unit 227. The memory unit 21 of the analysis device 20B, like the memory unit 21 of the first embodiment, records the spectroscopic image data captured by the spectroscopic camera 10, and threshold data that stores the reflectance threshold and analysis wavelength used to classify the spectroscopic image data into pixels that do not require spectroscopy and pixels that are subject to spectroscopy.
[0060] The model generation unit 227 then performs machine learning using the spectral image data recorded (stored) in the storage unit 21 and threshold data (combinations of reflectance thresholds and analytical wavelengths) for the spectral image data as training data, and generates a threshold derivation model that outputs a reflectance threshold and analytical wavelength for an input spectral image. The spectral image data is a spectral image at each spectral wavelength and has a spectral reflectance spectrum for each pixel. That is, it includes data related to the reflectance of each pixel in each spectral image, the peak wavelength for each pixel, the number of pixels for each peak wavelength in the spectral image, the number of pixels for each reflectance in the spectral image, and the like. Furthermore, as described in each of the above-described embodiments, the reflectance threshold and analytical wavelength, which are the threshold data, are calculated using the reflectance of each pixel in each spectral image, the peak wavelength for each pixel, the number of pixels for each peak wavelength in the spectral image, the number of pixels for each reflectance in the spectral image, and the like. Therefore, the model generation unit 227 can generate a threshold derivation model that outputs a reflectance threshold and analytical wavelength from a spectral image by storing a large amount of training data and performing machine learning.
[0061] In this embodiment, by generating a threshold derivation model by the model generation unit 227, spectroscopic analysis using the threshold derivation model can be performed in the subsequent spectroscopic analysis process instead of steps S1 to S8. That is, a spectral image is acquired in steps S1 and S2, the reflectance spectrum of each pixel is calculated, and then the spectral image is generated into a threshold derivation model. As a result, an analysis wavelength and a reflectance threshold are output from the threshold derivation model. Therefore, the processes of steps S3 to S6 can be omitted, and the processes of steps S7 and S8 can be performed using the analysis wavelength and reflectance threshold for which the threshold derivation model is output.
[0062] Even when the threshold derivation model is used, the analysis wavelength and the reflectance threshold may be periodically calculated by the methods of the first to third embodiments, thereby determining the accuracy of the reflectance threshold and the analysis wavelength output by the threshold derivation model.
[0063] [Effects of this embodiment] In the spectroscopic analysis device 1B of the present embodiment, the processor 22 of the analysis device 20B further functions as a model generation unit 227. In this analysis device 20B, a spectral image of the object W to be measured and a reflectance threshold value for the spectral image are accumulated as training data, and the model generation unit 227 generates a threshold derivation model that outputs a reflectance threshold value in response to an input of a spectral image of a new object to be measured. This makes it possible to easily output an optimal reflectance threshold simply by inputting a spectral image into the threshold derivation model, thereby reducing the processing load and time required for processing.
[0064] [Variations] The present invention is not limited to the above-described embodiment, and modifications and improvements within the scope of achieving the object of the present invention are included in the present invention.
[0065] [Variation 1] In the above embodiments, resin pellets have been exemplified as the object to be measured W, but the same applies to other objects to be measured W. For example, the object to be measured W may be a plant or food.
[0066] [Variation 2] In the above embodiment, an example was shown in which the spectroscopic analysis devices 1, 1A, and 1B are equipped with the spectroscopic camera 10, but as mentioned above, the spectroscopic camera 10 is not essential. For example, a spectroscopic image of the object W to be measured may be captured by a separate spectroscopic camera and uploaded to a data server on the Internet, and the analysis devices 20, 20A, and 20B may download the spectroscopic image from the data server.
[0067] [Variation 3] In the second embodiment, the absorption peak wavelength of the object W is acquired, but the spectral wavelengths for identifying the flat portion A may be narrowed down based on other peak wavelengths. For example, in the case of the object W having a high reflectance at a specific wavelength, a process for identifying the flat portion A may be performed for spectral wavelengths within a predetermined wavelength error range centered on the peak wavelength at which the reflectance is high.
[0068] In the first and second embodiments, the upper limit value R H and the lower limit R L However, the present invention is not limited to this example, and any reflectance included in the flat portion A may be used as the reflectance threshold. For example, the upper limit value R H , and the lower limit R L Either one of the above may be used as the reflectance threshold value.
[0069] Similarly, in the third embodiment, any reflectance included in the zero frequency section B may be used as the reflectance threshold. For example, the reflectance R1 or R2, which is at both ends of the zero frequency section B, may be determined as the reflectance threshold.
[0070] [Variation 4] In the second embodiment, the wavelength acquisition unit 226 calculates the wavelength error range E(x) as the average ((A1+A2) / 2) of the inflection points A1 and A2 at both ends of the wavelength section Aλ, but this is not limiting. For example, the wavelength acquisition unit 226 may use A1 or A2 as the wavelength error range E(x).
[0071] [Variation 5] In the first embodiment, the threshold determination unit 223 sets an analysis wavelength based on the spectral reflectance of each pixel, and determines the reflectance threshold based on the flat portion A at the analysis wavelength. Alternatively, the threshold determination unit 223 may calculate the average spectral reflectance for each pixel, and identify the flat portion A when the provisional threshold is changed for the spectral reflectance.
[0072] Summary of this disclosure The first aspect of the present disclosure includes an image acquisition step of acquiring spectral images of the object to be measured for a plurality of spectral wavelengths; a spectrum calculation step of extracting the spectral spectrum of each pixel from the spectral images corresponding to the plurality of spectral wavelengths and calculating the reflectance of each pixel; a threshold determination step of determining a reflectance threshold for distinguishing between pixels that do not need to be analyzed and pixels to be analyzed based on the reflectance of each pixel; a pixel classification step of classifying the plurality of pixels into pixels that do not need to be analyzed and pixels to be analyzed based on the reflectance threshold; and an analysis step of performing a spectral analysis of the object to be measured based on the pixels to be analyzed.
[0073] This allows each pixel in the spectral image of the object to be measured to be classified into spectral target pixels suitable for analysis and spectral non-required pixels unsuitable for analysis. Therefore, even if a portion of the object to be measured is unsuitable for analysis due to diffuse reflection of light, spectral analysis can be performed excluding that portion. Furthermore, if a predetermined fixed reflectance threshold is used, depending on the type and color of the object to be measured, the imaging angle of the spectral image, etc., pixels that are not actually suitable for analysis may be determined as analysis target pixels, and even pixels that are suitable for analysis may be determined as non-required pixels. In contrast, the spectral analysis method disclosed herein sets a reflectance threshold for each object to be measured, making it possible to determine an optimal reflectance threshold regardless of the type and color of the object to be measured, or the imaging angle of the spectral image.
[0074] In the spectroscopic analysis method of this aspect, it is preferable that in the threshold determination step, the pixels are binarized based on a provisional threshold, and when the provisional threshold is changed, a flat portion is identified as a range of the provisional threshold in which the number of pixels having a reflectance equal to or greater than the provisional threshold does not change, and the reflectance threshold is determined based on the range of the provisional threshold in the flat portion. This allows the optimum threshold range to be determined by changing the provisional threshold, and the optimum reflectance threshold can be determined regardless of the type or color of the object to be measured or the imaging angle of the spectral image.
[0075] In the spectroscopic analysis method of this aspect, it is preferable that in the spectrum calculation step, a spectral reflectance corresponding to each of the plurality of spectral wavelengths is calculated for each of the pixels; in the threshold determination step, the flat portion is identified for each of the spectral wavelengths based on the spectral reflectances corresponding to the plurality of spectral wavelengths; the spectral wavelength at which the range of the provisional threshold value for the flat portion is greatest is set as an analysis wavelength; the reflectance threshold is determined based on the flat portion at the analysis wavelength; and in the pixel classification step, the spectral image for the analysis wavelength is classified into pixels not requiring analysis and pixels to be analyzed based on the reflectance threshold. This allows the provisional threshold to be changed for each spectral wavelength to identify flat areas, so that spectral wavelengths that are not suitable for setting a reflectance threshold are excluded, and spectral wavelengths that are suitable for setting a reflectance threshold are used as analysis wavelengths, allowing each pixel to be suitably classified into pixels to be analyzed and pixels that do not need to be analyzed.
[0076] In the spectroscopic analysis method of this aspect, it is preferable to further perform a peak wavelength acquisition step of acquiring a peak wavelength according to the type of the object to be measured, and to identify the flat portions of the multiple spectroscopic wavelengths that are included in a predetermined wavelength error range centered on the peak wavelength in the threshold determination step. This makes it possible to narrow down the spectral wavelengths for which flat portions are to be identified in advance, compared to when flat portions are identified for all spectral wavelengths, thereby reducing the load and time required for processing.
[0077] In the spectroscopic analysis method of this aspect, it is preferable that in the threshold determination step, the average of the lower limit value and the upper limit value in the range of the provisional threshold value of the flat portion is determined as the reflectance threshold value. This allows for more accurate classification of pixels to be analyzed and pixels not to be analyzed compared to when the upper or lower limit of the provisional threshold value for the flat portion is used as the reflectance threshold value.
[0078] In the spectroscopic analysis method of this aspect, in the threshold determination step, if the width of the provisional threshold range in which the number of pixels having the reflectance equal to or greater than the provisional threshold does not change is equal to or greater than a predetermined width, the provisional threshold range is preferably identified as the flat portion, and if the width of the provisional threshold range is less than the predetermined width, the provisional threshold range is preferably excluded from the flat portion. This allows the partial spectral unnecessary pixels of the object W to be suitably classified.
[0079] In the spectroscopic analysis method of this aspect, in the threshold determination step, the number of pixels for each reflectance is calculated based on the reflectance of each pixel, the number of pixels for each reflectance is computed, the reflectance at which the number of pixels reaches a peak value is detected as the peak reflectance, a zero frequency interval is identified between adjacent peak reflectances in which the number of pixels is less than a predetermined value, and the reflectance threshold is determined based on the zero frequency interval. This makes it possible to determine an optimal reflectance threshold value regardless of the type or color of the object to be measured or the imaging angle of the spectral image by statistically processing the reflectance of each pixel contained in each spectral image.
[0080] In the spectroscopic analysis method of this aspect, it is preferable that in the spectrum calculation step, a spectral reflectance corresponding to each of the plurality of spectral wavelengths is calculated for each of the pixels; in the threshold determination step, the number of pixels for the reflectance for each of the plurality of spectral wavelengths is calculated, and the zero frequency section is identified for each of the spectral wavelengths; the spectral wavelength at which the width of the zero frequency section is greatest is designated as an analysis wavelength; the reflectance threshold is determined based on the zero frequency section at the analysis wavelength; and in the pixel classification step, the spectral image for the analysis wavelength is classified into the pixels not requiring analysis and the pixels to be analyzed based on the reflectance threshold. This allows the zero frequency interval to be identified for each spectral wavelength, making it possible to exclude spectral wavelengths that are not suitable for setting a reflectance threshold, and enabling pixel classification based on spectral images that can be appropriately classified into pixels to be analyzed and pixels that do not need to be analyzed.
[0081] In the spectroscopic analysis method of this aspect, the spectroscopic image of the object to be measured and the reflectance threshold value for the spectroscopic image may be accumulated as training data, and a threshold derivation model may be generated that outputs the reflectance threshold value in response to input of the spectroscopic image of a new object to be measured. This makes it possible to easily output an optimal reflectance threshold simply by inputting a spectral image into the threshold derivation model, thereby reducing the processing load and time required for processing.
[0082] A spectroscopic analysis device according to a second aspect of the present disclosure includes an image acquisition unit that acquires spectroscopic images of an object to be measured for a plurality of spectroscopic wavelengths; a spectrum calculation unit that extracts a spectroscopic spectrum of each pixel from the spectroscopic images corresponding to the plurality of spectroscopic wavelengths and calculates a reflectance of each pixel; a threshold determination unit that determines a reflectance threshold that distinguishes between pixels that do not need to be analyzed and pixels that are to be analyzed, based on the reflectance of each pixel; a pixel classification unit that classifies the plurality of pixels into the pixels that do not need to be analyzed and the pixels that are to be analyzed, based on the reflectance threshold; and an analysis unit that performs spectroscopic analysis of the object to be measured based on the pixels that are to be analyzed.
[0083] Such a spectroscopic analysis device can implement the spectroscopic analysis method of the first aspect. Therefore, each pixel of a spectral image of an object under measurement can be classified into spectral target pixels suitable for analysis and spectral non-target pixels unsuitable for analysis. Furthermore, because a reflectance threshold is set for each object under measurement, an optimal reflectance threshold can be determined regardless of the type or color of the object under measurement or the imaging angle of the spectral image. [Explanation of symbols]
[0084] 1, 1A, 1B...spectroscopic analysis device, 10...spectroscopic camera, 20, 20A, 20B...analysis device, 21...memory unit, 22...processor, 221...image acquisition unit, 222...spectrum calculation unit, 223...threshold determination unit, 224...pixel classification unit, 225...analysis unit, 226...wavelength acquisition unit, 227...model generation unit, A...flat section, Aλ...wavelength section, B...zero frequency section, W...object to be measured.
Claims
1. an image acquisition step of acquiring spectral images of the object to be measured for a plurality of spectral wavelengths; a spectrum calculation step of extracting a spectrum of each pixel from the spectral image corresponding to the plurality of spectral wavelengths and calculating a reflectance of each pixel; a threshold determination step of determining a reflectance threshold for distinguishing between pixels not requiring analysis and pixels to be analyzed based on the reflectance of each pixel; a pixel classification step of classifying the plurality of pixels into pixels not to be analyzed and pixels to be analyzed based on the reflectance threshold; an analyzing step of performing a spectroscopic analysis of the object to be measured based on the analysis target pixel; A spectroscopic analysis method for performing the above.
2. In the threshold determination step, the plurality of pixels are binarized based on a provisional threshold, and when the provisional threshold is changed, a flat portion is identified as a range of the provisional threshold in which the number of pixels having the reflectance equal to or greater than the provisional threshold does not change, and the reflectance threshold is determined based on the range of the provisional threshold in the flat portion. The spectroscopic analysis method according to claim 1 .
3. In the spectrum calculation step, a spectral reflectance corresponding to each of the plurality of spectral wavelengths is calculated for each pixel; In the threshold determination step, the flat portion is identified for each of the plurality of spectral wavelengths based on the spectral reflectances corresponding to the plurality of spectral wavelengths, the spectral wavelength at which the range of the provisional threshold value of the flat portion is maximum is set as an analysis wavelength, and the reflectance threshold is determined based on the flat portion at the analysis wavelength; In the pixel classification step, the spectral image for the analysis wavelength is classified into the analysis-unnecessary pixels and the analysis-target pixels based on the reflectance threshold. The spectroscopic analysis method according to claim 2 .
4. a peak wavelength acquisition step of acquiring a peak wavelength according to the type of the object to be measured; In the threshold determination step, the flat portions of the plurality of spectral wavelengths included in a predetermined wavelength error range centered on the peak wavelength are identified. The spectroscopic analysis method according to claim 3 .
5. In the threshold determination step, an average of a lower limit value and an upper limit value in a range of the provisional threshold value of the flat portion is determined as the reflectance threshold value. The spectroscopic analysis method according to claim 2 .
6. In the threshold determination step, if the width of the range of the provisional thresholds in which the number of pixels having the reflectance equal to or greater than the provisional threshold does not change is equal to or greater than a predetermined width, the range of the provisional thresholds is identified as the flat portion, and if the width of the range of the provisional thresholds is less than the predetermined width, the range of the provisional thresholds is excluded from the flat portion. The spectroscopic analysis method according to claim 2 .
7. In the threshold determination step, calculating the number of pixels for each reflectance based on the reflectance of each pixel, and calculating the number of pixels for each reflectance; detecting a reflectance at which the number of pixels reaches a peak value as a peak reflectance, and identifying a zero frequency section between adjacent peak reflectances in which the number of pixels is less than a predetermined value; determining the reflectance threshold based on the zero frequency interval; The spectroscopic analysis method according to claim 1 .
8. In the spectrum calculation step, a spectral reflectance corresponding to each of the plurality of spectral wavelengths is calculated for each pixel; In the threshold determination step, the number of pixels for the reflectance is calculated for each of the plurality of spectral wavelengths, the zero frequency section is identified for each of the spectral wavelengths, the spectral wavelength at which the width of the zero frequency section is greatest is designated as an analysis wavelength, and the reflectance threshold is determined based on the zero frequency section at the analysis wavelength; In the pixel classification step, the spectral image for the analysis wavelength is classified into the analysis-unnecessary pixels and the analysis-target pixels based on the reflectance threshold. The spectroscopic analysis method according to claim 7.
9. The spectral image of the object to be measured and the reflectance threshold value for the spectral image are stored as training data, and a threshold derivation model is generated that outputs the reflectance threshold value in response to an input of the spectral image of a new object to be measured. The spectroscopic analysis method according to claim 1 .
10. an image acquisition unit that acquires spectral images of the object to be measured for a plurality of spectral wavelengths; a spectrum calculation unit that extracts a spectrum of each pixel from the spectral image corresponding to the plurality of spectral wavelengths and calculates a reflectance of each pixel; a threshold value determination unit that determines a reflectance threshold value for distinguishing between a pixel that does not need to be analyzed and a pixel that is to be analyzed based on the reflectance of each pixel; a pixel classifying unit that classifies the plurality of pixels into pixels not requiring analysis and pixels to be analyzed based on the reflectance threshold; an analysis unit that performs spectroscopic analysis of the object to be measured based on the analysis target pixel; A spectroscopic analysis device comprising:
Citation Information
Patent Citations
Recycle resin determination system and manufacturing apparatus of recycled resin material
JP2014098555A