Infrared analysis method for traditional Chinese medicine powder based on image recognition
Through the frequency separation and multi-scale edge feature analysis of the infrared spectral image of traditional Chinese medicine powder, the problem of blurred boundary information in the particle image in the prior art is solved, and the precise identification of traditional Chinese medicine powder particles and efficient extraction of core components are achieved.
Patent Information
- Application Number
- CN202511074197.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-08-01
AI Technical Summary
In the prior art, image recognition captures structural features mostly rely on image local feature extraction from fixed scales or single perspectives, resulting in the problem of blurred boundary information and discontinuous local responses in particle images. Especially in the case of strong interference textures or uneven particle size distribution, high-response feature error judgments or core area omissions often occur.
Using the infrared analysis method of Chinese medicine powder based on image recognition, the infrared spectrum of Chinese medicine powder is separated by frequency separation, the particle edge intensity values in each frequency layer are integrated, the local information entropy and local contrast of the cell neighborhood are calculated, and the multi-scale particle edge map is generated, and the connected cell clusters are identified above the fixed segmentation threshold through the combined operation and spatial reconstruction of the significant area map map, and the core component area of the Chinese medicine powder is extracted.
It enhances the precise recognition ability of particle contour boundaries, improves the expression stability and contrast sensitivity of image features, ensures the spatial correlation and recognition confidence of component areas, and improves the accuracy of component discrimination under complex background conditions.
Smart Images

Figure CN120581090A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to an infrared analysis method for traditional Chinese medicine powder based on image recognition. Background Art
[0002] Image recognition refers to the technical process of using computers to automatically detect, analyze and understand images in order to identify features, structures, targets or patterns in images. It is an important branch that intersects artificial intelligence and computer vision.
[0003] Existing image recognition techniques for capturing structural features often rely on extracting local features from images at a fixed scale or from a single perspective. This can lead to blurred boundary information and discontinuous local responses in particle images. This is particularly true when processing images with strong interfering textures or uneven particle size distribution. This can lead to recognition errors such as misjudging highly responsive features or missing core regions. Therefore, improvements are needed. Summary of the Invention
[0004] The purpose of the present invention is to solve the shortcomings of the prior art and to propose an infrared analysis method for traditional Chinese medicine powder based on image recognition.
[0005] In order to achieve the above object, the present invention adopts the following technical solution, which is a method for infrared analysis of traditional Chinese medicine powder based on image recognition, comprising the following steps: Frequency separation is performed on the infrared spectrum image of traditional Chinese medicine powder, and the edge intensity values used to characterize the contours of traditional Chinese medicine powder particles in each frequency layer are integrated to obtain a multi-scale particle edge atlas; For each single-scale edge map in the multi-scale particle edge atlas, calculating the local information entropy and local contrast of the pixel neighborhood to obtain pixel statistical feature data, and performing a combination operation based on the pixel statistical feature data to generate an intra-scale significant area atlas; Reading the salient region atlas within the scale, projecting each single-scale salient region map to the unified spatial coordinates of the original infrared spectrum image of the traditional Chinese medicine powder to obtain an aligned spatial feature set, and generating a fused salient localization map based on the aligned spatial feature set; The fused significant positioning map is analyzed, a fixed segmentation threshold is set, connected pixel clusters above the fixed segmentation threshold are identified, and an initial candidate region set is obtained. Based on the initial candidate region set, judgment and screening are performed against the preset lower limit of the number of pixels in the region to extract and calibrate the core component area of the traditional Chinese medicine powder.
[0006] Preferably, the steps of obtaining the multi-scale particle edge atlas are: Read the infrared spectrum image of traditional Chinese medicine powder and perform frequency separation on it. The separation process uses a fixed frequency division standard to proportionally divide the frequency domain range and extract the corresponding frequency information to generate a multi-frequency layer image set; Based on the multi-frequency layer image set, extracting the edge regions of the Chinese medicine powder particles shown in each frequency layer image, performing edge gradient calculation on the edge regions of the Chinese medicine powder particles and counting the edge gradient values, characterizing the edge gradient values as edge intensity values, and generating a set of Chinese medicine powder particle edge intensity maps; Based on the traditional Chinese medicine powder particle edge intensity map set, the edge intensity maps are rearranged according to the frequency layer division standard and a multi-scale matching index is established. The edge intensity maps of each frequency layer are fused to generate a unified structure atlas, thereby generating a multi-scale particle edge atlas.
[0007] Preferably, the steps of obtaining the pixel statistical feature data are: Reading each single-scale particle edge map in the multi-scale particle edge map set one by one, determining the position coordinates of the pixels to be analyzed one by one for the single-scale particle edge map, locating the local neighborhood range corresponding to the coordinates of the pixels to be analyzed, intercepting all pixel values within the local neighborhood range, and generating a value set of the neighborhood area of the pixels to be analyzed; Based on the value set of the neighborhood area of the pixel to be analyzed, the probability distribution of the occurrence of each pixel value in the neighborhood area is calculated one by one, and the uncertainty of the value distribution in the neighborhood area of the pixel is calculated one by one according to the probability distribution, and the information entropy value of the neighborhood area of the pixel to be analyzed is obtained to generate a pixel local information entropy set; Based on the value set of the neighborhood area of the pixel to be analyzed, the absolute value of the difference between the value of the central pixel in the neighborhood area and the values of other pixels in the neighborhood is calculated one by one, and the absolute values of the differences are summarized to quantify the degree of value change in the neighborhood, and the local contrast value of the neighborhood area of the pixel to be analyzed is obtained. The pixel local information entropy set and the local contrast value are integrated to form the pixel statistical feature data.
[0008] Preferably, the steps of obtaining the atlas of salient regions within the scale are: Based on the pixel statistical feature data, the position coordinates of all pixels in each single-scale particle edge image are sequentially read, and the corresponding local information entropy and local contrast are linearly normalized according to their respective minimum and maximum values to obtain a normalized local information entropy map and a normalized local contrast map of each image; Calculate the fusion response intensity value of each pixel according to the normalized local information entropy map and the normalized local contrast map; Pixel connectivity is judged based on a fusion response intensity map formed by the fusion response intensity values, and whether adjacent boundary areas should be merged is judged based on the fusion response intensity values to generate an intra-scale salient area atlas.
[0009] Preferably, the steps of obtaining the alignment space feature set are: Reading the atlas of significant regions within the scale, sequentially parsing the significant region boundary coordinate information and image resolution parameters in each single-scale significant region map, converting the significant region boundary coordinates in each map into the spatial scale unit corresponding to the original infrared spectrum image of the traditional Chinese medicine powder, and generating the original coordinate scale mapping result; According to the original coordinate scale mapping result, the region contour information of each single-scale salient region map that has been converted to the original coordinate system is superimposed into a unified image space to form a region alignment superposition map at a unified scale; Based on the regional alignment overlay map under the unified scale, all coordinate points in the original infrared spectrum image of traditional Chinese medicine powder are traversed, and the regional response relationship corresponding to each coordinate point in different single scales is marked and extracted to generate an alignment space feature set.
[0010] Preferably, the steps of obtaining the fused salient localization map are: Read the aligned spatial feature set, extract the fused response intensity value for each pixel position in the salient region map at each scale, traverse the fused response intensity values of the same coordinate points in all scale images and mark them as a multi-scale response sample set to form a coordinate-normalized multi-scale fused response set; Calculating a composite intensity value for each pixel according to the multi-scale fusion response set; Based on the composite intensity value, the upper and lower limits of the significance threshold interval are set, and pixels above the upper limit are selected as significant concentrated core points and the region is expanded. The boundaries of adjacent response regions at different scales are fused to construct a closed contour region and generate a fused significant positioning map.
[0011] Preferably, the steps of obtaining the initial candidate region set are: Read the fused saliency positioning map, iterate over the composite intensity values corresponding to each pixel position in the fused saliency positioning map one by one, count the numerical distribution of the composite intensity values of all pixel positions in the fused saliency positioning map, calculate the median of the overall distribution of the composite intensity values as a fixed segmentation threshold, and obtain the fixed segmentation threshold; According to the fixed segmentation threshold, all pixel positions in the fused salient localization map are traversed to determine whether the composite intensity value at each pixel position exceeds the fixed segmentation threshold, and pixel positions exceeding the fixed segmentation threshold are marked as valid salient positions. All valid salient positions are merged and marked in a binary mask image to generate a binary salient mask map; According to the binary saliency mask map, pixel connectivity analysis is performed on all valid saliency positions to identify groups of valid saliency positions that are adjacent to each other and continuously distributed in space, and the boundary contours of the connected regions are drawn to form an initial set of candidate regions.
[0012] Preferably, the steps for obtaining the core component region of the traditional Chinese medicine powder are: Reading the initial candidate region set, counting the total number of pixels at valid significant positions contained in each candidate region in the initial candidate region set, recording the counted total number of pixels as the effective pixel number of the region, and forming a candidate region pixel number list; According to the candidate area pixel number list, comparing each candidate area with a preset lower limit of the number of pixels of the area to determine whether the number of effective pixels in the area reaches or exceeds the lower limit of the number of pixels, retaining the candidate areas that reach or exceed the lower limit of the number of pixels, removing the candidate areas below the lower limit of the number of pixels, and generating a subset of qualified candidate areas; According to the qualified candidate region subset, the boundary coordinates of each qualified candidate region are parsed and marked, the position of the region center point is determined, and the region boundary outline is drawn in the original traditional Chinese medicine powder infrared spectrum image to generate the traditional Chinese medicine powder core component area.
[0013] Compared with the prior art, the advantages and positive effects of the present invention are: The present invention performs frequency separation and particle edge extraction operations on the infrared spectrum image of traditional Chinese medicine powder, integrates the edge intensity features in different frequency layers, can realize multi-scale perception of microstructure, and enhance the ability to accurately identify the boundary of particle contour; on this basis, the uncertainty and variation amplitude of the pixel neighborhood are measured by the joint statistical index of local information entropy and local contrast, thereby improving the expression stability and contrast sensitivity of image features; further converts the multi-scale features into a significant response map, ensures the consistency of features between scales and reduces the influence of local interference noise; maps each scale response map to a unified spatial coordinate and then performs spatial reconstruction, so that the significant information of different scales is fused into a composite feature of continuous distribution across scales, thereby strengthening the spatial correlation and recognition confidence of the component region; identifies the connected pixel cluster with the help of a fixed segmentation threshold and combines the regional pixel lower limit filtering rule to complete the core area extraction, thereby improving the performance of the recognition result in terms of structural integrity and physical authenticity. In summary, the present invention not only improves the sensitivity of structure recognition, but also enhances the accuracy of component discrimination under complex background conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 Schematic diagram of the steps of the present invention. DETAILED DESCRIPTION
[0015] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0016] See also Figure 1 The present invention provides a technical solution, a method for infrared analysis of traditional Chinese medicine powder based on image recognition, comprising the following steps: Frequency separation is performed on the infrared spectrum image of traditional Chinese medicine powder, and the edge intensity values used to characterize the contours of traditional Chinese medicine powder particles in each frequency layer are integrated to obtain a multi-scale particle edge atlas; For each single-scale edge map in the multi-scale particle edge atlas, the local information entropy and local contrast of the pixel neighborhood are calculated to obtain the pixel statistical feature data. Based on the pixel statistical feature data, a combination operation is performed to generate an atlas of significant areas within the scale. Read the salient region atlas within the scale, project each single-scale salient region map to the unified spatial coordinates of the original infrared spectrum image of traditional Chinese medicine powder, obtain the aligned spatial feature set, and generate a fused salient localization map based on the aligned spatial feature set; Analyze and fuse the salient localization map, set a fixed segmentation threshold, identify connected pixel clusters above the fixed segmentation threshold, and obtain the initial candidate region set. Based on the initial candidate region set, judge and screen against the preset lower limit of the number of pixels in the region, and extract and calibrate the core component area of the traditional Chinese medicine powder.
[0017] The steps to obtain the multi-scale particle edge atlas are: Read the infrared spectrum image of traditional Chinese medicine powder and perform frequency separation on it. The separation process uses a fixed frequency division standard to proportionally divide the frequency domain range and extract the corresponding frequency information to generate a multi-frequency layer image set; Based on a multi-frequency layer image set, the edge regions of the Chinese medicine powder particles shown in each frequency layer image are extracted, edge gradient calculations are performed on the edge regions of the Chinese medicine powder particles, and the edge gradient values are counted. The edge gradient values are used as edge intensity values to represent the edge intensity maps of the Chinese medicine powder particles. Based on the edge intensity map collection of traditional Chinese medicine powder particles, the edge intensity maps are rearranged according to the frequency layer division standard and a multi-scale matching index is established. The edge intensity maps of each frequency layer are fused to generate a unified structure atlas and a multi-scale particle edge atlas.
[0018] Specifically, the infrared spectrum image of the Chinese herbal medicine powder is read. The image is usually digital image data containing spatial dimension information and infrared spectrum information corresponding to each spatial point. The infrared spectrum image of the Chinese herbal medicine powder is subjected to frequency separation. Specifically, the two-dimensional discrete wavelet transform (2D-DWT) is used to implement this frequency separation process. The fixed frequency division standard of the process includes the selected wavelet mother function type and the number of decomposition layers. For example, "Daubechies4" (db4) is selected as the wavelet mother function because it has good time-frequency localization characteristics and a certain smoothness, which can better characterize the edge and texture information of the Chinese herbal medicine powder particles. The setting of the number of decomposition layers, for example, setting it to 3 layers, is based on the prior analysis or experimental evaluation of the sample characteristics. The specific setting process is: first, a batch of representative infrared spectrum images of Chinese herbal medicine powder (for example For example, 20 images are used for preliminary analysis to measure the average size of the particles of interest, for example, the average particle occupies a diameter of about 10 to 15 pixels at the current image resolution. Then, different decomposition levels (for example, from 1 to 5 levels) are used to conduct trial decomposition of these images, and the clarity and noise level of the particle features in the detail sub-band images of each level are observed. The optimal decomposition level is determined by calculating the contrast between the signal and background noise in a specific particle area, or by evaluating the performance of the subsequent edge extraction algorithm on the decomposition results at different levels. For example, if it is found that 3-level decomposition can clearly show the outline of the target particles in most detail sub-bands, and the noise introduced by decomposition with a higher number of levels (such as 4 or 5 levels) begins to mask the particle details or cause a significant decrease in the signal-to-noise ratio (for example, a signal-to-noise ratio threshold of 10 decibels is defined and calculated by the formula Conduct an assessment, where is the root mean square value of the particle area signal, is the root mean square value of the noise in the adjacent background area. When the average signal-to-noise ratio obtained by 3-layer decomposition is 15 dB, and the 4-layer decomposition is reduced to 8 dB), 3 layers are determined as the number of decomposition layers for the fixed frequency division standard. In the 2D discrete wavelet transform process, the image is decomposed into a low-frequency approximate subband image (LL) and three high-frequency detail subband images at each level, corresponding to the frequency information in the horizontal (HL), vertical (LH) and diagonal (HH) directions respectively. This decomposition method naturally divides the 2D spatial frequency domain range of the image proportionally. Each layer of decomposition roughly halves the frequency band, thereby extracting frequency information of different scales and directions. Ultimately, all these detail subband images of different levels and directions and the approximate subband image of the last layer together constitute a multi-frequency layer image set.
[0019] Based on the multi-frequency layer image set generated in the previous step, further processing is performed to extract edge information. The specific operation is to traverse each frequency layer image in the multi-frequency layer image set. For example, for a high-frequency detail sub-band image representing a specific scale and direction, first identify and extract the edge area of the Chinese medicine powder particles appearing in the image. This step can directly process the entire sub-band image. For example, the particle edge has sufficient contrast in the sub-band image. Subsequently, for each pixel position, an edge gradient operation is performed. This operation is implemented using the Sobel operator. Specifically, for any pixel in the frequency layer image, , calculate its horizontal gradient component through convolution operation and the vertical gradient component , the convolution kernel is Sobel kernel, horizontal Sobel kernel for , used to detect vertical edges, vertical Sobel kernel for , used to detect horizontal edges, obtained after convolution operation and Respectively represent the intensity change rate of the pixel in the horizontal and vertical directions. Then, the gradient amplitude of the pixel is calculated based on these two gradient components. The calculation formula is: , this gradient amplitude It is the edge gradient value obtained by statistics, which reflects the intensity of the edge at the pixel position. The larger the value, the more significant the edge. Finally, the edge gradient value calculated for each pixel, that is, the gradient amplitude, is directly used as the edge intensity value of the pixel to represent it, thereby generating a corresponding edge intensity map of Chinese medicine powder particles for the frequency layer image currently being processed, in which the grayscale value of each pixel is its edge intensity value. The complete process of edge area extraction, edge gradient calculation, edge gradient value statistics and edge intensity value representation is executed for all images in the multi-frequency layer image set, and finally all the generated single frequency layer edge intensity maps are collected to form a set of Chinese medicine powder particle edge intensity maps.
[0020] Based on the previously obtained set of edge intensity maps of Chinese medicine powder particles, we start to rearrange, index and integrate them. First, we rearrange them according to the frequency layer division standard that generates these edge intensity maps. The frequency layer division standard here directly corresponds to the decomposition level and direction of the two-dimensional discrete wavelet transform defined in the first step. For example, if a three-layer wavelet decomposition is used, it will produce The edge intensity maps corresponding to the detail subbands (LL layers are usually not used for direct edge analysis, but if included, there will be more) can be arranged in order from the coarsest scale (corresponding to the lowest frequency details, such as the HL3, LH3, HH3 subband maps of the 3rd layer decomposition) to the finest scale (corresponding to the highest frequency details, such as the HL1, LH1, HH1 subband maps of the 1st layer decomposition). Within the same scale, they can be sorted by direction (such as horizontal, vertical, diagonal). After the arrangement is completed, a multi-scale matching index is established for each edge intensity map. The index is a structured identifier that uniquely refers to the edge intensity map and its characteristics at each scale. For example, the index can be a tuple containing the level number and direction information, such as (3, 'HL'), (3, 'LH'), (3, 'HH'), (2, 'HL'), ..., (1, 'HH'). This ensures that each edge intensity map has a clear and programmatically accessible identity. The specific implementation method is to create a lookup table or data structure to associate these indexes with the corresponding edge intensity map data. For example, set an index rule: ,in is the decomposition level (e.g. 1, 2, 3), is the number of directions per level (usually 3: HL, LH, HH), For direction coding (e.g. HL is 1, LH is 2, HH is 3), if the number of decomposition levels is 3, then the HL directional pattern index of the lowest frequency detail layer (level 3) is , the HH pattern index of the highest frequency detail layer (level 1) is , and store or reference the edge intensity map according to this rule. Subsequently, the edge intensity maps of each frequency layer are integrated to generate a unified structure atlas, which means that all arranged and indexed edge intensity maps are organized into a standardized data container or set. The container ensures that all maps are spatially aligned. If the sub-band images generated by the original wavelet decomposition have different sizes, then after generating the edge intensity map or at this step, all edge intensity maps need to be unified to a common reference resolution by upsampling (such as using bicubic interpolation) or downsampling, usually the resolution of the original Chinese medicine powder infrared spectrum image, to ensure that edge information of different scales can be compared and analyzed in the same spatial coordinate system. This unified structure atlas itself is the final generated multi-scale particle edge atlas.
[0021] The steps to obtain pixel statistical feature data are as follows: Read each single-scale particle edge map in the multi-scale particle edge map set one by one, determine the position coordinates of the pixels to be analyzed one by one for the single-scale particle edge map, locate the local neighborhood range corresponding to the coordinates of the pixels to be analyzed, intercept all pixel values within the local neighborhood range, and generate a value set of the neighborhood area of the pixels to be analyzed;
[0022] Based on the value set of the neighborhood area of the pixel to be analyzed, the probability distribution of the value of each pixel in the neighborhood area is calculated one by one, and the uncertainty of the value distribution in the neighborhood area of the pixel is calculated one by one according to the probability distribution, and the information entropy value of the neighborhood area of the pixel to be analyzed is obtained to generate the local information entropy set of the pixel; Based on the numerical value set of the neighborhood area of the pixel to be analyzed, the absolute value of the difference between the central pixel value in the neighborhood area and the values of other pixels in the neighborhood is calculated one by one, and the absolute values of the differences are summarized to quantify the degree of numerical change in the neighborhood, and the local contrast value of the neighborhood area of the pixel to be analyzed is obtained. The pixel local information entropy set and the local contrast value are integrated to form the pixel statistical feature data.
[0023] Specifically, each single-scale particle edge map in the multi-scale particle edge atlas is read one by one. The specific operation is to select a single-scale particle edge map from the atlas in a predetermined order (for example, in the order of the multi-scale matching index) for processing, and then determine the position coordinates of each pixel to be analyzed one by one by systematically scanning each pixel in the image for the currently selected single-scale particle edge map. ,in Represents the horizontal coordinate of the pixel, Represents the vertical coordinate of the pixel. For each determined pixel position coordinate to be analyzed, the corresponding local neighborhood range is then located. The local neighborhood range is defined as a square window of fixed size centered on the pixel to be analyzed. Its size, such as width and height, is Pixels are preset to 5 pixels, which constitute a Pixel neighborhood, this The setting of is based on the following: by analyzing a calibration dataset containing 50 representative single-scale particle edge maps at different scales, the different window sizes (e.g. ) for distinguishing the effectiveness of subsequent features extracted under the condition of , such as local information entropy and local contrast, in distinguishing the core area of the particle from the background area. The evaluation index can be the statistically significant difference in the feature distribution of the two types of regions (for example, using a two-sample t-test, a p-value less than 0.05 is considered significant) or the classification accuracy of a simple classifier (such as a nearest neighbor classifier). The window achieves the best balance between providing enough local information to calculate stable eigenvalues and maintaining the spatial location accuracy of features, while its computational load is relatively low compared to larger windows (such as ) is lower, and the feature discrimination ability is significantly better than that of smaller windows (such as ), then select , after determining the pixel to be analyzed After localizing the neighborhood, all the particles in this neighborhood are accurately intercepted from the edge map of the single-scale particle. These values together form the value set of the neighborhood area of the pixel to be analyzed.
[0024] Based on the value sets of the neighborhood areas of each pixel to be analyzed obtained in the previous process, the probability distribution of the values of each pixel in its neighborhood area (i.e., edge strength value) is calculated one by one for each such set (corresponding to a pixel to be analyzed). Specifically, for a pixel containing A set of pixel values in the neighborhood of the pixel to be analyzed (for example, neighborhood, ), first determine the dynamic range of these values, usually the range of edge intensity values is 0 to 255 (for example, for 8-bit image data), and then divide this range into equal-width intervals (the "boxes" of the histogram), The value of is preset to 16. This number is chosen based on the following considerations: in a neighborhood with 25 sample points, choosing 16 boxes can reflect the distribution of values in a certain degree of detail, while avoiding the instability of probability estimation caused by too many boxes resulting in too few samples in each box. For example, if 16 boxes are selected, each box covers Gray levels are calculated by counting the frequency of pixel values that fall into each interval in the neighborhood, and then dividing the frequency of each interval by the total number of pixels in the neighborhood. , and obtain the probability of occurrence of each numerical interval ,in From 1 to According to this probability distribution, the uncertainty of the numerical distribution in the neighborhood of the pixel is calculated one by one, that is, the information entropy value. Calculated by the following formula: ,in, It is The probability of occurrence of a numerical interval is calculated, and the information entropy value calculated for each pixel to be analyzed is stored to form a pixel local information entropy set covering the entire single-scale particle edge map.
[0025] Based on the previously generated set of values for the neighborhood of the pixel to be analyzed, another statistical feature, local contrast, is calculated. The calculation process is as follows: First, the edge strength value of the pixel at the center of the neighborhood (that is, the pixel to be analyzed currently) is identified from the set of values for the neighborhood of the pixel to be analyzed, which is recorded as Then, read the edge intensity values of all pixels in the neighborhood except the central pixel one by one, and record them as ,in Represents the indices of the non-center pixels in the neighborhood. For each , calculate its value with the center pixel The absolute value of the difference between After completing the calculation of the absolute value of the difference between all non-central pixels and the central pixel in the neighborhood, these absolute values of the differences are summarized. The specific summary method is to calculate the average value of the absolute values of these differences to quantify the degree of value change or texture complexity in the neighborhood. For example, in a In the neighborhood of , the central pixel has 24 adjacent pixels, then the local contrast Calculated as the average of the absolute values of these 24 differences, that is, , this calculated The value is the local contrast value of the neighborhood area of the pixel to be analyzed. The local contrast value calculated for each pixel to be analyzed is stored to form a local contrast value set covering the entire single-scale particle edge map. Finally, the pixel local information entropy set generated in the previous step and the local contrast value set generated in the current step are integrated. The specific method is to pair the corresponding local information entropy value and local contrast value for each pixel position in the image to form a two-dimensional or multi-dimensional feature vector. The feature vector sets of all these pixels together constitute the pixel statistical feature data of the single-scale particle edge map.
[0026] The steps to obtain the atlas of salient regions within the scale are: Based on the pixel statistical feature data, the position coordinates of all pixels in each single-scale particle edge map are read in sequence, and the corresponding local information entropy and local contrast are linearly normalized according to their respective minimum and maximum values to obtain the normalized local information entropy map and normalized local contrast map of each image; According to the normalized local information entropy map and the normalized local contrast map, the fusion response intensity value of each pixel is calculated. The calculation formula is: ; in, For location The fusion response strength value at is the normalized local information entropy value, is the normalized local contrast value, is the absolute value of the difference between the two values, Used to control the range of the fusion base, the overall value range is kept at Inside; Based on the fusion response intensity map composed of the fusion response intensity values, pixel connectivity is judged, and whether to merge adjacent boundary areas is determined based on the fusion response intensity values to generate an atlas of significant areas within the scale.
[0027] Specifically, based on the pixel statistical feature data, which contains the local information entropy and local contrast values calculated for each pixel in each single-scale particle edge map, the operation process is first to read the single-scale particle edge map in sequence, and for all the pixel position coordinates in the map, extract the corresponding local information entropy value set and local contrast value set, and perform linear normalization transformation on these two types of values. Specifically for the local information entropy, first traverse the local information entropy values of all pixels in the current single-scale particle edge map to find the minimum value. and maximum value For example, in a picture containing thousands of pixels, the lowest recorded local information entropy value is 0.8 and the highest is 4.2. , , then, the original local information entropy value of each pixel in the image is , through the formula ( ) / ( ) Calculate the normalized local information entropy value ,like and If the local information entropy values of all pixels in the image are the same, the normalized local information entropy values of all pixels are uniformly set to a fixed value, such as 0.5. In the above example, if the local information entropy values of a pixel are the same, is 2.5, then its Calculated as ( ) / ( ),Right now Similarly, the local contrast values of all pixels in the single-scale particle edge map are subjected to the same linear normalization process, that is, the minimum value of the local contrast value in the map is found. and maximum value , and the original local contrast value of each pixel Apply the formula ( ) / ( ) to calculate the normalized local contrast value , ensuring that all normalized local information entropy values and local contrast values are strictly in the closed interval from 0 to 1. This process generates the corresponding normalized local information entropy map and normalized local contrast map for the single-scale particle edge map currently being processed.
[0028] formula: The benefit of the formula is that it incorporates the normalized local information entropy in a nonlinear way. and local contrast Two features are designed to more robustly identify salient regions in images. Specifically, the numerator This shows that the contributions of information entropy and contrast to saliency are cumulative, that is, when both are high, saliency is also high, and the denominator The fusion process is adaptively adjusted. and When the difference in values is large, the denominator will increase, thus affecting the fusion response strength value. This produces an inhibitory effect, which helps to balance the situation when the two features are quite different, and avoids a single feature being too high and dominating the significance judgment. When the two values are close, the denominator is relatively small, and the fusion response strength value is mainly determined by the numerator, reflecting the consistency contribution of the features. The structure and square root operation This makes the denominator's response to the difference smoother and more bounded, avoiding the problem of division by zero or too large a denominator, and ultimately the overall square root operation This further adjusts the distribution of the response values and helps to Value constraints in The proposed method is within the range of 0.05, which makes it have probability-like interpretability and improves the accuracy and robustness of locating the core area of Chinese medicine powder particles.
[0029] parameter The steps to obtain are: parameter Represents the edge of a single-scale particle, located at the spatial coordinate The pixel at , its corresponding normalized local information entropy value, which is directly derived from the "normalized local information entropy map" obtained by linear normalization transformation of the original local information entropy map in the previous step. Linear normalization ensures that The value range is For example, for a specific single-scale particle edge map, first calculate the local information entropy values of all pixels in the map to obtain an original local information entropy set, and then determine the minimum value in this set and maximum value , then for any pixel The original local information entropy value , its normalized value The calculation formula is ,like ,but Set to 0.5, taking the actual value as an example, if the minimum value of the original local information entropy value of all pixels in a single-scale particle edge map is is 1.2, the maximum value is 4.0, then for an original local information entropy value The normalized local information entropy value of the pixel Calculated as , so in this example, .
[0030] parameter The steps to obtain are: parameter Represents the edge of the particle at the same single scale, located at the spatial coordinate The pixel at , its corresponding normalized local contrast value, the value is obtained in the same way as Completely consistent, it comes directly from the "normalized local contrast map" obtained by linearly normalizing the original local contrast map in the previous step. Linear normalization also ensures that The value range is For example, for a specific single-scale particle edge map, first calculate the local contrast values of all pixels in the map to obtain an original local contrast set, and then determine the minimum value in this set. and maximum value , then for any pixel The original local contrast value , its normalized value The calculation formula is ,like ,but Set to 0.5. Taking the actual value as an example, if the minimum value of the original local contrast value of all pixels in the single-scale particle edge map is is 0.1, the maximum value is 0.9, then for an original local contrast value The normalized local contrast value of the pixel Calculated as , so in this example, .
[0031] Calculation process: For a specific pixel position in a single-scale particle edge map , its fusion response intensity value The calculation process is as follows: First, obtain the normalized local information entropy value of the pixel and normalized local contrast value , According to the example of the above parameter acquisition steps, set and , calculate and sum: ; calculate and Absolute value of the difference: ; Calculate the square root of this absolute value: ; Calculate the adjustment term in the denominator: ; Calculate the full denominator: ; Calculate the ratio of the numerator to the denominator: ; Finally, the square root of the ratio is calculated to obtain the fusion response strength value. : ; This result shows that for the selected pixel location , its fusion response intensity value It is approximately 0.645, which is between 0 and 1. It represents the degree of significance or possibility that the pixel is part of the core component area of traditional Chinese medicine powder particles. The higher the value, the stronger the significance of the pixel position.
[0032] According to the previous step, the fused response intensity value of each pixel is calculated. These values together constitute the fused response intensity map corresponding to the single-scale particle edge map. Next, the fused response intensity map is processed. The core step of pixel connectivity judgment is to apply a threshold to segment the fused response intensity map and convert it into a binary image. The threshold is denoted as The setting method can be, for example, the Otsu automatic threshold method, which traverses all possible thresholds and selects the value that can maximize the inter-class variance of the two types of pixels (foreground and background) after segmentation as the optimal threshold. For example, for a fusion response intensity map (whose range is ) Using the Otsu method, we can calculate , then all pixels with fusion response intensity values greater than 0.62 are marked as foreground (potentially salient pixels, assigned a value of 1), and the remaining pixels are marked as background (non-salient pixels, assigned a value of 0), forming a binary saliency map. Subsequently, connected component analysis is performed on this binary saliency map to identify spatially connected clusters of foreground pixels. The connectivity rule usually chooses 8-connectivity, that is, if two foreground pixels are adjacent in the horizontal, vertical or diagonal direction, they belong to the same connected component. By scanning the binary saliency map, a unique label is assigned to each identified connected component. This process determines whether to merge spatially adjacent pixel regions that are all marked as foreground into an independent candidate region based on the fusion response intensity value (after thresholding). Each such connected component constitutes a preliminary salient region. The set of all these identified and marked connected components (i.e., preliminary salient regions) together constitutes the intra-scale salient region atlas of the single-scale granular edge map.
[0033] The steps to obtain the alignment space feature set are: Read the atlas of salient regions within the scale, analyze the salient region boundary coordinate information and image resolution parameters in each single-scale salient region map in turn, convert the salient region boundary coordinates in each map into the spatial scale unit corresponding to the original infrared spectrum image of traditional Chinese medicine powder, and generate the original coordinate scale mapping result; According to the original coordinate scale mapping result, the regional contour information of each single-scale salient region map that has been converted to the original coordinate system is superimposed into the unified image space to form a region alignment superposition map at a unified scale; Based on the regional alignment overlay map under a unified scale, all coordinate points in the original infrared spectrum image of traditional Chinese medicine powder are traversed, and the regional response relationship corresponding to each coordinate point in different single scales is marked and extracted to generate an alignment space feature set.
[0034] Specifically, the scale salient region atlas generated in the previous step is read. This atlas contains multiple single-scale salient region maps derived from different single-scale particle edge maps. Each single-scale salient region map contains several identified salient regions. The processing flow is to traverse each single-scale salient region map in this atlas in turn. For the currently selected single-scale salient region map, the boundary coordinate information of each independent salient region is first parsed. These boundary coordinates are usually expressed as a series of pixel position points that constitute the region outline. An ordered list of and is the row and column number of the single-scale salient region map in the coordinate system. At the same time, the image resolution parameter of the single-scale salient region map is obtained. This parameter mainly refers to its scale factor relative to the original infrared spectrum image of traditional Chinese medicine powder. The determination of this scale factor is based on the decomposition level of the single-scale map in the multi-scale decomposition process (for example, the wavelet transform used in the early step). For example, if the size of the original infrared spectrum image of traditional Chinese medicine powder is pixels, and the single-scale salient region map currently processed corresponds to the first layer, its size is reduced accordingly to , then its scale factor is Specifically, if the original image is Pixel, the current single-scale salient region map is the product of the third-level decomposition, and its size is pixels, the scale factor is After obtaining the boundary coordinates and scale factor, each boundary coordinate point of each salient area in the single-scale salient area map is Converted to the coordinates of the spatial scale unit corresponding to the original infrared spectrum image of traditional Chinese medicine powder , the conversion method is and , (for example, the image origin is the upper left corner, and there is no other translation or rotation transformation), after completing the transformation of all boundary coordinates of all salient regions in the current single-scale salient region map, these transformed coordinate information are recorded. This complete set of data containing the transformed boundary coordinates of all single-scale maps constitutes the original coordinate scale mapping result.
[0035] According to the original coordinate scale mapping result generated in the previous step, the result contains the boundary coordinate information of all salient regions extracted from each single-scale salient region map and converted to the original Chinese medicine powder infrared spectrum image coordinate system. The next operation is to superimpose these converted region contour information into a unified image space. This unified image space is a space with the same size as the original Chinese medicine powder infrared spectrum image (for example, if the original image is pixels, then the unified image space is also Pixels) and a two-dimensional digital canvas or accumulator array with the same spatial resolution. Before the superposition process begins, the unified image space is usually initialized to all zero values. Then, each set of region contour information from the original coordinate scale mapping result (that is, the boundary pixel coordinate set corresponding to a significant area in a single-scale significant area map that has been converted to the original coordinate system) is processed in turn. For each such region contour, the corresponding pixel position in the unified image space is marked. There are many ways to mark it. A simple way is to mark all the pixels that constitute the contour boundary after conversion in the unified image space. The value of the corresponding position is added by one. In this way, if multiple contour boundaries from different scales or different regions coincide or are adjacent to the same position in the original image, the value of the position will be accumulated accordingly. Another way is to project each salient region (not just its contour) to a corresponding layer of the unified image space or fill it with different label values. If overlay contours are selected, after processing all salient region contours in all single-scale salient region maps, the values of some pixels in the unified image space will indicate how many salient region contours of different scales pass through this point, thereby forming a region-aligned overlay map at a unified scale.
[0036] Based on the unified scale regional alignment overlay formed in the previous step, the overlay records the outlines of all single-scale significant regions or the position information of the region itself in the original Chinese medicine powder infrared spectrum image space, and begins to extract the regional response relationship of each coordinate point. The specific operation is to systematically traverse each coordinate point in the original Chinese medicine powder infrared spectrum image. , for the coordinate point currently traversed , it is necessary to determine the regional response relationship corresponding to each different single scale. This regional response relationship refers to the determination of the coordinate point Whether it falls into the salient region previously identified and mapped from each single-scale salient region map, in order to achieve this judgment, it is necessary to refer to the construction of the original coordinate scale mapping result, which not only converts the boundary coordinates but also retains the attribution scale information of each salient region and its complete regional range in the original coordinate system (for example, by determining the pixels inside the region through the polygon filling algorithm), or refer to the regional alignment overlay map at a unified scale (if the map is a multi-layer structure, each layer represents a salient region binary map at a scale), for each single scale (for example, scale ), check the coordinate points Is it within this scale? If it is in any significant area under the scale The response is "significant" (for example, represented by a value of 1), otherwise it is "non-significant" (for example, represented by a value of 0). After this judgment is performed on all single scales, each coordinate point A response vector will be obtained, each dimension of which represents its response state in the corresponding single scale. By combining these multi-scale response vectors of all coordinate points, an alignment space feature set is formed.
[0037] The steps to obtain the fused salient localization map are: Read the aligned spatial feature set, extract the fused response intensity value for each pixel position in the salient region map at each scale, traverse the fused response intensity values of the same coordinate points in all scale images and mark them as a multi-scale response sample set to form a multi-scale fused response set with normalized coordinates; According to the multi-scale fusion response set, the composite intensity value of each pixel is calculated using the following formula: ; in, For coordinates The composite strength value at For the Coordinates at different scales The fusion response strength value, is the spatial gradient modulus of the pixel corresponding to the coordinate point in the original infrared spectrum image of traditional Chinese medicine powder, is the global average gradient modulus of the image, Prevent division by zero for the empirical coefficient and fine-tune the denominator smoothness. is the number of scales of the salient region map; Based on the composite intensity value, the upper and lower limits of the significance threshold interval are set, and pixels above the upper limit are selected as significant concentration core points and the region is expanded. The boundaries of adjacent response areas at different scales are fused to construct a closed contour area and generate a fused significant positioning map.
[0038] Specifically, read the alignment space feature set generated in the previous step. This feature set is each coordinate point in the original infrared spectrum image of traditional Chinese medicine powder. The corresponding regional response relationship in each different single scale is marked (for example, a vector indicating whether the point belongs to the significant area of each scale). Next, in order to form a multi-scale fusion response set with the coordinates normalized, it is necessary to perform a multi-scale fusion on each coordinate point of the original infrared spectrum image of the Chinese medicine powder. , obtain its The fusion response intensity value under ,These The value is calculated in the earlier step. Specifically, before generating the "intra-scale salient area atlas", a "fusion response intensity map" was calculated for each single-scale particle edge map, which contains the fusion response intensity value of each pixel. Here, these stored "fusion response intensity maps" corresponding to each scale (these maps have been aligned with the coordinate space of the "original Chinese medicine powder infrared spectrum image" through their "image resolution parameters" in the previous step, or aligned and read according to these parameters in this step) need to be used for data extraction. The specific operation is to extract the data for any coordinate point in the original Chinese medicine powder infrared spectrum image. , iterate over all scales (where is the total number of scales. For example, if three wavelet decomposition levels are used and the detail subbands of each level are processed, then Possibly or determined according to the actual number of scale diagrams selected), in the scales ( From 1 to ) in the corresponding (aligned) fusion response intensity map, read the coordinate point Fusion response strength value , put this Fusion response strength value Collected together, this value set is the coordinate point The multi-scale response sample set is extracted and collected for all coordinate points in the original infrared spectrum image of traditional Chinese medicine powder, and finally the multi-scale response sample set of all coordinate points is collected to form a multi-scale fusion response set with normalized coordinates.
[0039] formula: The benefit of the formula is that it combines multi-scale information and local structural information of the original image to calculate a more robust composite saliency strength. The first part By averaging the squares of the fused response strength values at each scale, the significant contributions from different scales are effectively integrated. The square operation enhances the weight of the stronger response, while the average considers the overall performance of all scales. Part II The gradient information of the original image is introduced as the modulation factor, where is the local gradient modulus of the current pixel, is the global average gradient modulus, which enhances the composite intensity at the edge of the image or in texture-rich areas (where the gradient value is relatively high), but has little effect in smooth areas (where the gradient value is relatively low). The addition of ensures the stability of the denominator, and the square root of the product of the two parts is taken to balance the multi-scale consistency response and the local image structure characteristics, so as to more accurately locate the core component area of the traditional Chinese medicine powder and avoid the one-sidedness of a single scale or a single feature.
[0040] parameter The steps to obtain are: parameter Represents the coordinates of the original Chinese medicine powder infrared spectrum image Department, No. The fusion response intensity values at each scale are derived from the calculation and normalization of the edge map of each single scale particle in the previous step (usually the range is between ) and has been extracted and organized when forming the "multi-scale fusion response set with coordinate normalization", that is, for each coordinate point ,from Read the corresponding fusion response intensity map at different scales Values, for example, for coordinate points , if there are 3 scales ( ), whose fusion response strength value at scale 1 is , at scale 2 , at scale 3 , these values constitute the multi-scale fusion response strength required for this point in the formula.
[0041] parameter The steps to obtain are: parameter Represents the number of scales of the salient region map used for analysis. This number is fixed when the multi-scale decomposition strategy (such as the number of decomposition layers and direction selection of the wavelet transform) is determined. It corresponds to the total number of "single-scale particle edge maps" or "fused response intensity maps" actually generated in the previous step and used to extract the fused response intensity value. For example, if a three-layer wavelet transform is used and all detail subbands (horizontal, vertical, and diagonal) of each layer are selected for subsequent processing, then scales. In this example, set the number of scales .
[0042] parameter The steps to obtain are: parameter Indicates that in the original infrared spectrum image of traditional Chinese medicine powder, the coordinate point The spatial gradient modulus of the corresponding pixel is calculated by applying a gradient operator (such as the Sobel operator) to the original image. Specifically, for each pixel of the original image, use Sobel level kernel and vertical core Perform convolution to obtain the horizontal gradient components and the vertical gradient component , then the spatial gradient modulus , for example, for a pixel in the original image , if it is calculated by the Sobel operator and , then its spatial gradient modulus .
[0043] parameter The steps to obtain are: parameter Represents the global average gradient modulus of the original infrared spectrum image of traditional Chinese medicine powder. After calculating the spatial gradient modulus of each pixel in the image Finally, add up all these gradient moduli and divide by the total number of pixels in the image to get ,Right now ,in and are the height and width of the image, for example, The original image of the pixel, first calculate all The spatial gradient modulus of pixels, if the sum of these gradient moduli is , then the global average gradient modulus .
[0044] parameter The steps to obtain are: parameter It is an empirical coefficient, mainly used to prevent the global average gradient modulus from When the denominator is extremely small or zero, a division by zero error occurs, and the smoothness of the denominator is fine-tuned. Its value is usually selected based on experience or by testing a small number of representative sample images within a small range of parameters (such as 0.1 to 10) and evaluating the stability of the final result. Here, set This selection is based on testing on 20 infrared spectroscopic images of different Chinese herbal medicine powders. When the value is generally small (for example, less than 5), Can effectively avoid gradient terms Produces excessively large values while ensuring the effective introduction of gradient information.
[0045] Calculation process: Targeting specific pixel positions in the original infrared spectrum image of traditional Chinese medicine powder , its composite strength value The calculation process is as follows: According to the example of the parameter acquisition steps above, the parameter values are set as follows: ; For the current pixel , and its fusion response intensity values at three scales are , , , The spatial gradient modulus of the pixel in the original image , Global average gradient magnitude of the original image , Empirical coefficient , First, calculate the square mean of the multi-scale fusion response intensity values: ; ; ; ; Next, calculate the gradient modulation term: ; ; ; Then, multiply the two terms together: ; ; Finally, calculate the square root to get the composite strength value : ; This result shows that for the selected pixel location , its composite strength value It is about 1.149, which reflects the comprehensive significance of the pixel after combining the multi-scale significance response and its own gradient characteristics in the original image. Values are not constrained to The absolute size of the interval depends on the specific values of each input parameter. A value of 0 means that the pixel is more likely to belong to the core component area of traditional Chinese medicine powder, because it either shows a strong fusion response at multiple scales, or it is located in a structurally significant area of the image (such as an edge), or both. These composite intensity values will constitute a composite intensity map for subsequent threshold segmentation and region positioning.
[0046] The composite intensity value of each pixel calculated based on the previous step These values together constitute a composite intensity map covering the entire original Chinese medicine powder infrared spectrum image space. Next, this composite intensity map is processed to generate a fusion salient localization map. The processing process first sets the upper limit of the significance threshold interval. With lower limit ,The setting of these two thresholds is a key step.,For example, the composite intensity value calculated on a batch of (e.g., 30) representative images can be ,given. The statistical distribution of These can be set The 90th percentile of the value distribution is used to ensure that only pixels with very high composite intensity are selected as initial core points. If the 90th percentile is calculated as ,but ,and It can be set to The 75th percentile of the distribution of values, or set to A fixed ratio of, for example After setting the threshold, traverse all pixels in the composite intensity map and filter out the composite intensity values Higher than Pixels are marked as significant concentrated core points, and then the region is expanded from these core points. The rule of region expansion is: the pixels around the core point (for example, using 8-connected neighborhood) have a composite intensity value of Higher than , then it is absorbed into the current salient region, and this expansion process is iterated until no more pixels that meet the conditions can be added to any salient region. In this way, not only the boundaries of regions with adjacent responses at different scales are fused (because The image has already integrated multi-scale information and gradient information), and further constructs closed contour areas through regional expansion. These closed areas formed after screening, expansion and integration together constitute the final fused saliency localization map.
[0047] The steps to obtain the initial candidate region set are: Read the fused saliency map, iterate over the composite intensity values corresponding to each pixel position in the fused saliency map one by one, count the numerical distribution of the composite intensity values of all pixel positions in the fused saliency map, calculate the median of the overall distribution of the composite intensity values as the fixed segmentation threshold, and obtain the fixed segmentation threshold; According to the fixed segmentation threshold, all pixel positions in the fused salient localization map are traversed to determine whether the composite intensity value at each pixel position exceeds the fixed segmentation threshold. The pixel positions that exceed the fixed segmentation threshold are marked as valid salient positions. All valid salient positions are merged and marked in the binary mask image to generate a binary salient mask map. According to the binary saliency mask map, pixel connectivity analysis is performed on all valid saliency positions to identify groups of valid saliency positions that are adjacent to each other and continuously distributed in space, and the boundary contours of the connected regions are drawn to form an initial set of candidate regions.
[0048] Specifically, read the fused saliency localization map generated in the previous step, which contains the composite intensity value corresponding to each pixel position in the image , then traverse each pixel in the fused salient localization map one by one, extract its composite intensity value, and collect the composite intensity values of all pixels to form a numerical list. For example, if the size of the fused salient localization map is Pixels will be collected Composite intensity values, then statistically analyze the numerical list containing the composite intensity values of all pixel positions to determine their numerical distribution. The specific statistical process includes sorting these composite intensity values from low to high. After sorting, calculate the median of the overall distribution. The calculation method of the median is: if the total number of composite intensity values If it is an odd number, it will be ranked first after sorting. The value of the position is the median. If If it is an even number, the median is the Position and The arithmetic mean of two values at a position, for example, for a After collecting and sorting the 100 composite intensity values of the fused saliency localization map of pixels, the median is the average of the 50th and 51st values. If the 50th value is 0.78 and the 51st value is 0.80, the median is , the calculated median (0.79 in this case) is adopted and set as the fixed segmentation threshold.
[0049] According to the fixed segmentation threshold calculated in the previous step and the original fused saliency localization map (which stores the composite intensity value of each pixel position ), then the system will traverse all the pixel positions in the fused salient positioning map, and for each pixel position Perform the judgment operation, the specific judgment content is the composite intensity value at the pixel position Compared with the previously determined fixed segmentation threshold, if the pixel Composite strength value If the composite intensity value is greater than the fixed segmentation threshold, the pixel position is determined to be a valid salient position. Conversely, if its composite intensity value is less than or equal to the fixed segmentation threshold, the pixel position is considered to be a non-salient position. For example, if the fixed segmentation threshold is 0.79, and the composite intensity value of one pixel is 0.85, since 0.85 is greater than 0.79, the pixel is marked as a valid salient position. If the composite intensity value of another pixel is 0.70, since 0.70 is not greater than 0.79, it is marked as a non-salient position. After completing the judgment and marking of all pixels, all pixels marked as valid salient positions are merged and recorded into a new binary mask image. In this binary mask image, the pixel value of the valid salient position is set to 1 (or foreground value, such as 255), and the pixel value of the non-salient position is set to 0 (or background value). Thus, a binary salient mask covering the entire image area is generated.
[0050] According to the binary saliency mask map generated in the previous step, the map clearly marks all pixels judged as valid saliency positions (value 1) and pixels of non-saliency positions (value 0). Next, pixel connectivity analysis is performed on all valid saliency positions in the binary saliency mask map. The purpose of this analysis is to identify and combine groups of valid saliency positions that are adjacent to each other and continuously distributed in space to form independent regions. Connectivity analysis uses a specific neighborhood rule, such as the 8-connectivity rule, that is, if two valid saliency positions are adjacent in the horizontal, vertical or diagonal direction, they are considered to be connected to each other. By applying a connected component marking algorithm such as a queue-based scan line algorithm or a double-pass scan algorithm , traverse each pixel in the binary saliency mask map, assign a unique digital label to each independent group of interconnected valid salient positions (i.e., connected components), and after identifying these connected regions, further draw the boundary contour of each connected region. The extraction of the boundary contour can be achieved by, for example, the Moore-Neighbor Tracing algorithm or the radial scanning algorithm. These algorithms track the outermost valid salient positions of each connected region to form a closed sequence of coordinate points, representing the contour of the region. All these independent regions identified by connectivity analysis and with their boundary contours drawn together constitute the initial candidate region set.
[0051] The steps to obtain the core component area of traditional Chinese medicine powder are as follows: Read the initial candidate region set, count the total number of pixels at valid salient positions in each candidate region in the initial candidate region set one by one, record the total number of pixels counted as the valid pixel number of the region, and form a candidate region pixel number list; According to the candidate region pixel number list, the preset region pixel number lower limit is compared one by one to determine whether the effective pixel number of each candidate region reaches or exceeds the pixel number lower limit, the candidate regions that reach or exceed the pixel number lower limit are retained, and the candidate regions below the pixel number lower limit are removed to generate a qualified candidate region subset; According to the subset of qualified candidate regions, the boundary coordinates of each qualified candidate region are parsed and marked, the position of the region center point is determined, and the region boundary contour is drawn in the original infrared spectrum image of traditional Chinese medicine powder to generate the core component area of traditional Chinese medicine powder.
[0052] Specifically, the initial candidate region set generated in the previous step is read. This set contains the independent regions and their boundary contour information identified by connectivity analysis and composed of valid significant positions. Next, for each candidate region in this initial candidate region set, the total number of pixels in the valid significant positions is counted one by one. The specific operation is as follows: for a candidate region, first determine the pixels that constitute all the valid significant positions of the region. These pixels are the pixels marked as foreground (for example, the value is 1) in the step of generating the "binary significant mask map". The total number of these pixels is counted to obtain the total number of pixels in the valid significant positions contained in the candidate region. For example, if a specific candidate region covers 150 pixels with a value of 1 on the "binary saliency mask map", the total number of pixels in the valid saliency position contained in the region is 150. The total number of pixels obtained by counting each candidate region is recorded as the regional effective pixel number of the region, and this value is associated with the unique identifier of the candidate region (for example, the label number assigned in the connected component marking process). This counting and recording operation is performed on all candidate regions in the initial candidate region set, and finally a candidate region pixel number list is formed, which lists each initial candidate region and its corresponding regional effective pixel number in detail.
[0053] According to the candidate area pixel number list formed in the previous step, the list records each initial candidate area and its effective pixel number in the area. Next, these candidate areas will be screened. The basis for screening is to compare the effective pixel number of the area with a preset lower limit of the area pixel number. This preset lower limit of the area pixel number is a key parameter. Its setting is intended to exclude those areas that are too small and therefore unlikely to represent the core components of real Chinese medicine powder. For example, the lower limit value can be determined by conducting a preliminary experimental analysis on a large number (for example, 50) of infrared spectrum images of similar Chinese medicine powders, observing and counting the minimum pixel area of the typical core component area confirmed by experts, and combining the resolution of image acquisition and the physical size of the particles. If the analysis shows that the meaningful minimum particle size is The coverage area of the preset region is usually not less than 30 pixels at the current image resolution. The lower limit of the number of pixels in the preset region can be set to 30 pixels. After setting this lower limit, each candidate region in the candidate region pixel number list is checked one by one, and the recorded number of effective pixels in the region is compared with the lower limit of the preset region pixel number (for example, 30 pixels). If the number of effective pixels in a candidate region reaches or exceeds the lower limit (for example, a region has 45 pixels, and it is retained because 45 is greater than or equal to 30), the candidate region is retained. If the number of effective pixels in the region is lower than the lower limit (for example, a region has 20 pixels, and it is removed because 20 is less than 30), the candidate region is removed. All the retained candidate regions together constitute the qualified candidate region subset.
[0054] According to the subset of qualified candidate regions obtained after screening in the previous step, this subset contains all candidate regions whose valid pixel count reaches the preset lower limit. Next, each qualified candidate region in this subset is finally parsed, marked and visualized. First, for each qualified candidate region, its boundary coordinates are accurately parsed. These boundary coordinate information is obtained through the boundary contour drawing step when forming the "initial candidate region set", which is usually expressed as a series of pixel positions that define the outer boundary of the region. At the same time, the center point of each qualified candidate region is determined. The calculation of the center point of the region can be done by the method of geometric moments, that is, the arithmetic mean of the coordinates of all pixels constituting the region is calculated. Specifically, if a qualified candidate region consists of pixels, and the coordinates of each pixel are (in From 1 to ), then the coordinates of its center point For all The sum of and all The sum of , for example, a pixel , , , composed of The qualified candidate area, the center point , After determining the boundary coordinates and center point position of each qualified candidate area, this information is used to calibrate the original infrared spectrum image of traditional Chinese medicine powder. Specifically, the boundary contour of each qualified candidate area is accurately drawn to the corresponding position of the original image. These areas that are calibrated and size-screened on the original image constitute the core component area of traditional Chinese medicine powder that is finally identified.
[0055] The above are merely preferred embodiments of the present invention and do not limit the present invention in any other form. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of protection of the technical solution of the present invention.
Claims
1. A method for infrared analysis of traditional Chinese medicine powder based on image recognition, characterized in that: The following steps are involved: Frequency separation is performed on the infrared spectrum image of traditional Chinese medicine powder, and the edge intensity values used to characterize the contours of traditional Chinese medicine powder particles in each frequency layer are integrated to obtain a multi-scale particle edge atlas; For each single-scale edge map in the multi-scale particle edge atlas, calculating the local information entropy and local contrast of the pixel neighborhood to obtain pixel statistical feature data, and performing a combination operation based on the pixel statistical feature data to generate an intra-scale significant area atlas; Reading the salient region atlas within the scale, projecting each single-scale salient region map to the unified spatial coordinates of the original infrared spectrum image of the traditional Chinese medicine powder to obtain an aligned spatial feature set, and generating a fused salient localization map based on the aligned spatial feature set; The fused significant positioning map is analyzed, a fixed segmentation threshold is set, connected pixel clusters above the fixed segmentation threshold are identified, and an initial candidate region set is obtained. Based on the initial candidate region set, judgment and screening are performed against the preset lower limit of the number of pixels in the region to extract and calibrate the core component area of the traditional Chinese medicine powder.
2. The infrared analysis method for Chinese medicinal powder based on image recognition according to claim 1, characterized in that: The steps for obtaining the multi-scale particle edge atlas are as follows: Read the infrared spectrum image of traditional Chinese medicine powder and perform frequency separation on it. The separation process uses a fixed frequency division standard to proportionally divide the frequency domain range and extract the corresponding frequency information to generate a multi-frequency layer image set; Based on the multi-frequency layer image set, extracting the edge regions of the Chinese medicine powder particles shown in each frequency layer image, performing edge gradient calculation on the edge regions of the Chinese medicine powder particles and counting the edge gradient values, characterizing the edge gradient values as edge intensity values, and generating a set of Chinese medicine powder particle edge intensity maps; Based on the traditional Chinese medicine powder particle edge intensity map set, the edge intensity maps are rearranged according to the frequency layer division standard and a multi-scale matching index is established. The edge intensity maps of each frequency layer are fused to generate a unified structure atlas, thereby generating a multi-scale particle edge atlas.
3. The infrared analysis method for Chinese medicinal powder based on image recognition according to claim 1, characterized in that: The steps for obtaining the pixel statistical feature data are as follows: Reading each single-scale particle edge map in the multi-scale particle edge map set one by one, determining the position coordinates of the pixels to be analyzed one by one for the single-scale particle edge map, locating the local neighborhood range corresponding to the coordinates of the pixels to be analyzed, intercepting all pixel values within the local neighborhood range, and generating a value set of the neighborhood area of the pixels to be analyzed; Based on the value set of the neighborhood area of the pixel to be analyzed, the probability distribution of the occurrence of each pixel value in the neighborhood area is calculated one by one, and the uncertainty of the value distribution in the neighborhood area of the pixel is calculated one by one according to the probability distribution, and the information entropy value of the neighborhood area of the pixel to be analyzed is obtained to generate a pixel local information entropy set; Based on the value set of the neighborhood area of the pixel to be analyzed, the absolute value of the difference between the value of the central pixel in the neighborhood area and the values of other pixels in the neighborhood is calculated one by one, and the absolute values of the differences are summarized to quantify the degree of value change in the neighborhood, and the local contrast value of the neighborhood area of the pixel to be analyzed is obtained. The pixel local information entropy set and the local contrast value are integrated to form the pixel statistical feature data.
4. The infrared analysis method for Chinese medicinal powder based on image recognition according to claim 1, characterized in that: The steps for obtaining the atlas of salient regions within the scale are as follows: Based on the pixel statistical feature data, the position coordinates of all pixels in each single-scale particle edge image are sequentially read, and the corresponding local information entropy and local contrast are linearly normalized according to their respective minimum and maximum values to obtain a normalized local information entropy map and a normalized local contrast map of each image; Calculate the fusion response intensity value of each pixel according to the normalized local information entropy map and the normalized local contrast map; Pixel connectivity is judged based on a fusion response intensity map formed by the fusion response intensity values, and whether adjacent boundary areas should be merged is judged based on the fusion response intensity values to generate an intra-scale salient area atlas.
5. The infrared analysis method for Chinese medicinal powder based on image recognition according to claim 1, characterized in that: The steps for obtaining the alignment space feature set are: Reading the atlas of significant regions within the scale, sequentially parsing the significant region boundary coordinate information and image resolution parameters in each single-scale significant region map, converting the significant region boundary coordinates in each map into the spatial scale unit corresponding to the original infrared spectrum image of the traditional Chinese medicine powder, and generating the original coordinate scale mapping result; According to the original coordinate scale mapping result, the region contour information of each single-scale salient region map that has been converted to the original coordinate system is superimposed into a unified image space to form a region alignment superposition map at a unified scale; Based on the regional alignment overlay map under the unified scale, all coordinate points in the original infrared spectrum image of traditional Chinese medicine powder are traversed, and the regional response relationship corresponding to each coordinate point in different single scales is marked and extracted to generate an alignment space feature set.
6. The infrared analysis method for Chinese medicinal powder based on image recognition according to claim 1, characterized in that: The steps for obtaining the fused salient localization map are as follows: Read the aligned spatial feature set, extract the fused response intensity value for each pixel position in the salient region map at each scale, traverse the fused response intensity values of the same coordinate points in all scale images and mark them as a multi-scale response sample set to form a coordinate-normalized multi-scale fused response set; Calculating a composite intensity value for each pixel according to the multi-scale fusion response set; Based on the composite intensity value, the upper and lower limits of the significance threshold interval are set, and pixels above the upper limit are selected as significant concentrated core points and the region is expanded. The boundaries of adjacent response regions at different scales are fused to construct a closed contour region and generate a fused significant positioning map.
7. The infrared analysis method for Chinese medicinal powder based on image recognition according to claim 1, characterized in that: The steps for obtaining the initial candidate region set are: Read the fused saliency positioning map, iterate over the composite intensity values corresponding to each pixel position in the fused saliency positioning map one by one, count the numerical distribution of the composite intensity values of all pixel positions in the fused saliency positioning map, calculate the median of the overall distribution of the composite intensity values as a fixed segmentation threshold, and obtain the fixed segmentation threshold; According to the fixed segmentation threshold, all pixel positions in the fused salient localization map are traversed to determine whether the composite intensity value at each pixel position exceeds the fixed segmentation threshold, and pixel positions exceeding the fixed segmentation threshold are marked as valid salient positions. All valid salient positions are merged and marked in a binary mask image to generate a binary salient mask map; According to the binary saliency mask map, pixel connectivity analysis is performed on all valid saliency positions to identify groups of valid saliency positions that are adjacent to each other and continuously distributed in space, and the boundary contours of the connected regions are drawn to form an initial set of candidate regions.
8. The infrared analysis method for traditional Chinese medicine powder based on image recognition according to claim 1, characterized in that: The steps for obtaining the core component area of the traditional Chinese medicine powder are: Reading the initial candidate region set, counting the total number of pixels at valid significant positions contained in each candidate region in the initial candidate region set, recording the counted total number of pixels as the effective pixel number of the region, and forming a candidate region pixel number list; According to the candidate area pixel number list, comparing each candidate area with a preset lower limit of the number of pixels of the area to determine whether the number of effective pixels in the area reaches or exceeds the lower limit of the number of pixels, retaining the candidate areas that reach or exceed the lower limit of the number of pixels, removing the candidate areas below the lower limit of the number of pixels, and generating a subset of qualified candidate areas; According to the qualified candidate region subset, the boundary coordinates of each qualified candidate region are parsed and marked, the position of the region center point is determined, and the region boundary outline is drawn in the original traditional Chinese medicine powder infrared spectrum image to generate the traditional Chinese medicine powder core component area.
Citation Information
Patent Citations
Multi-scale region fusion-based salient region detection method
CN104408711A
Infrared small target detection method and system based on dark channel prior
CN112529896A
Counting method for medicine plates in medicine box based on high-frequency information and contour information
CN113284096A
Saliency target detection and segmentation method based on image frequency decomposition
CN117475141A
Remote sensing image enhancement method and system based on homomorphic filtering terrain correction
CN120013831A
Cited By
Fine segmentation method and system for MRZ image
CN121527774A