Image recognition-based infrared analysis method for traditional Chinese medicine powder
By performing frequency separation and local feature calculation on infrared spectral images of traditional Chinese medicine powders, a multi-scale particle edge atlas is generated, which solves the problem of blurred boundary information in traditional Chinese medicine powder image recognition and achieves higher recognition accuracy and stability.
Patent Information
- Application Number
- CN202511074197.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2045-08-01
AI Technical Summary
In existing image recognition technologies, when processing images of Chinese medicine powders, problems such as blurred boundary information and discontinuous local response are common. Especially in the presence of strong interfering textures or uneven particle size distribution, high-response features are often misjudged or core areas are missed.
By performing frequency separation on the infrared spectral images of traditional Chinese medicine powder, integrating the particle edge intensity values in each frequency layer, calculating the local information entropy and local contrast of the pixel neighborhood, generating a multi-scale particle edge atlas, identifying connected pixel clusters through a fixed segmentation threshold, and extracting the core component region of the traditional Chinese medicine powder by combining regional pixel lower limit filtering rules.
It improves the structural recognition sensitivity and component discrimination accuracy of traditional Chinese medicine powder image recognition, enhances the recognition accuracy and stability in complex backgrounds, and ensures the accurate recognition of particle outline boundaries and the spatial correlation of component regions.
Smart Images

Figure CN120581090B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image recognition, in particular to a traditional Chinese medicine powder infrared analysis method based on image recognition. BACKGROUND
[0002] Image recognition refers to a technical process of using a computer to automatically detect, analyze and understand images to recognize features, structures, targets or patterns in the images, and belongs to an important branch of the intersection of artificial intelligence and computer vision.
[0003] In the prior art, the capture of structural features by image recognition depends on fixed scale or single-view image local feature extraction, which leads to problems such as blurred boundary information and discontinuous local response in particle images, especially in the case of strong interference texture or uneven distribution of particle scale in the image, common recognition errors such as misjudgment of high response features or omission of core areas often occur. Therefore, improvement is needed. SUMMARY
[0004] The purpose of the present application is to solve the shortcomings in the prior art, and a traditional Chinese medicine powder infrared analysis method based on image recognition is proposed.
[0005] In order to achieve the above purpose, the present application adopts the following technical scheme, a traditional Chinese medicine powder infrared analysis method based on image recognition, comprising the following steps:
[0006] The infrared spectrum image of the traditional Chinese medicine powder is subjected to frequency separation, the edge intensity values in each frequency layer representing the particle outline of the traditional Chinese medicine powder are integrated, and a multi-scale particle edge graph set is obtained;
[0007] For each single-scale edge graph in the multi-scale particle edge graph set, the local information entropy and local contrast of the pixel neighborhood are calculated to obtain pixel statistical feature data, and based on the pixel statistical feature data, combination operation is performed to generate an intra-scale salient region graph set;
[0008] The intra-scale salient region graph set is read, each single-scale salient region graph is projected to the unified spatial coordinates of the original traditional Chinese medicine powder infrared spectrum image to obtain an aligned spatial feature set, and based on the aligned spatial feature set, a fusion salient positioning graph is generated;
[0009] The fusion salient positioning graph is analyzed, a fixed segmentation threshold is set, connected pixel clusters higher than the fixed segmentation threshold are identified to obtain an initial candidate region set, and based on the initial candidate region set, a preset region pixel number lower limit is judged and screened to extract and calibrate the core component region of the traditional Chinese medicine powder.
[0010] Preferably, the step of obtaining the multi-scale particle edge graph set is:
[0011] Reading infrared spectrum images of traditional Chinese medicine powder, carrying out frequency separation on the infrared spectrum images of traditional Chinese medicine powder, adopting fixed frequency division standard to proportionally cut the frequency domain range and extract corresponding frequency information, and generating a multi-frequency layer image set;
[0012] Based on the multi-frequency layer image set, extracting the edge region of traditional Chinese medicine powder particles shown in each frequency layer image, carrying out edge gradient operation on the edge region of traditional Chinese medicine powder particles and counting the edge gradient value, taking the edge gradient value as an edge intensity value for representation, and generating a traditional Chinese medicine powder particle edge intensity map set;
[0013] Based on the traditional Chinese medicine powder particle edge intensity map set, rearranging the edge intensity maps according to the frequency layer division standard and establishing a multi-scale matching index, fusing each frequency layer edge intensity map to generate a unified structure map set, and generating a multi-scale particle edge map set.
[0014] Preferably, the step of acquiring the pixel statistical feature data is:
[0015] Reading each single-scale particle edge map in the multi-scale particle edge map set frame by frame, determining the position coordinates of the to-be-analyzed pixel one by one for the single-scale particle edge map, positioning the local neighborhood range corresponding to the to-be-analyzed pixel coordinates, intercepting all pixel values in the local neighborhood range, and generating a to-be-analyzed pixel neighborhood region value set;
[0016] Based on the to-be-analyzed pixel neighborhood region value set, calculating the probability distribution of each pixel value in the neighborhood region one by one, calculating the uncertainty degree of the value distribution in the pixel neighborhood region one by one according to the probability distribution, acquiring the information entropy value of the to-be-analyzed pixel neighborhood region, and generating a pixel local information entropy set;
[0017] Based on the to-be-analyzed pixel neighborhood region value set, calculating the difference absolute value between the center pixel value in the neighborhood region and the pixel value in the neighborhood one by one, and quantifying the value change degree in the neighborhood by summarizing the difference absolute value, acquiring the local contrast value of the to-be-analyzed pixel neighborhood region, and integrating the pixel local information entropy set and the local contrast value to form the pixel statistical feature data.
[0018] Preferably, the step of acquiring the scale-in significant region map set is:
[0019] Based on the pixel statistical feature data, reading the position coordinates of all pixels in each single-scale particle edge map in turn, respectively performing linear normalization transformation on the corresponding local information entropy and local contrast according to their minimum value and maximum value, obtaining the normalized local information entropy map and the normalized local contrast map of each map;
[0020] According to the normalized local information entropy map and the normalized local contrast map, a fusion response intensity value of each pixel is calculated;
[0021] According to a fusion response intensity map composed of the fusion response intensity values, a pixel connectivity judgment is performed, whether to merge adjacent boundary regions is judged according to the fusion response intensity values, and a scale-in significant region map set is generated.
[0022] Preferably, the acquisition step of the aligned spatial feature set is:
[0023] Reading the scale-in significant region map set, significant region boundary coordinate information and image resolution parameters in each single scale significant region map are sequentially analyzed, the significant region boundary coordinates in each map are converted into spatial scale units corresponding to the original traditional Chinese medicine powder infrared spectrum image, and an original coordinate scale mapping result is generated;
[0024] According to the original coordinate scale mapping result, the region profile information converted into the original coordinate system in each single scale significant region map is superimposed into a unified image space, and a region alignment superimposition map under a unified scale is formed;
[0025] Based on the region alignment superimposition map under the unified scale, all coordinate points in the original traditional Chinese medicine powder infrared spectrum image are traversed, the region response relationship of each coordinate point in different single scales is marked and extracted, and an aligned spatial feature set is generated.
[0026] Preferably, the acquisition step of the fusion significant positioning map is:
[0027] Reading the aligned spatial feature set, a fusion response intensity value of each pixel position in each scale-in significant region map is extracted, the fusion response intensity values of the same coordinate points in all scale images are traversed and marked as a multi-scale response sample set, a multi-scale fusion response set under coordinate reduction is formed;
[0028] According to the multi-scale fusion response set, a composite intensity value of each pixel is calculated;
[0029] Based on the composite intensity value, an upper limit and a lower limit of a significant threshold interval are set, a pixel higher than the upper limit is selected as a core point in a significant set and is subjected to region expansion, adjacent response region boundaries in different scales are fused, a closed contour region is constructed, and a fusion significant positioning map is generated.
[0030] Preferably, the acquisition step of the initial candidate region set is:
[0031] Reading the fusion saliency map, each composite intensity value corresponding to each pixel position in the fusion saliency map is traversed one by one, the numerical distribution of the composite intensity values of all pixel positions in the fusion saliency map is counted, the median of the overall distribution of the composite intensity values is calculated as a fixed segmentation threshold, and the fixed segmentation threshold is obtained;
[0032] According to the fixed segmentation threshold, all pixel positions in the fusion saliency map are traversed, it is judged whether the composite intensity value at each pixel position exceeds the fixed segmentation threshold, the pixel position exceeding the fixed segmentation threshold is marked as an effective saliency position, all effective saliency positions are marked in a binary mask image, and a binary saliency mask image is generated.
[0033] According to the binary saliency mask image, pixel connectivity analysis is performed on all effective saliency positions, a group of effective saliency positions that are adjacent and continuously distributed in space is identified, the boundary contour of the connected region is drawn, and an initial candidate region set is formed.
[0034] Preferably, the step of obtaining the traditional Chinese medicine powder core component region is:
[0035] Reading the initial candidate region set, the total number of pixels of the effective saliency positions contained in each candidate region in the initial candidate region set is counted one by one, the total number of pixels counted is recorded as the region effective pixel number, and a candidate region pixel number list is formed.
[0036] According to the candidate region pixel number list, whether the region effective pixel number of each candidate region reaches or exceeds the pixel number lower limit is judged one by one by comparing with the preset region pixel number lower limit, the candidate regions reaching or exceeding the pixel number lower limit are retained, and the candidate regions lower than the pixel number lower limit are removed, and a qualified candidate region subset is generated.
[0037] According to the qualified candidate region subset, the boundary coordinates of each qualified candidate region are analyzed and marked, the region center point position is determined, and the region boundary contour is drawn in the original traditional Chinese medicine powder infrared spectrum image, and a traditional Chinese medicine powder core component region is generated.
[0038] Compared with the prior art, the advantages and positive effects of the present application are:
[0039] The present application can realize multi-scale perception of microstructure, enhance the accurate recognition ability of particle contour boundary by performing frequency separation and particle edge extraction operation on traditional Chinese medicine powder infrared spectrum image, integrating edge intensity features in different frequency layers; on this basis, the expression stability and contrast sensitivity of image features are improved by using the joint statistical indicators of local information entropy and local contrast to measure the uncertainty and change amplitude of pixel neighborhood; further, the multi-scale features are converted into saliency response map to ensure the consistency of features between scales and reduce the influence of local interference noise; after mapping each scale response map to the unified spatial coordinates, spatial reconstruction is performed to make different scale saliency information fuse into cross-scale continuous distribution of composite features, and the spatial correlation and recognition confidence of component region are strengthened; with the help of fixed segmentation threshold, connected pixel cluster is identified, and region pixel lower limit filtering rule is used to complete core region extraction, which improves the performance of recognition result in structural integrity and physical authenticity. In summary, the present application not only improves the sensitivity of structure recognition, but also enhances the component discrimination accuracy under complex background conditions. BRIEF DESCRIPTION OF DRAWINGS
[0040] Figure 1 The present application is a schematic diagram of the steps. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application, and are not used to limit the present application.
[0042] Please refer to Figure 1 The present application provides a technical scheme, an infrared analysis method of traditional Chinese medicine powder based on image recognition, including the following steps:
[0043] The traditional Chinese medicine powder infrared spectrum image is subjected to frequency separation, and the edge intensity values in each frequency layer for representing the particle contour of traditional Chinese medicine powder are integrated to obtain a multi-scale particle edge graph set;
[0044] For each single scale edge graph in the multi-scale particle edge graph set, the local information entropy and local contrast of pixel neighborhood are calculated to obtain pixel statistical feature data, and based on the pixel statistical feature data, combination operation is performed to generate a scale-in salient region graph set;
[0045] The scale-in salient region graph set is read, each single scale salient region graph is projected to the unified spatial coordinates of the original traditional Chinese medicine powder infrared spectrum image to obtain an aligned spatial feature set, and based on the aligned spatial feature set, a fused salient positioning graph is generated;
[0046] The fusion salient positioning map is analyzed, a fixed segmentation threshold is set, connected pixel clusters higher than the fixed segmentation threshold are identified, an initial candidate region set is obtained, and the initial candidate region set is judged and screened against a preset region pixel quantity lower limit, and a core ingredient region of the traditional Chinese medicine powder is extracted and demarcated.
[0047] The obtaining step of the multi-scale particle edge map set is:
[0048] The infrared spectrum image of the traditional Chinese medicine powder is read, the infrared spectrum image of the traditional Chinese medicine powder is subjected to frequency separation, the separation process adopts a fixed frequency division standard to proportionally cut the frequency domain range and extract corresponding frequency information, and a multi-frequency layer image set is generated;
[0049] Based on the multi-frequency layer image set, the traditional Chinese medicine powder particle edge region appearing in each frequency layer image is extracted, the traditional Chinese medicine powder particle edge region is subjected to edge gradient operation and the edge gradient value is counted, the edge gradient value is taken as an edge intensity value for representation, and a traditional Chinese medicine powder particle edge intensity map set is generated;
[0050] 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 map set, and a multi-scale particle edge map set is generated.
[0051] Specifically, the infrared spectrum image of the traditional Chinese medicine powder is read, which is usually digital image data containing spatial dimension information and infrared spectrum information corresponding to each spatial point. The infrared spectrum image of the traditional Chinese medicine powder is subjected to frequency separation. Specifically, the frequency separation process is implemented by using two-dimensional discrete wavelet transform (2D-DWT). The fixed frequency division standard of the process includes the selected wavelet mother function type and the decomposition layer number. For example, “Daubechies4” (db4) is selected as the wavelet mother function because it has good time-frequency localization characteristics and certain smoothness, and can better represent the edge and texture information of the traditional Chinese medicine powder particles. The setting of the decomposition layer number is based on the prior analysis or experimental evaluation of the sample characteristics. The specific setting process is as follows: first, a batch of representative traditional Chinese medicine powder infrared spectrum images (for example, 20 images) are preliminarily analyzed to measure the average size of the particles of interest in the images, for example, the average particle occupies about 10 to 15 pixels in diameter under the current image resolution. Then, the images are experimentally decomposed using different decomposition layers (for example, from 1 layer to 5 layers), and the clarity of the particle features and the noise level in the detail sub-band images at each level are observed. The best decomposition layer number is determined by calculating the contrast of the signal and background noise in a specific particle region, or by evaluating the performance of the subsequent edge extraction algorithm on the results of different level decompositions. For example, if it is found that 3-layer decomposition can clearly display the outline of the target particles in most detail sub-bands, while the noise introduced by higher layer decomposition (such as 4-layer or 5-layer) begins to mask the particle details or causes a significant decrease in signal-to-noise ratio (for example, define a signal-to-noise ratio threshold of 10 decibels, and calculate the formula to evaluate, wherein is the root mean square value of the signal in the particle region, is the root mean square value of the noise in the adjacent background region. When the average signal-to-noise ratio obtained by 3-layer decomposition is 15 decibels, and the 4-layer decomposition decreases to 8 decibels), 3 layers are determined as the decomposition layer number of the fixed frequency division standard. In the two-dimensional discrete wavelet transform process, the image is decomposed into a low-frequency approximation sub-band image (LL) and three high-frequency detail sub-band images corresponding to the horizontal (HL), vertical (LH), and diagonal (HH) directions at each level. This decomposition method naturally divides the two-dimensional spatial frequency domain range of the image by a certain proportion. Each level of decomposition roughly halves the frequency band, thereby extracting frequency information of different scales and directions. Finally, all these detail sub-band images of different levels and different directions and the approximation sub-band image of the last layer together constitute a multi-frequency layer image set.
[0052] Based on the multi-frequency layer image set generated in the previous step, further processing is performed to extract edge information. Specifically, each frequency layer image in the multi-frequency layer image set is traversed. For a high-frequency detail sub-band image representing a specific scale and direction, for example, the edge region of the traditional Chinese medicine powder particles appearing in the image is first identified and extracted. This step can be directly performed on the entire sub-band image, for example, the particle edge has sufficient contrast in the sub-band image. Subsequently, for each pixel position, edge gradient operation is performed. The Sobel operator is used to implement the operation. Specifically, for any pixel in the frequency layer image , its horizontal gradient component and vertical gradient component are calculated by convolution operation. The convolution kernel is the Sobel kernel , the horizontal Sobel kernel is , used to detect the edge in the vertical direction, and the vertical Sobel kernel is , used to detect the edge in the horizontal direction. After the convolution operation, the and represent the rate of change of the intensity of the pixel in the horizontal and vertical directions, respectively. Then, the gradient amplitude of the pixel is calculated based on the two gradient components, and the calculation formula is . The gradient amplitude is the statistical edge gradient value, 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, i.e., the gradient amplitude, is directly used as the edge intensity value of the pixel to represent the edge intensity value. Thus, a corresponding traditional Chinese medicine powder particle edge intensity image is generated for the frequency layer image being processed, where the gray value of each pixel is the edge intensity value. The complete process of edge region extraction, edge gradient operation, edge gradient value statistics, and edge intensity value representation is performed for all images in the multi-frequency layer image set. Finally, all single-frequency layer edge intensity images are collected to form a traditional Chinese medicine powder particle edge intensity image set.
[0053] Based on the previously obtained traditional Chinese medicine powder particle edge intensity image set, rearrangement, indexing, and integration are performed. First, the frequency layer division standard used to generate the edge intensity images is used to rearrange the images. The frequency layer division standard directly corresponds to the decomposition level and direction of the two-dimensional discrete wavelet transform defined in the first step. For example, if 3-level wavelet decomposition is used, there will be corresponding to the lowest frequency detail, such as HL3, LH3, HH3 subband image of the 3rd level decomposition), to the finest scale (corresponding to the highest frequency detail, such as HL1, LH1, HH1 subband image of the 1st level decomposition), and within the same scale, the order can be sorted by direction (such as horizontal, vertical, diagonal). After the arrangement, a multi-scale matching index is established for each edge intensity map. The index is a structured identifier that uniquely identifies each scale edge intensity map and its characteristics. 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, programmable identity. The specific implementation is to create a lookup table or data structure that associates these indexes with the corresponding edge intensity map data. For example, set an index rule: wherein is the decomposition level (e.g. 1, 2, 3), is the number of directions for each level (usually 3: HL, LH, HH), is the direction code (e.g. HL is 1, LH is 2, HH is 3), if the number of decomposition levels is 3, the HL direction map index of the lowest frequency detail layer (level 3) is , and the HH direction map index of the highest frequency detail layer (level 1) is , and store or reference the edge intensity maps according to this rule. Then, integrate the edge intensity maps of each frequency layer to generate a unified structure atlas, which means organizing all the arranged and indexed edge intensity maps into a standardized data container or collection. This container ensures that all the maps are spatially aligned. If the subband images generated by the original wavelet decomposition have different sizes, the edge intensity maps need to be unified to a common reference resolution through upsampling (such as using bicubic interpolation) or downsampling after generating the edge intensity maps or at this step. The common reference resolution is usually the resolution of the original infrared spectrum image of traditional Chinese medicine powder, ensuring 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.
[0054] The steps for obtaining the pixel statistical feature data are as follows:
[0055] Read each single-scale particle edge map in the multi-scale particle edge atlas one by one, determine the position coordinates of the pixel to be analyzed for each single-scale particle edge map, locate the local neighborhood range corresponding to the pixel to be analyzed coordinates, and extract all pixel values within the local neighborhood range to generate a pixel value set of the pixel to be analyzed neighborhood region.
[0056] Based on the value set of the neighborhood region of the to-be-analyzed pixel, the probability distribution of the value of each pixel in the neighborhood region is calculated one by one, the uncertainty of the value distribution in the neighborhood region of the pixel is calculated one by one according to the probability distribution, the information entropy value of the neighborhood region of the to-be-analyzed pixel is obtained, and a local information entropy set of the pixel is generated;
[0057] Based on the value set of the neighborhood region of the to-be-analyzed pixel, the absolute value of the difference between the value of the center pixel in the neighborhood region and the value of other pixels in the neighborhood region is calculated one by one, and the absolute values of the differences are summarized to quantify the degree of change of the values in the neighborhood region, to obtain the local contrast value of the neighborhood region of the to-be-analyzed pixel, and to integrate the local information entropy set of the pixel and the local contrast value to form the statistical feature data of the pixel.
[0058] Specifically, each single-scale particle edge map in the multi-scale particle edge map set is read frame by frame, and the specific operation is as follows: a single-scale particle edge map is selected for processing in a predetermined order (for example, in the order of multi-scale matching index) from the map set, and then for the currently selected single-scale particle edge map, by systematically scanning each pixel in the image, the position coordinates of each to-be-analyzed pixel are determined one by one , wherein represents the horizontal coordinate of the pixel, represents the vertical coordinate of the pixel, for each determined to-be-analyzed pixel position coordinate, the corresponding local neighborhood range is then located, which is defined as a fixed-size square window centered on the to-be-analyzed pixel, and the size, such as the width and height, is , i.e. 5 pixels, which constitutes a pixel neighborhood, and the setting of is based on the following: by analyzing a calibration data set containing 50 representative single-scale particle edge maps of different scales, the effectiveness of the subsequent features (such as local information entropy and local contrast) extracted under different window sizes (such as ) in distinguishing the core region of the particle and the background region is compared, and the evaluation index can be the statistical significant difference (for example, using a two-sample t-test, a p-value less than 0.05 is considered significant) of the feature distribution of the two regions or the classification accuracy rate using a simple classifier (such as the nearest neighbor classifier), if the window achieves the best balance between providing sufficient local information to calculate stable feature values and maintaining the spatial positioning accuracy of the features, while its computational load is lower than that of larger windows (such as ), and the feature distinguishing ability is significantly better than that of smaller windows (such as ), then is selected, and after the position coordinates of the to-be-analyzed pixel are determined, the value set of the neighborhood region of the to-be-analyzed pixel is obtained by scanning the neighborhood region of the to-be-analyzed pixel in the image, and the value set is used as the input of the feature extraction module. After the local neighborhood range, all the edge intensity values of the pixels contained in this neighborhood are accurately cut from the single-scale particle edge map, which together form the pixel neighborhood region value set of the pixel to be analyzed.
[0059] Based on the pixel neighborhood region value set of each pixel to be analyzed obtained in the previous process, the probability distribution of each pixel value (i.e. edge intensity value) in the neighborhood region of each such set (corresponding to one pixel to be analyzed) is then calculated one by one. Specifically, for a pixel neighborhood region value set containing pixel values (for example, for a neighborhood of pixels, ), first determine the dynamic range of these values, which is usually the range of edge intensity values from 0 to 255 (e.g. for 8-bit image data), and then divide this range into equal-width intervals (i.e. "bins" of the histogram), The value of is preset to 16, which is based on the following considerations: in a neighborhood with 25 sample points, choosing 16 bins can reflect the distribution of values to some extent, while avoiding too many bins resulting in too few samples in each bin and making the probability estimation unstable, for example, if 16 bins are chosen, each bin covers gray levels, by counting the frequency of pixel values falling into each interval in the neighborhood, and then dividing the frequency of each interval by the total number of pixels in the neighborhood , the probability of each value interval is obtained, where From 1 to , according to this probability distribution, the uncertainty of the value distribution in the pixel neighborhood region, i.e. the information entropy value, is then calculated one by one, which is calculated by the following formula: , where is the probability of the value interval, the information entropy values calculated for each pixel to be analyzed are stored to form a pixel local information entropy set covering the entire single-scale particle edge map.
[0060] Similarly, based on the pixel neighborhood region value set generated for each pixel to be analyzed, another statistical feature, local contrast, is calculated as follows: first, from the pixel neighborhood region value set of the pixel to be analyzed, identify the edge intensity value of the pixel at the center of the neighborhood (i.e. the pixel to be analyzed itself that is currently being analyzed), denoted as , then read the edge intensity values of all other pixels in the neighborhood except the center pixel one by one, denoted as ,in Represents the index of each non-center cell within the neighborhood, for each Calculate its value relative to the center pixel. The absolute value of the difference between them, i.e. After calculating the absolute values of the differences between all non-center pixels and the center pixel within the neighborhood, these absolute values are summarized. Specifically, the summarization method involves calculating the average of these absolute values to quantify the degree of numerical variation or texture complexity within the neighborhood. For example, in a… If the central pixel has 24 neighboring pixels in its neighborhood, then the local contrast... The average of the absolute values of these 24 differences is calculated as follows: This calculation yields The value is the local contrast value of the neighborhood region of the pixel to be analyzed. The local contrast value calculated for each pixel to be analyzed is stored to form a set of local contrast values covering the entire single-scale particle edge map. Finally, the set of local information entropy of pixels generated in the previous step and the set of local contrast values generated in the current step are integrated. Specifically, for each pixel position in the image, its corresponding local information entropy value and local contrast value are paired and combined to form a two-dimensional or multi-dimensional feature vector. All these feature vector sets of pixels together constitute the pixel statistical feature data of the single-scale particle edge map.
[0061] The steps for obtaining a salient region atlas within a given scale are as follows:
[0062] Based on pixel statistical feature data, the coordinates of all pixels in each single-scale particle edge map are read sequentially. 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 map.
[0063] Based on the normalized local information entropy map and the normalized local contrast map, the fusion response intensity value of each pixel is calculated using the following formula:
[0064] ;
[0065] in, For position The fusion response intensity value at the location, This is the normalized local information entropy value. This represents the normalized local contrast value. The absolute value of the difference between the two values. Used to control the range of the fusion base, the overall value range remains within... Inside;
[0066] Based on the fusion response intensity map formed by the fusion response intensity values, pixel connectivity is determined, and adjacent boundary regions are merged based on the fusion response intensity values to generate a salient region atlas within the scale.
[0067] Specifically, based on pixel statistical feature data, which includes the local information entropy and local contrast values calculated for each pixel in each single-scale grain edge map, the operation process first reads the single-scale grain edge map sequentially, and for all pixel position coordinates in the map, extracts the corresponding local information entropy value set and local contrast value set. Linear normalization transformation is then performed on these two types of values. Specifically, for local information entropy, the local information entropy values of all pixels in the current single-scale grain edge map are traversed first, and the minimum value is found. and maximum value For example, in an image containing thousands of pixels, the lowest recorded local information entropy value is 0.8, and the highest is 4.2. , Subsequently, the original local information entropy value of each pixel in the image was calculated. Through the formula ( ) / ( Calculate its normalized local information entropy value. ,like and If the local information entropy values of all pixels in the image are equal (i.e., all pixels have the same local information entropy value), then the normalized local information entropy value of all pixels is uniformly set to a fixed value, such as 0.5. In the example above, if the local information entropy value of a pixel is equal to the local information entropy value of all pixels, then the normalized local information entropy value of all pixels is uniformly set to a fixed value, such as 0.5. If it is 2.5, then its Calculated as ( ) / ( ),Right now Similarly, the same linear normalization process is performed on the local contrast values of all pixels in the single-scale grain edge map, that is, to find the minimum local contrast value in the map. and maximum value and the original local contrast value for each pixel. Application formula ( ) / ( The normalized local contrast value is obtained by calculation. This process ensures that all normalized local entropy and local contrast values are strictly within the closed interval of 0 to 1. This process generates corresponding normalized local entropy and normalized local contrast maps for the single-scale particle edge map being processed.
[0068] formula: The advantage of this formula lies in its nonlinear integration of the normalized local information entropy. and local contrast Two features, aiming to identify saliency regions in images more robustly, specifically, the numerator indicates that the contributions of information entropy and contrast to saliency are additive, that is, when both are high, saliency is also high, the denominator Adaptive adjustment is made to the fusion process when and When the numerical difference is large, the denominator will increase, thereby inhibiting the fusion response intensity value , which helps to balance the situation when the difference between the two features is large, avoiding the dominance of a single feature over saliency judgment, and when the numerical values of the two are close, the denominator is relatively small, and the fusion response intensity value is mainly determined by the numerator, reflecting the consistency contribution of the features, The structure and square root operation make the denominator's response to the difference more smooth and bounded, avoiding the problems of division by zero or excessively large denominator, and the final square root operation further adjusts the distribution of the response value and helps to constrain the final value within interval, making it have a similar probability interpretation, and improving the accuracy and robustness of positioning the core region of traditional Chinese medicine powder particles.
[0069] The acquisition steps of the parameter are as follows:
[0070] The parameter represents a pixel located at spatial coordinates on a single-scale particle edge map, and its corresponding normalized local information entropy value, which is directly derived from the "normalized local information entropy map" obtained by linearly normalizing the original local information entropy map in the aforementioned step. Linear normalization ensures that the value of ranges between 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, then determine the minimum value and the maximum value in this set. For any pixel , the original local information entropy value is calculated as , and if , then is set to 0.5. Taking actual numerical values as an example, if the minimum value of the original local information entropy values of all pixels in a single-scale particle edge map is 1.2 and the maximum value is 2.5, then the normalized value of the original local information entropy value of any pixel is calculated as4.0, then for a pixel with an original local information entropy value of 0.5, its normalized local information entropy value is calculated as Thus, in this example, .
[0071] The parameter is obtained as follows:
[0072] The parameter represents a pixel located at spatial coordinates on the same single-scale particle edge map, and its corresponding normalized local contrast value is obtained in the same way as , which is directly derived from the "normalized local contrast map" obtained by linearly normalizing the original local contrast map in the aforementioned parameter obtaining step. Linear normalization also ensures that the value of ranges between , for example, for a specific single-scale particle edge map, first calculate the local contrast values of all pixels in the map to obtain a set of original local contrast values, then determine the minimum value and the maximum value in this set. For any pixel with an original local contrast value , its normalized value is calculated as , if , then is set to 0.5. Taking actual numerical values as an example, if the minimum value of the original local contrast values of all pixels in the single-scale particle edge map is 0.1 and the maximum value is 0.9, then for a pixel with an original local contrast value , its normalized local contrast value is calculated as Thus, in this example, .
[0073] Calculation process:
[0074] For a specific pixel position in the single-scale particle edge map, the calculation process of its fusion response intensity value is as follows:
[0075] First, obtain the normalized local information entropy value and the normalized local contrast value of the pixel,
[0076] According to the example of the aforementioned parameter obtaining step, set and ,
[0077] Compute the sum of :
[0078] ;
[0079] Compute the absolute value of the difference of :
[0080] ;
[0081] Compute the square root of the absolute value:
[0082] ;
[0083] Compute the adjustment term in the denominator:
[0084] ;
[0085] Compute the complete denominator:
[0086] ;
[0087] Compute the ratio of the numerator to the denominator:
[0088] ;
[0089] Finally, compute the square root of the ratio to obtain the fusion response intensity value :
[0090] ;
[0091] The result shows that for the selected pixel position , its fusion response intensity value is about 0.645, which is a value between 0 and 1, representing the degree of significance or possibility of the pixel as part of the core component region of the traditional Chinese medicine powder particles. The higher the value, the stronger the significance of the pixel position.
[0092] According to the fusion response intensity value obtained in the previous step, these values together constitute the fusion response intensity map corresponding to the single-scale particle edge map. Next, the fusion response intensity map is processed. The first core step of pixel connectivity judgment is to apply a threshold to segment the fusion response intensity map and convert it into a binary image. The threshold, denoted as , can be set by methods such as Otsu automatic threshold method, which iterates through all possible thresholds and selects the one that maximizes the inter-class variance of the two classes of pixels (foreground and background) after segmentation as the best threshold For example, Otsu method is applied to a fusion response intensity map whose value range is , and the threshold value is calculated as Then, all the pixels with the fusion response intensity value greater than 0.62 are marked as foreground (potential salient pixels, assigned value 1), and the rest of the pixels are marked as background (non-salient pixels, assigned value 0), forming a binary saliency map. Subsequently, connected component analysis is performed on the binary saliency map to identify clusters of foreground pixels that are spatially connected. The connectivity rule is usually 8-connected, i.e., if two foreground pixels are adjacent in the horizontal, vertical, or diagonal direction, they belong to the same connected component. Each identified connected component is assigned a unique label by scanning the binary saliency map. This process determines whether to merge regions of spatially adjacent pixels that are both marked as foreground into an independent candidate region based on the fusion response intensity values (after thresholding). Each such connected component constitutes a preliminary salient region. The collection of all these identified and labeled connected components (i.e., preliminary salient regions) collectively forms the scale-intrinsic salient region map set of the single-scale particle edge map.
[0093] The acquisition step of the aligned spatial feature set is as follows:
[0094] Read the scale-intrinsic salient region map set, and sequentially parse the salient region boundary coordinate information and image resolution parameters in each single-scale salient region map. Convert the salient region boundary coordinates in each map to the spatial scale units corresponding to the original infrared spectrum image of traditional Chinese medicine powder, to generate the original coordinate scale mapping result.
[0095] According to the original coordinate scale mapping result, superimpose the region profile information converted to the original coordinate system in each single-scale salient region map onto the unified image space to form the region alignment superimposition map under the unified scale.
[0096] Based on the region alignment superimposition map under the unified scale, traverse all coordinate points in the original infrared spectrum image of traditional Chinese medicine powder, mark and extract the region response relationship corresponding to each coordinate point in different single-scale regions, and generate the aligned spatial feature set.
[0097] Specifically, read the scale-intrinsic salient region map set generated in the previous step. This map set 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 sequentially traverse each single-scale salient region map in this map set. For the currently selected single-scale salient region map, first parse the boundary coordinate information of each independent salient region. These boundary coordinates are usually represented as an ordered list of a series of pixel position points , where and This refers to the row and column numbers in the coordinate system of the single-scale salient region map. Simultaneously, the image resolution parameters of the single-scale salient region map are obtained. These parameters primarily refer to its scale factor relative to the original infrared spectral image of the traditional Chinese medicine powder. The determination of this scale factor is based on the decomposition level of the single-scale map during multi-scale decomposition (e.g., wavelet transform used in earlier steps). For example, if the size of the original infrared spectral image of the traditional Chinese medicine powder is... Pixels, while the currently processed single-scale salient region map corresponds to the wavelet decomposition of the . The layers, whose dimensions are correspondingly reduced to Then its scale factor is Specifically, if the original image is The pixel, the current single-scale salient region map is a product of the third-level decomposition, and its size is... Pixel, then the scale factor is After obtaining the boundary coordinates and scale factor, the boundary coordinates of each salient region in the single-scale salient region map are calculated. Coordinates converted to the original infrared spectral image of Chinese herbal medicine powder in the corresponding spatial scale units The conversion method is and (For example, if the image origin is the top left corner and there are no other translations or rotations), after transforming all boundary coordinates of all salient regions in the current single-scale salient region map, record these transformed coordinate information. This complete set of data containing the transformed boundary coordinates of all single-scale maps constitutes the original coordinate scale mapping result.
[0098] Based on the original coordinate scale mapping result generated in the previous step, this result contains the boundary coordinate information of all salient regions extracted from each single-scale salient region map and transformed to the coordinate system of the original Chinese medicine powder infrared spectral image. The next step is to superimpose these transformed region contour information into a unified image space. This unified image space is one with the same size as the original Chinese medicine powder infrared spectral image (e.g., if the original image is...). A pixel, then the unified image space is also A unified image space is typically initialized to all zeros before the overlay process begins. Then, each set of region contour information (i.e., the set of boundary cell coordinates transformed to the original coordinate system, corresponding to a salient region in a single-scale salient region map) from the original coordinate scale mapping result is processed sequentially. For each such region contour, its corresponding cell position in the unified image space is marked. There are various marking methods; a simple one is to mark all cells that constitute the boundary of the transformed contour in the unified image space. The value at the corresponding position is incremented by one. In this way, if multiple contour boundaries from different scales or regions coincide or are adjacent at the same position in the original image, the value at that position will accumulate accordingly. Another approach is to project each salient region (not just its contour) onto a corresponding layer in a unified image space or fill it with different label values. If the overlay contour is 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 that point, thus forming a region-aligned overlay map at a unified scale.
[0099] Based on the unified scale region-aligned overlay map formed in the previous step, which records the contours of all single-scale salient regions or the region itself in the spatial location of the original Chinese medicine powder infrared spectral image, the extraction of the regional response relationship at each coordinate point begins. Specifically, this involves systematically traversing every coordinate point in the original Chinese medicine powder infrared spectral image. For the coordinates of the currently traversed point It is necessary to determine its regional response relationship at various single scales. This regional response relationship refers to the determination of the coordinate point. To determine whether a region falls within a previously identified and mapped salient region from various single-scale salient region maps, it is necessary to refer to the original coordinate scale mapping results. This process not only transformed the boundary coordinates but also preserved the scale information of each salient region and its complete region extent in the original coordinate system (e.g., determining the pixels within the region using a polygon filling algorithm). Alternatively, one can refer to a region-aligned overlay map at a unified scale (if the map is multi-layered, with each layer representing a binary map of salient regions at a different scale). For each single scale (e.g., scale...),... Check coordinate points Is it located at this scale? If any salient region is specified below, then the point is within the scale. The response is "significant" (e.g., represented by a numerical value of 1), otherwise it is "insignificant" (e.g., represented by a numerical value of 0). After performing this judgment on all single scales, each coordinate point... A response vector is obtained, each dimension of which represents its response state in the corresponding single scale, and the multi-scale response vectors of all coordinate points are collected to form the alignment space feature set.
[0100] The acquisition step of the fusion saliency map is:
[0101] The alignment space feature set is read, and the fusion response intensity value of each pixel position in the saliency map in each scale is extracted. The fusion response intensity values of the same coordinate points in all scale images are traversed and marked as a multi-scale response sample set, and a multi-scale fusion response set with coordinate reduction is formed.
[0102] According to the multi-scale fusion response set, the composite intensity value of each pixel is calculated, and the calculation formula is:
[0103]
[0104] is the composite intensity value at the coordinate , is the fusion response intensity value of the coordinate in the kth scale, is the spatial gradient modulus value of the corresponding pixel of the coordinate point in the original traditional Chinese medicine powder infrared spectrum image, is the global average gradient modulus value of the image, is an empirical coefficient to prevent division by zero and fine-tune the denominator smoothness, is the number of scales of the saliency map. Based on the composite intensity value, the upper and lower limits of the saliency threshold interval are set, the pixels higher than the upper limit are selected as the core points in the saliency set and are regionally expanded, the adjacent response region boundaries in different scales are fused, the closed contour region is constructed, and the fusion saliency map is generated.
[0105] Specifically, the alignment space feature set generated in the previous step is read, and the feature set is marked with the corresponding regional response relationship in each different single scale (for example, a vector indicating whether the point belongs to the saliency region of each scale) for each coordinate point in the original traditional Chinese medicine powder infrared spectrum image.
[0106] In order to form the multi-scale fusion response set with coordinate reduction, the fusion response intensity value of each coordinate point in the original traditional Chinese medicine powder infrared spectrum image needs to be obtained in each analysis scale. The values are calculated in the previous steps, specifically, a "fusion response intensity map" is calculated for each single scale particle edge map before the "scale-wise salient region map set" is generated, which contains the fusion response intensity value of each pixel, here we need to extract data from these stored fusion response intensity maps corresponding to each scale (these maps have been aligned with the coordinate space of the "original infrared spectrum image of traditional Chinese medicine powder" by their "image resolution parameters" in the previous steps, or read according to these parameters in this step), the specific operation is, for any coordinate point , traverse all scales (where is the total number of scales, for example, if 3 wavelet decomposition levels are used and each level's detail subband is processed, then may be or determined according to the actual number of scale maps selected), in the (aligned) fusion response intensity map corresponding to the th scale ( from 1 to ), read the fusion response intensity value of the coordinate point , collect these fusion response intensity values , this value set is the multi-scale response sample set of the coordinate point , perform this extraction and collection process for all coordinate points in the original infrared spectrum image of traditional Chinese medicine powder, finally collect the multi-scale response sample set of all coordinate points to form the multi-scale fusion response set aligned with the coordinates.
[0107] Formula: The formula is beneficial in that it integrates multi-scale information and local structure information of the original image to calculate a more robust composite saliency strength, the first part effectively integrates the saliency contribution from different scales by averaging the squares of the fusion response intensity values, the square operation enhances the weight of stronger responses, and the average considers the overall performance of all scales, the second part introduces the gradient information of the original image as a modulation factor, where is the local gradient modulus value of the current pixel, is the global average gradient modulus value, this term makes the composite strength in the image edge or texture-rich area (relatively high gradient value) enhanced, and has less effect in the smooth area (relatively low gradient value), The addition of ensures the stability of the denominator. The product of the two parts is then squared, which aims to balance the multi-scale consistent response and local image structure characteristics, thereby more accurately locating the core component region of Chinese medicine powder and avoiding the one-sidedness of a single scale or a single feature.
[0108] parameter The steps to obtain it are as follows:
[0109] parameter Represents the coordinates in the original infrared spectral image of Chinese herbal medicine powder. Place, No. The fusion response intensity values at each scale are derived from the calculation and normalization of the particle edge map at each single scale in the preceding steps (typically with a value range of...). The obtained fusion response intensity map has been extracted and organized during the formation of the "multi-scale fusion response set with coordinate normalization", that is, for each coordinate point ,from Read the corresponding values from the fusion response intensity maps at different scales. Values, for example, for coordinate points If there are 3 scales ( Its fusion response intensity value at scale 1 is At scale 2, At scale 3, These values constitute the multiscale fusion response intensity required for that point in the formula.
[0110] parameter The steps to obtain it are as follows:
[0111] parameter This represents the number of scales of the salient region map used for analysis. This number is fixed when the multi-scale decomposition strategy (e.g., the number of decomposition layers and direction selection of wavelet transform) is determined. It corresponds to the total number of "single-scale particle edge maps" or "fusion response intensity maps" actually generated in the preceding steps and used to extract the fusion response intensity values. For example, if a 3-layer wavelet transform is used, and all detail subbands (horizontal, vertical, and diagonal) of each layer are selected for subsequent processing, then... In this example, the number of scales is set. .
[0112] parameter The steps to obtain it are as follows:
[0113] parameter This indicates the coordinates of the points in the original infrared spectrum image of the Chinese herbal medicine powder. The spatial gradient magnitude 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, the gradient magnitude is calculated using... Sobel horizontal core and vertical core Perform convolution to obtain the horizontal gradient components. and vertical gradient components Then the spatial gradient magnitude For example, for a certain pixel in the original image If it is calculated using the Sobel operator and Then its spatial gradient magnitude .
[0114] parameter The steps to obtain it are as follows:
[0115] parameter The global average gradient magnitude represents the original infrared spectral image of the Chinese herbal medicine powder, after calculating the spatial gradient magnitude of each pixel in the image. Then, sum all these gradient magnitudes and divide by the total number of pixels in the image to obtain the result. ,Right now ,in and These are the height and width of the image, for example, for an image... The original image of pixels, first calculate all The spatial gradient magnitudes of pixels, if the sum of these gradient magnitudes is Then the global average gradient magnitude .
[0116] parameter The steps to obtain it are as follows:
[0117] parameter It is an empirical coefficient, mainly used to prevent the global average gradient magnitude from being too large. When the value is extremely small or zero, a division-by-zero error occurs in the denominator, and the smoothness of the denominator is fine-tuned. This value is typically selected empirically or by testing on a small number of representative sample images within a small parameter range (e.g., 0.1 to 10) and evaluating the stability of the final result. Here, we set... This selection was based on testing on infrared spectral images of 20 different traditional Chinese medicine powders, and it was found that... When the values are generally small (e.g., less than 5), Effectively avoid gradient terms This produces excessively large values while ensuring the effective introduction of gradient information.
[0118] Calculation process:
[0119] Targeting specific pixel locations in the original infrared spectral image of traditional Chinese medicine powder the composite intensity value The calculation process is as follows,
[0120] According to the example of the aforementioned parameter acquisition step, the parameter values are set as follows:
[0121] ;
[0122] For the current pixel , the fusion response intensity values at 3 scales are respectively , , ,
[0123] The spatial gradient modulus value of the pixel in the original image ,
[0124] The global average gradient modulus value of the original image ,
[0125] Empirical coefficient ,
[0126] First, the square mean value term of the multi-scale fusion response intensity value is calculated:
[0127] ;
[0128] ;
[0129] ;
[0130] ;
[0131] Next, the gradient modulation term is calculated:
[0132] ;
[0133] ;
[0134] ;
[0135] Then, the two terms are multiplied:
[0136] ;
[0137] ;
[0138] Finally, the square root is calculated to obtain the composite intensity value :
[0139] ;
[0140] The result shows that for the selected pixel position Its composite strength value The value is approximately 1.149. This value reflects the overall saliency of the pixel after combining its multi-scale saliency response and its gradient characteristics in the original image. The value was not forcibly constrained. Within the interval, its absolute magnitude depends on the specific values of each input parameter; higher values indicate a greater magnitude. The value indicates that the pixel is highly likely to belong to the core component region of the Chinese medicine powder, because it either exhibits a strong fusion response at multiple scales, or it is located in a structurally significant region of the image (such as an edge), or both. These composite intensity values will form a composite intensity map, which will be used for subsequent thresholding and region localization.
[0141] The composite intensity value of each pixel calculated in the previous step These values collectively constitute a composite intensity map covering the entire infrared spectral image space of the original Chinese medicine powder. This composite intensity map is then processed to generate a fused saliency map. The processing begins by setting the upper limit of the saliency threshold range. and lower limit Setting these two thresholds is a crucial step; for example, they can be based on composite intensity values calculated from a batch (e.g., 30) of representative images. Determined by statistical distribution, 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 this 90th percentile is calculated to be... ,but ,and It can then be set as The 75th percentile of the value distribution, or set as A fixed ratio, for example After setting a threshold, all pixels in the composite intensity map are traversed, and composite intensity values are selected. Higher than The pixels are identified and marked as significant focal points. Then, a region expansion is performed starting from these focal points, following the rule that pixels surrounding the focal points (e.g., using 8-connected neighborhoods) with a composite intensity value... Higher than If a cell meets the condition, it is absorbed into the current salient region. This expansion process is repeated iteratively until no more cells that meet the condition can be added to any salient region. In this way, not only are the boundaries of regions with neighboring responses at different scales merged (because...) The closed contour region is further constructed by region expansion. The closed regions formed by screening, expansion and integration constitute the final fusion saliency map.
[0142] The initial candidate region set is obtained by:
[0143] The fusion saliency map is read, and the composite intensity values corresponding to each pixel position in the fusion saliency map are traversed one by one. The numerical distribution of the composite intensity values of all pixel positions in the fusion saliency map is counted, and the median of the overall distribution of the composite intensity values is calculated as a fixed segmentation threshold to obtain the fixed segmentation threshold.
[0144] According to the fixed segmentation threshold, all pixel positions in the fusion saliency map are traversed, and it is judged whether the composite intensity value at each pixel position exceeds the fixed segmentation threshold. The pixel positions exceeding the fixed segmentation threshold are marked as effective saliency positions, and all effective saliency positions are merged and marked in the binary mask image to generate a binary saliency mask image.
[0145] According to the binary saliency mask image, pixel connectivity analysis is performed on all effective saliency positions, and a group of effective saliency positions that are spatially adjacent and continuously distributed is identified. The boundary contour of the connected region is drawn to form an initial candidate region set.
[0146] Specifically, the fusion saliency map generated in the previous step is read, which contains the composite intensity value corresponding to each pixel position in the image . Next, each pixel in the fusion saliency map is traversed one by one, and its composite intensity value is extracted. All composite intensity values of the pixels are collected to form a numerical list. For example, if the size of the fusion saliency map is pixels, there will be composite intensity values collected. Subsequently, statistical analysis is performed on the numerical list containing the composite intensity values of all pixel positions to determine the numerical distribution. The specific statistical process includes sorting the composite intensity values from low to high. After sorting, the median of the overall distribution is calculated. If the total number of composite intensity values is odd, the value at the th position after sorting is the median. If is even, the median is the arithmetic mean of the two values at the th and th positions after sorting. For example, for a fusion saliency map containing pixels, after collecting and sorting the 100 composite intensity values, 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 example) was adopted and set as the fixed segmentation threshold.
[0147] Based on the fixed segmentation threshold calculated in the previous step, and the original fused saliency localization map (which stores the composite intensity value at each pixel location), Next, the system will traverse all cell locations in the fused saliency localization map, and for each cell location... The judgment operation is performed, specifically judging the composite intensity value at the pixel location. Compared with a 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 location is determined to be a valid salient location. Conversely, if its composite intensity value is less than or equal to the fixed segmentation threshold, the pixel location is considered a non-salient location. For example, if the fixed segmentation threshold is 0.79 and the composite intensity value of a pixel is 0.85, since 0.85 is greater than 0.79, the pixel is marked as a valid salient location. 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 location. After judging and marking all pixels, all pixels marked as valid salient locations are merged and recorded into a new binary mask image. In this binary mask image, the pixel value of the valid salient location is set to 1 (or foreground value, such as 255), and the pixel value of the non-salient location is set to 0 (or background value), thereby generating a binary salient mask image covering the entire image area.
[0148] According to the binary saliency mask map generated in the previous step, which clearly indicates all the pixels (value 1) of the effective saliency position and the pixels (value 0) of the non-saliency position, the next step is to perform pixel connectivity analysis on all the effective saliency positions in the binary saliency mask map. The purpose of this analysis is to identify and combine groups of effective saliency positions that are spatially adjacent and continuously distributed, forming independent regions. Connectivity analysis uses specific neighborhood rules, such as setting the 8-connection rule, which means that if two effective saliency positions are adjacent in the horizontal, vertical, or diagonal direction, they are considered to be connected. By applying a connected component labeling algorithm such as a queue-based scan line algorithm or a double-pass scan algorithm, each pixel in the binary saliency mask map is traversed, and a unique digital label is assigned to each independent group of connected effective saliency positions (i.e., connected components). After identifying these connected regions, further boundary contouring is performed for each connected region. Boundary contouring can be achieved through algorithms such as the Moore-Neighbor Tracing algorithm or the Radial Scan algorithm, which trace the outermost effective saliency positions of each connected region to form a closed sequence of coordinate points representing the region's contour. All these independent regions identified through connectivity analysis and boundary contouring form the initial candidate region set.
[0149] The steps for obtaining the core component area of traditional Chinese medicine powder are as follows:
[0150] Read the initial candidate region set, and count the total number of pixels of the effective saliency positions contained in each candidate region in the initial candidate region set. Record the total number of pixels counted as the effective pixel number of the region, and form a candidate region pixel number list.
[0151] According to the candidate region pixel number list, compare the effective pixel number of each candidate region with the preset lower limit of the region pixel number one by one to determine whether the effective pixel number of each candidate region reaches or exceeds the lower limit of the pixel number. Keep the candidate regions that reach or exceed the lower limit of the pixel number, and remove the candidate regions that are below the lower limit of the pixel number, to generate a subset of qualified candidate regions.
[0152] According to the subset of qualified candidate regions, analyze and label the boundary coordinates of each qualified candidate region, determine the center point position of the region, and draw the boundary contour of the region in the original infrared spectrum image of traditional Chinese medicine powder, to generate the core component area of traditional Chinese medicine powder.
[0153] Specifically, the initial candidate region set generated in the previous step is read, which contains the individual regions identified by the connectivity analysis and their boundary contour information, and then the total number of pixels of the effective salient position in each candidate region in the initial candidate region set is counted. Specifically, for a candidate region, first determine all the pixels of the effective salient position that constitute the region, which are the pixels marked as foreground (for example, value 1) in the "binary saliency mask" generated in the "binary saliency mask" step, and then count the total number of these pixels to obtain the total number of pixels of the effective salient position in the candidate region. For example, if a particular candidate region covers 150 pixels with a value of 1 on the "binary saliency mask", the total number of pixels of the effective salient position in the region is 150. Record the total number of pixels obtained by counting each candidate region as the effective pixel number of the region, and associate this value with the unique identifier of the candidate region (for example, the label number assigned in the connectivity component labeling process). Perform this counting and recording operation on all candidate regions in the initial candidate region set to ultimately form a candidate region pixel number list that lists each initial candidate region and its corresponding effective pixel number.
[0154] According to the candidate region pixel number list formed in the previous step, which records the total number of pixels of each initial candidate region and its effective pixel number, the candidate regions are then screened based on a comparison of their effective pixel number with a preset lower limit of the region pixel number. This preset lower limit of the region pixel number is a key parameter, and its setting aims to exclude regions that are too small in size and thus unlikely to represent the true core components of traditional Chinese medicine powder. For example, this lower limit value can be determined by pre-experimental analysis of a large number of (such as 50) similar infrared spectrum images of traditional Chinese medicine powder, observing and counting the minimum pixel area of the typical core component region confirmed by experts, and combining the image acquisition resolution and the physical size of the particles. If the analysis shows that the minimum particle component of interest is usually not less than 30 pixels in coverage area at the current image resolution, the preset lower limit of the region pixel number 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 its recorded effective pixel number is compared with the preset lower limit of the region pixel number (for example, 30 pixels). If the effective pixel number of a candidate region reaches or exceeds the lower limit (for example, a region has 45 pixels, and since 45 is greater than or equal to 30, it is retained), the candidate region is retained. If the effective pixel number of a candidate region is lower than the lower limit (for example, a region has 20 pixels, and since 20 is less than 30, it is removed), the candidate region is removed. All retained candidate regions together form a subset of qualified candidate regions.
[0155] According to the qualified candidate region subset obtained after the screening of the previous step, the subset contains all candidate regions whose effective pixel number reaches the preset lower limit, and then the final analysis, marking and visualization processing are performed on each qualified candidate region in the subset. First, for each qualified candidate region, the boundary coordinates thereof are accurately analyzed. These boundary coordinate information is obtained through the boundary contour drawing step when the "initial candidate region set" is formed, and is usually represented as an ordered list of pixel positions defining the outer boundary of the region Meanwhile, the center point position of each qualified candidate region is determined. The calculation of the center point position can adopt the method of geometric moments, that is, the arithmetic mean of all pixel coordinates constituting the region is calculated. Specifically, if a qualified candidate region is composed of pixels, the coordinates of each pixel are (where from 1 to ), then the center point coordinates are the sum of all divided by and the sum of all divided by , for example, a qualified candidate region composed of pixels , , , , , , After the boundary coordinates and center point position of each qualified candidate region are determined, these information is used to mark on the original infrared spectrum image of traditional Chinese medicine powder. Specifically, the boundary contour of each qualified candidate region is accurately drawn to the corresponding position on the original image. These regions marked on the original image and screened by size constitute the final identified core ingredient region of traditional Chinese medicine powder.
[0156] The above is only a preferred embodiment of the present application, and does not limit the present application in other forms. Any skilled person in the art can modify or change the above disclosed technical content to equivalent embodiments applied to other fields, but any simple modification, equivalent change and modification made according to the technical essence of the present application to the above embodiments still falls within the protection scope of the present application.
Claims
1. A method for infrared analysis of traditional Chinese medicine powder based on image recognition, characterized in that, Includes the following steps: Frequency separation was performed on the infrared spectral images of Chinese herbal medicine powder, and the edge intensity values of each frequency layer used to characterize the particle outline of Chinese herbal medicine powder were integrated to obtain a multi-scale particle edge map. For each single-scale edge map in the multi-scale particle edge map set, the local information entropy and local contrast of the pixel neighborhood are calculated to obtain pixel statistical feature data. Based on the pixel statistical feature data, a combination operation is performed to generate a salient region map set within the scale. Read the salient region atlas within the scale, project each single-scale salient region map onto the unified spatial coordinates of the original Chinese medicine powder infrared spectral image to obtain an aligned spatial feature set, and generate a fused salient localization map based on the aligned spatial feature set; Analyze the fused saliency localization map, set a fixed segmentation threshold, identify connected pixel clusters above the fixed segmentation threshold, obtain an initial candidate region set, and based on the initial candidate region set, judge and filter by comparing with the preset lower limit of the number of pixels in the region, extract and label the core component region of the traditional Chinese medicine powder; The steps for obtaining the multi-scale particle edge map are as follows: Read the infrared spectrum image of Chinese medicine powder, and perform frequency separation on the infrared spectrum image of Chinese medicine powder. The separation process adopts a fixed frequency division standard to divide the frequency domain range proportionally and extract the corresponding frequency information to generate a multi-frequency layer image set. Based on the multi-frequency layer image set, the edge regions of the Chinese medicine powder particles shown in each frequency layer image are extracted, the edge gradient of the Chinese medicine powder particle edge regions is calculated and the edge gradient value is statistically analyzed, and the edge gradient value is used as the edge intensity value to represent the edge intensity map set of Chinese medicine powder particles. Based on the set of edge intensity maps of 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 merged to generate a unified structure map set, and a multi-scale particle edge map set is generated. The steps for obtaining the fused saliency localization map are as follows: Read the alignment space feature set, extract the fusion response intensity value for each pixel position in the salient region map within each scale, traverse the fusion response intensity values of the same coordinate points in all scale images and mark them as a multi-scale response sample set, forming a multi-scale fusion response set with coordinate normalization. Based on the multi-scale fusion response set, calculate the composite intensity value of each pixel; Based on the composite intensity value, an upper and lower limit of the salience threshold range are set. Pixels with values higher than the upper limit are selected as salience concentration core points and the region is expanded. The boundaries of the adjacent response regions at different scales are fused to construct a closed contour region and generate a fused salience localization map. The steps for obtaining the initial candidate region set are as follows: Read the fused saliency localization map, iterate through the composite intensity value corresponding to each pixel position in the fused saliency localization map one by one, statistically analyze the numerical distribution of composite intensity values of all pixel positions in the fused saliency localization map, calculate the median of the overall distribution of composite intensity values as a fixed segmentation threshold, and obtain the fixed segmentation threshold. Based on the fixed segmentation threshold, all pixel positions in the fused saliency localization map are traversed, and it is determined whether the composite intensity value at each pixel position exceeds the fixed segmentation threshold. Pixel positions that exceed the fixed segmentation threshold are marked as valid saliency positions. All valid saliency positions are merged and marked in the binary mask image to generate a binary saliency mask image. Based on the binary saliency mask, pixel connectivity analysis is performed on all effective saliency locations to identify groups of effective saliency locations that are spatially adjacent and continuously distributed. The boundary contours of the connected regions are drawn to form an initial set of candidate regions.
2. The method for infrared analysis of traditional Chinese medicine powder based on image recognition according to claim 1, characterized in that, The steps for obtaining the pixel statistical feature data are as follows: Each single-scale particle edge map in the multi-scale particle edge map set is read one by one. For each single-scale particle edge map, the position coordinates of the pixel to be analyzed are determined, the local neighborhood range corresponding to the coordinates of the pixel to be analyzed is located, all pixel values within the local neighborhood range are extracted, and a set of values of the neighborhood region of the pixel to be analyzed is generated. Based on the set of values in the neighborhood of the pixel to be analyzed, the probability distribution of the values of each pixel in the neighborhood is calculated one by one. Based on the probability distribution, the uncertainty of the value distribution in the neighborhood of the pixel is calculated one by one to obtain the information entropy value of the neighborhood of the pixel to be analyzed and generate a set of local information entropy of the pixel. Based on the set of values in the neighborhood region of the pixel to be analyzed, the absolute value of the difference between the value of the central pixel in the neighborhood region and the values of other pixels in the neighborhood is calculated one by one, and the absolute values of the difference are summarized to quantify the degree of value change in the neighborhood. The local contrast value of the neighborhood region of the pixel to be analyzed is obtained, and the set of local information entropy of the pixel and the local contrast value are integrated to form the pixel statistical feature data.
3. The method for infrared analysis of traditional Chinese medicine powder based on image recognition according to claim 1, characterized in that, The steps for obtaining the atlas of salient regions within the specified scale are as follows: Based on the pixel statistical feature data, the coordinates of all pixels in each single-scale particle edge image are read sequentially, 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 image and normalized local contrast image of each image. The fusion response intensity value of each pixel is calculated based on the normalized local information entropy map and the normalized local contrast map. Based on the fusion response intensity map formed by the fusion response intensity values, pixel connectivity is determined, and adjacent boundary regions are merged based on the fusion response intensity values to generate a salient region atlas within the scale.
4. The method for infrared analysis of traditional Chinese medicine powder based on image recognition according to claim 1, characterized in that, The steps for obtaining the alignment space feature set are as follows: Read the salient region atlas within the scale, and sequentially parse the salient region boundary coordinates and image resolution parameters in each single-scale salient region map. Convert the salient region boundary coordinates in each map into the spatial scale units corresponding to the original Chinese medicine powder infrared spectrum image to generate the original coordinate scale mapping result. Based on the original coordinate scale mapping results, the region contour information that has been transformed to the original coordinate system in each single-scale salient region map is superimposed onto a unified image space to form a region-aligned superimposed map under a unified scale. Based on the region alignment overlay map at the unified scale, all coordinate points in the original infrared spectral image of Chinese herbal medicine powder are traversed, and the region response relationship corresponding to each coordinate point in different single scales is marked and extracted to generate an alignment spatial feature set.
5. The method for infrared analysis of traditional Chinese medicine powder based on image recognition according to claim 1, characterized in that, The steps for obtaining the core component region of the traditional Chinese medicine powder are as follows: Read the initial candidate region set, count the total number of pixels at effective salient positions in each candidate region in the initial candidate region set, record the total number of pixels counted as the effective pixel count of the region, and form a list of pixel counts for candidate regions. Based on the candidate region pixel count list, each candidate region is compared with the preset lower limit of region pixel count to determine whether the effective pixel count of each candidate region reaches or exceeds the lower limit of pixel count. Candidate regions that reach or exceed the lower limit of pixel count are retained, and candidate regions that are below the lower limit of pixel count are removed to generate a qualified candidate region subset. Based on the qualified candidate region subset, the boundary coordinates of each qualified candidate region are parsed and marked, the location of the region center point is determined, and the region boundary contour is drawn in the original infrared spectrum image of the Chinese medicine powder to generate the core component region of the Chinese medicine powder.
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