Image data processing method and system, computer equipment and storage medium
By combining boundary pixel data and optical characteristic analysis in image processing, morphology and light compensation are adjusted, the problems of poor adaptability of local pixel density changes and neglected spectral reflectivity differences in the prior art are solved, and higher target contour accuracy and classification stability are achieved.
Patent Information
- Application Number
- CN202510367847.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, in image target boundary processing, morphology matching, light compensation and motion analysis, there are areas with poor adaptability of local pixel density changes, large noise interference, neglected spectral reflectivity differences, similar motion patterns but different optical properties, which leads to an increase in recognition error rate and instability of analysis results.
By obtaining the boundary pixel data of the image target, calculating the boundary gradient changes and local pixel density changes, judging the morphological offset direction and amplitude, extracting the area with the largest offset, setting the local morphological adjustment weight, calculating the direction compensation value, and adjusting the image target outline. At the same time, based on the morphological compensation data set, the illumination gradient and spectral reflectance are calculated, the optical characteristics differences are analyzed, the dynamic illumination compensation parameters are calculated, and the illumination matching error is optimized. Combined with motion trajectory analysis, the boundary value of the separation of the image target area is obtained, the priority of classification matching is adjusted, the classification weight is corrected, and the image target classification results are finally obtained.
It improves the accuracy, optical matching and classification stability of the target profile, enhances the recognition reliability in complex environments, and reduces the recognition error rate.
Smart Images

Figure CN119887816A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image technology, and in particular to an image data processing method, system, computer equipment and storage medium. Background Art
[0002] The field of image processing technology includes the acquisition, analysis, transformation and application of digital image data. Its core content includes image acquisition, storage, compression, enhancement, recognition, segmentation and reconstruction technologies. This technical field covers the acquisition of raw image data from image acquisition devices, and processing through mathematical transformation, filtering, histogram equalization and other means to make the image data suitable for different application requirements. Image processing technology is widely used in computer vision, medical image analysis, remote sensing monitoring, industrial detection and other fields, often involving specific image feature extraction, edge detection, pattern matching and object recognition. With the improvement of hardware performance and the development of algorithm optimization, image processing methods continue to evolve, gradually moving towards higher precision and lower computational complexity.
[0003] Among them, the image data processing method refers to the processing steps and operation methods for image data, involving data acquisition, transformation, storage and analysis. This method is usually based on mathematical methods such as multi-channel filtering, image matrix operations, pixel-level calculations, Fourier transforms, etc., to perform denoising, feature extraction, boundary detection or color correction on the input image data. For example, in the image denoising process, Gaussian filtering or median filtering is used to smooth the image to reduce noise interference; in the feature extraction link, gradient operations or edge detection operators are used to obtain the contour information of the image; in the image color adjustment process, the brightness, contrast or saturation is adjusted with the help of color space transformation methods. This method performs specific processing on the image data according to preset calculation steps for subsequent analysis or application.
[0004] In terms of image target boundary processing, existing technologies mostly rely on edge detection operators to extract contour information, but they have poor adaptability to changes in local pixel density and are easily disturbed by noise, resulting in inaccurate boundary extraction results. In the morphological matching process, morphological offset analysis is usually performed through feature point comparison, but the gradient changes in the local area are not fully considered, resulting in errors in the judgment of the offset direction and amplitude. In terms of illumination compensation, optical characteristics are mostly corrected by global brightness adjustment or color space transformation, ignoring the difference in spectral reflectance between the target and the occluder, resulting in the target area being easily confused with the background in a complex lighting environment. In the motion analysis link, existing methods mainly rely on trajectory features for target separation, but fail to effectively combine optical properties, resulting in areas with similar motion patterns but different optical properties being difficult to remove, affecting the accuracy of the target contour. In terms of target classification, matching is mostly based on morphological features, ignoring the impact of optical independence, resulting in low stability of target classification in environments with large illumination changes. These problems are likely to lead to an increase in recognition error rate in complex application scenarios, affecting the reliability of the final analysis results. Summary of the invention
[0005] The purpose of the present invention is to solve the shortcomings of the prior art and to propose an image data processing method, system, computer device and storage medium.
[0006] In order to achieve the above object, the present invention adopts the following technical solution: an image data processing method, comprising the following steps: S1: Obtain the pixel data of the image target boundary, calculate the boundary gradient change data and the local pixel density change data, determine the direction and amplitude of the morphological offset, extract the area with the maximum offset, set the local morphological adjustment weight, calculate the direction compensation value, adjust the image target contour, calculate the contour matching difference, and generate the morphological compensation data set; S2: Based on the morphological compensation data set, calculate the illumination gradient of the image target area, extract the spectral reflectance, analyze the difference in optical characteristics between the image target and the obstruction, calculate the dynamic illumination compensation parameters based on the illumination change trend, analyze the illumination matching error, and extract the illumination matching data set; S3: Calculate the optical characteristic vector of the image target area according to the illumination matching data set, compare the spectral feature difference between the image target and the obstruction, analyze the optical independence of the image target area, calculate the motion trajectory difference of the image target area, and obtain the separation boundary value of the image target area; S4: combining the image target region separation boundary value with the morphological compensation data set, calculating the compensated matching score, adjusting the image target region classification matching priority, correcting the classification weight, and obtaining the image target classification result.
[0007] As a further solution of the present invention, the specific steps of S1 are: S101: Obtain boundary pixels of the target area of the image, calculate the gradient change value of the boundary pixels, and count the pixel density change value in the local area, calculate the matching deviation value of the image target morphology according to the pixel density change value and the gradient change value, and judge the morphology deviation direction and amplitude of the target area according to the matching deviation value to obtain morphology deviation data; S102: Based on the morphological offset data, calculating the offset gradient of the local area, extracting the area with the largest offset, setting the local morphological adjustment weight, calculating the direction compensation value according to the morphological adjustment weight, and adjusting the contour of the target area of the image in combination with the direction compensation value to obtain the contour morphological adjustment value; S103: Calculate the contour matching difference based on the contour morphology adjustment value, analyze the morphology change characteristics of the local area in combination with the contour matching difference, screen the offset contour area, calculate the morphology compensation strength of the offset area, and establish a morphology compensation data set in combination with the regional compensation strength.
[0008] As a further solution of the present invention, the specific steps of S2 are: S201: Obtain the illumination intensity of the target area in the morphological compensation data set, calculate the illumination change rate of adjacent pixel points in the horizontal and vertical directions, screen the gradient mutation area, calculate the gradient change trend according to the numerical difference of adjacent gradient points, and obtain the illumination gradient value of the target area of the image; S202: Based on the illumination gradient value of the target area of the image, the spectral reflectance of the pixel points in the target area within the difference wavelength range is calculated, the area with poor reflectance is screened, the spectral reflectance deviation value of the target and the obstruction is calculated, and the difference in optical characteristics of the target and the obstruction is obtained in combination with the illumination gradient change; S203: Based on the difference in optical properties between the target and the obstruction, the illumination intensity variation range is calculated, illumination compensation data is calculated according to the illumination intensity variation and the spectral reflectance deviation, and the illumination matching error between regions is calculated in combination with the morphological compensation information to obtain an illumination matching data set.
[0009] As a further solution of the present invention, the specific calculation formula for the spectral reflectance deviation value between the calculated target and the obstruction is: ; Calculate the spectral reflectance deviation value, and combine the light gradient change to obtain the difference in optical properties between the target and the obstruction; in, Represents the wavelength between the target and the obstruction The spectral reflectance deviation value at Represents pixel At wavelength The light gradient value at Represents pixel The target area is at wavelength The spectral reflectance at Represents pixel The obstruction area is at wavelength , where n represents the total number of pixels selected in the target area and the occluder area. Represents the sum of the illumination gradient values of all selected pixels within the wavelength range.
[0010] As a further solution of the present invention, the specific steps of S3 are: S301: Acquire the illumination matching data set, extract the optical characteristic data of all pixels in the target area, calculate the spectral intensity of the pixels under different wavelengths, and count the numerical distribution range of the illumination characteristics in the area to obtain the distribution information of the optical characteristic data of the target area of the image; S302: Based on the optical characteristic data distribution information of the target area of the image, combined with the optical characteristic data of the area corresponding to the obstruction, the reflectivity ratio of the wavelength of the target area and the obstruction area is calculated, and the spectral deviation is calculated according to the spectral energy distribution, and the change trend of the spectral deviation in the difference band is analyzed to determine the degree of independence of the spectral characteristics of the target area compared with the obstruction, and obtain the optical independence value of the target area of the image; S303: Based on the optical independence value of the image target area and the motion trajectory data of the image target area, the degree of motion trajectory deviation between the target area and the occlusion area is calculated, and the boundary range of the target area is adjusted according to the optical independence value. The optical characteristic changes of the target area and the background area are compared, and the spectrum and motion characteristic change rate of the edge area are calculated. The boundary point of the target area and the background area is obtained according to the change rate to obtain the separation boundary value of the image target area.
[0011] As a further solution of the present invention, the specific steps of S4 are: S401: obtaining the separation boundary value of the target area of the image, calculating the gradient change, continuity and closure level of the boundary pixels, screening the area that meets the integrity requirements, adjusting the morphology of the boundary contour pixels based on the screened boundary value, establishing compensated boundary contour data, calculating the matching error after morphology compensation, and generating a matching error value; S402: Based on the matching error value, the classification matching priority of the target area is calculated, and the optical features, including light intensity balance, color gradient and reflection level, are extracted. In combination with the separation boundary value of the target area, the optical contrast, boundary optical gradient and the degree of influence of light interference are calculated to obtain the optical contrast priority value; S403: Based on the optical contrast priority value, adjust the target area classification standard, calculate the classification weight correction value, correct the classification data of the target area according to the matching error value and the optical independence value, screen the area that meets the classification correction requirements, and obtain the image target classification result.
[0012] As a further solution of the present invention, the specific calculation formula for calculating the classification weight correction value is: ; Calculate the classification weight correction value, combine it with the optical independence value, correct the classification data of the target area, select the area that meets the classification correction requirements, and obtain the image target classification result; in, Represents the classification weight correction value, Representative The optical contrast priority value of each target area, Representative The matching error value of the target area, Representative The optical independence value of the target area, Representative The initial classification standard value of the target area, Represents the total number of target areas.
[0013] An image data processing system, the image data processing system is used to execute the above-mentioned image data processing method, the image data processing system comprises: The morphological matching adjustment module obtains the pixel values at the boundary of the target area, calculates the gradient change rate of adjacent pixels, counts the pixel density change per unit area, calculates the morphological matching deviation value, determines the offset direction and amplitude, extracts the area with the maximum offset based on the local offset gradient value, sets the morphological adjustment weight, calculates the direction compensation value, adjusts the boundary contour of the target area, calculates the adjusted contour matching difference, and obtains the morphological compensation data set; The illumination matching optimization module calculates the illumination intensity gradient value of the target area based on the morphological compensation data set, extracts the surface spectral reflectance, calculates the difference in optical properties between the target area and the obstruction, calculates the dynamic illumination compensation parameters according to the illumination change trend, and constructs an illumination matching error model in combination with the morphological compensation data set to obtain an illumination matching data set; The optical characteristic analysis module calculates the optical characteristic vector of the target area based on the illumination matching data set, compares the spectral feature difference between the target area and the obstruction, calculates the optical independence, analyzes the motion trajectory deviation value, and obtains the separation boundary value of the image target area; The target classification correction module calculates the target area matching score based on the image target area separation boundary value and the morphological compensation data set, adjusts the classification matching priority, calculates the optical independence score according to the target area separation boundary value, corrects the target classification weight, and obtains the image target classification result.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are: In the present invention, local pixel density fluctuations are captured by extracting boundary pixels and calculating gradient changes, making the target morphology adjustment more accurate. The optical matching of the target area is improved by combining the light intensity gradient and spectral reflectance extraction. In the motion trajectory analysis, the target contour separation accuracy is optimized. Based on the separation boundary value and morphology compensation data, the recognition accuracy is improved. The overall solution enhances the target contour accuracy, optical adaptability and classification stability, and maintains high recognition reliability in complex environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a schematic diagram of the steps of the present invention; Figure 2 It is a system module diagram of the present invention. DETAILED DESCRIPTION
[0016] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with 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.
[0017] See also Figure 1 , an image data processing method, comprising the following steps: S1: Obtain the image target boundary pixels, calculate the boundary gradient change value, count the local pixel density change, calculate the image target morphology matching deviation value, determine the morphology offset direction and amplitude, calculate the local area offset gradient, extract the maximum offset area, set the local morphology adjustment weight, calculate the direction compensation value, adjust the image target area contour, calculate the contour matching difference, and generate the morphology compensation data set; S2: According to the morphological compensation data set, calculate the illumination intensity gradient value of the image target area, extract the spectral reflectance of the image target surface, calculate the difference in optical characteristics between the image target and the obstruction, calculate the dynamic illumination compensation parameters of the image target area based on the illumination change trend, combine the morphological compensation information, analyze the illumination matching error, and extract the illumination matching data set; S3: Based on the illumination matching data set, the optical characteristic vector of the image target area is calculated, the spectral characteristic difference between the image target and the occluder is compared, the optical independence of the image target area is analyzed, the motion trajectory difference of the image target area is calculated, the area with the same motion pattern but different optical characteristics is eliminated, the image target contour is corrected, and the separation boundary value of the image target area is obtained; S4: Based on the image target area separation boundary value and the morphological compensation data set, the compensated image target area matching score is calculated, the image target area classification matching priority is adjusted, the optical independence score of the image target area is calculated according to the image target area separation boundary value, the image target classification standard is adjusted, the image target classification weight correction value is calculated, and the image target classification result is obtained.
[0018] The morphological compensation data set includes boundary gradient change values, local pixel density changes, morphological matching deviation values, morphological offset direction and amplitude, local area offset gradient, maximum offset area, local morphological adjustment weight, direction compensation value, and contour matching difference. The illumination matching data set includes illumination intensity gradient values, surface spectral reflectance, optical property differences, dynamic illumination compensation parameters, and illumination matching error models. The image target area separation boundary values include corrected image target contours, optical independence analysis results, motion trajectory differences, and exclusion area ranges. The image target classification adjustment values include matching scores, classification matching priorities, optical independence scores, classification standards, and classification weight correction values.
[0019] The specific steps of S1 are: S101: Obtain boundary pixels of the target area of the image, calculate the gradient change value of the boundary pixels, and count the pixel density change value in the local area, calculate the matching deviation value of the image target morphology according to the pixel density change value and the gradient change value, and judge the morphology deviation direction and amplitude of the target area according to the matching deviation value to obtain morphology deviation data; Get the boundary pixels of the target area of the image. First, extract the contour information of the target area through the edge detection algorithm. The Canny edge detection operator can be used for processing and a low threshold is set. and high threshold To filter the appropriate edge pixels and select the boundary pixel set Then calculate the gradient change value of the boundary pixel, use the Sobel operator to calculate the horizontal gradient and the vertical gradient respectively, and merge them to get the overall gradient value G. On this basis, divide multiple local windows in the target area , count the pixel density change in the window, that is, the number of highlighted pixels And low brightness pixel count The difference between the pixel density change value G and the pixel density change value D is calculated to measure the brightness fluctuation of the local area. At the same time, the gradient information of the boundary pixels is combined to analyze the degree of change of the overall morphology. Then, by comparing the relationship between the gradient change value G and the pixel density change value D, the matching deviation value of the morphology is calculated. , which is calculated by accumulating the difference between the gradient and the pixel density change value, matching the deviation value Reflects the degree of morphological deviation and sets the threshold of morphological deviation , if the deviation value Exceed , it is judged that the target area has significant morphological shift, and the shift direction and amplitude are further analyzed, and the final morphological shift data is obtained by combining the shift data.
[0020] S102: Based on the morphological offset data, the offset gradient of the local area is calculated, the area with the largest offset is extracted, the local morphological adjustment weight is set, the direction compensation value is calculated according to the morphological adjustment weight, and the contour of the target area of the image is adjusted in combination with the direction compensation value to obtain the contour morphological adjustment value; Based on the morphological migration data, the migration gradient of the local area is calculated. First, the morphological migration data is calculated. The rate of change in the horizontal and vertical directions, analyze the degree of deviation in the local area, and use partial differentials to calculate the gradient change Then extract the area with the largest offset and filter out the area with the highest gradient change by non-maximum suppression method , set the local morphology adjustment weight , the adjustment weight is determined according to the degree of deviation, and the calculation formula is , the larger the offset, the higher the adjustment weight, on this basis, the direction compensation value is calculated The compensation value is calculated by adjusting the product of the weight and the offset gradient. It reflects the correction amount required for local morphological adjustment. Subsequently, the direction compensation value is applied to the contour adjustment of the target area, and the morphological transformation method is used to optimize the target contour. The specific operations include morphological expansion or erosion to compensate for the morphological changes in the offset direction, so that the adjusted contour is closer to the original shape, and finally the contour morphological adjustment value is obtained.
[0021] S103: calculating a contour matching difference based on the contour morphology adjustment value, analyzing the morphology change characteristics of the local area in combination with the contour matching difference, screening the offset contour area, calculating the morphology compensation strength of the offset area, and establishing a morphology compensation data set in combination with the regional compensation strength; Based on the contour morphology adjustment value, calculate the contour matching difference of the target area and set the contour matching degree , calculate the matching degree through the morphological matching algorithm and define the matching difference for The larger the matching difference, the more significant the contour change. Then, the morphological change characteristics of the local area are analyzed by combining the contour matching difference to extract the morphological change area. , filter the offset contour area and calculate the morphological compensation intensity of the offset area , the calculation method of morphological compensation intensity is The size of the compensation intensity is proportional to the matching difference. The larger the matching difference, the higher the corresponding morphological compensation intensity. Finally, combined with the regional compensation intensity A morphological compensation dataset is established to store the morphological compensation information of different regions, ensuring that subsequent morphological adjustments can be accurately optimized based on matching differences and applied to the correction of target contours.
[0022] The specific steps of S2 are: S201: Obtain the illumination intensity of the target area in the morphological compensation data set, calculate the illumination change rate of adjacent pixel points in the horizontal and vertical directions, screen the gradient mutation area, calculate the gradient change trend according to the numerical difference of adjacent gradient points, and obtain the illumination gradient value of the target area of the image; To obtain the illumination intensity of the target area in the morphological compensation dataset, we first need to extract the pixel points of the target area from the original image data and record their illumination intensity. , calculate the horizontal direction of its adjacent pixels and vertical direction The rate of change of light intensity on the surface is calculated by using gradient calculation methods, such as the Sobel operator, to calculate the horizontal gradient and vertical gradient , through the gradient amplitude formula ; Get the overall gradient information, set the mutation threshold when screening the gradient mutation area , if the gradient at a certain point , it is determined to be a mutation area. To further determine the gradient change trend, the first-order derivative and second-order derivative analysis are introduced: First Derivative , which indicates the rate of change of the gradient value in the horizontal direction, and is used to determine the trend of gradient increase or decrease; Second Derivative , represents the change of the first-order rate of change, which is used to capture the "smoothness" or "mutation" of local gradient changes.
[0023] like Falling within the threshold range , the gradient change is considered stable and is determined to be a stable gradient region; otherwise, it is determined to be a mutation point.
[0024] Finally, the illumination gradient value of the target area is obtained by traversing the entire target area and constructing a gradient distribution matrix , store the calculation results into the morphological compensation data set, and finally obtain the illumination gradient value data set of the target area.
[0025] S202: Based on the illumination gradient value of the target area of the image, the spectral reflectance of the pixel points in the target area within the difference wavelength range is calculated, the area with poor reflectance is screened, the spectral reflectance deviation value of the target and the obstruction is calculated, and the difference in optical characteristics of the target and the obstruction is obtained in combination with the illumination gradient change; The specific calculation formula for calculating the spectral reflectance deviation between the target and the obstruction is: ; Calculate the spectral reflectance deviation value, and combine the light gradient change to obtain the difference in optical properties between the target and the obstruction; in, Represents the wavelength between the target and the obstruction The spectral reflectance deviation value at Represents pixel At wavelength The light gradient value at Represents pixel The target area is at wavelength The spectral reflectance at Represents pixel The obstruction area is at wavelength , where n represents the total number of pixels selected in the target area and the occluder area. Represents the sum of the illumination gradient values of all selected pixels within the wavelength range.
[0026] Parameter acquisition: : Indicates pixel points At wavelength The illumination gradient value at . By using image processing technology, the illumination gradient of each pixel in the target area is calculated. Assuming that at a wavelength of 550nm, the illumination gradient values of the selected 5 pixels are: .
[0027] : Indicates pixel points The target area is at wavelength Spectral reflectance at . The spectral reflectance of each pixel in the target area is measured by spectral imaging technology. Assuming that at a wavelength of 550nm, the spectral reflectances of the selected 5 pixels are: .
[0028] : Indicates pixel points The obstruction area is at wavelength The spectral reflectance at . The spectral reflectance of each pixel in the obstruction area is measured by spectral imaging technology. Assuming that at a wavelength of 550nm, the spectral reflectances of the selected 5 pixels are: .
[0029] Calculation steps: Step 1: Calculate the sum of the light gradient values ; Step 2: Calculate the weighted average spectral reflectance of the target area ; Calculate the numerator: (0.8×0.35)+(0.6×0.40)+(0.9×0.38)+(0.7×0.36)+(0.85×0.37)=0.28+0.24+0.342+0.252+0.3145=1.4285; The weighted average spectral reflectance is then calculated: ; Step 3: Calculate the weighted average spectral reflectance of the obstruction area ; Calculate the numerator: (0.8×0.50)+(0.6×0.48)+(0.9×0.52)+(0.7×0.49)+(0.85×0.51)=0.40+0.288+0.468+0.343+0.4335=1.9325; The weighted average spectral reflectance is then calculated: ; Step 4: Calculate the spectral reflectance deviation between the target and the obstruction ; Result description: Calculated spectral reflectance deviation value It shows that at a wavelength of 550nm, there is a difference of 0.131 in the spectral reflectance between the target area and the obstruction area. This result can be used to further analyze the difference in optical properties between the target and the obstruction.
[0030] S203: Based on the difference in optical properties between the target and the obstruction, the illumination intensity variation range is calculated, illumination compensation data is calculated according to the illumination intensity variation and the spectral reflectance deviation, and the illumination matching error between regions is calculated in combination with the morphological compensation information to obtain an illumination matching data set; Based on the difference in optical properties between the target and the obstruction, calculate the range of light intensity variation, calculate the light compensation data based on the light intensity variation and spectral reflectance deviation, and set the light compensation coefficient , through the formula Calculate the compensation weight of each pixel, combine the morphological compensation information, calculate the illumination matching error between regions, and set the error measurement index , using the mean square error calculation method ,in is the compensated illumination value, is the benchmark illumination value, and finally the illumination matching data set is obtained.
[0031] The specific steps of S3 are: S301: Acquire an illumination matching data set, extract optical characteristic data of all pixels in the target area, calculate the spectral intensity of the pixels at different wavelengths, and count the numerical distribution range of the illumination characteristics in the area to obtain optical characteristic data distribution information of the target area of the image; To obtain the illumination matching dataset, first, select the specified target area from the target image, and extract the optical characteristic data of all pixels in the area through the pixel coordinates. The optical characteristics of each pixel include its reflectivity, transmittance and absorptivity at different wavelengths. In order to obtain these data, a hyperspectral imaging device can be used to capture the spectral response of the target area at multiple wavelengths, and the spectral intensity is calculated. The spectral intensity of the pixel at different wavelengths is calculated. Suppose a pixel at wavelength The spectral intensity at , the intensity can be expressed as: ; in, represents the incident light intensity, Represents the reflectivity of the pixel. For a certain target area, by performing this calculation on all pixels and summarizing the spectral intensity data, the overall spectral response of the area at different wavelengths can be obtained. In order to further analyze the distribution of illumination characteristic data, it is necessary to count the distribution range of the optical data of all pixels in the area. The maximum value, minimum value, mean value and standard deviation can be calculated. Assume that the spectral intensity set of all pixels in the target area at a certain wavelength is , its maximum and minimum values are: ; ; The mean and standard deviation are calculated as follows: ; ; In actual cases, if a target area of an image contains 100 pixels, at a wavelength of 500nm, its maximum spectral intensity is 1200, the minimum is 800, the mean is 1000, and the standard deviation is calculated to be about 115.47. At this time, the numerical distribution range of the illumination characteristics of the area is [800, 1200], and the optical characteristic data distribution information of the target area of the image is finally obtained.
[0032] S302: Based on the distribution information of the optical characteristic data of the target area of the image, combined with the optical characteristic data of the area corresponding to the obstruction, the reflectance ratio of the wavelength of the target area and the obstruction area is calculated, and the spectral deviation is calculated according to the spectral energy distribution, and the change trend of the spectral deviation in the difference band is analyzed to determine the degree of independence of the spectral characteristics of the target area compared with the obstruction, and obtain the optical independence value of the target area of the image; Based on the distribution information of the optical characteristic data of the target area in the image, the optical characteristic data of the area corresponding to the obstruction is first obtained, and then compared with the optical data of the target area, and the reflectivity ratio of the wavelength of the target area and the obstruction area is calculated. The average reflectivity at , the average reflectivity of the occluded area is , then the reflectivity ratio can be expressed as: ; This ratio reflects the difference in optical reflection characteristics between the target area and the occluded area. When , the reflectivity of the target area is higher than that of the obstruction, and vice versa. In order to further analyze the optical independence of the target area, it is necessary to calculate the spectral deviation. The spectral deviation is used to measure the difference in spectral characteristics between the target area and the obstruction, which can be expressed as: ; In order to analyze the changing trend of spectral deviation in different bands, it is necessary to calculate its changing rate at multiple wavelengths. Assume that the set of spectral deviations at multiple wavelengths is , the rate of change between adjacent wavelengths can be calculated: ; If in a certain scene, the reflectivity of the target area at wavelengths of 500nm, 600nm, and 700nm are 0.5, 0.6, and 0.7 respectively, and the reflectivity of the obstruction area at the same wavelengths is 0.4, 0.45, and 0.5, then their reflectivity ratios are 1.25, 1.33, and 1.4 respectively, and the spectral deviations are 0.1, 0.15, and 0.2 respectively, and their rate of change is 0.0005. The optical independence value of the target area is determined by these calculation results.
[0033] S303: Based on the optical independence value of the target area of the image and the motion trajectory data of the target area of the image, the degree of motion trajectory deviation between the target area and the occluder area is calculated, and the boundary range of the target area is adjusted according to the optical independence value, and the optical characteristic changes of the target area and the background area are compared, and the spectrum and motion characteristic change rate of the edge area are calculated. The boundary point of the target area and the background area is obtained according to the change rate, and the separation boundary value of the target area of the image is obtained; Based on the optical independence value of the target area in the image and the motion trajectory data of the target area, the deviation degree of the motion trajectory between the target area and the occlusion area is calculated. Suppose the trajectory of the target area is , the trajectory of the occluder area is , calculate the offset between the two: ; In order to more accurately determine the boundary range of the target area, it is necessary to adjust the boundary according to the optical independence value. The initial boundary is set to , the adjusted boundary is , the boundary adjustment function is: ; in To adjust the coefficient, it is set according to the spectral characteristics of different bands. Then, by comparing the optical characteristics of the target area and the background area, the spectral and motion characteristics change rate of the edge area is calculated. The spectral intensity is and , the rate of change is calculated as follows: ; If the initial boundary of the target area is 50 pixels, the optical independence value is 0.2, and the adjustment coefficient is 10, then the adjusted boundary is 50+0.2×10=52 pixels. If the spectral intensity of a certain edge pixel changes from 1000 to 1050 within a time interval of 500ms, the spectral change rate is 100 units / second. Finally, the boundary point between the target area and the background area is obtained, and the separation boundary value of the image target area is obtained.
[0034] The specific steps of S4 are: S401: obtaining the separation boundary value of the target area of the image, calculating the gradient change, continuity and closure level of the boundary pixels, screening the area that meets the integrity requirements, adjusting the shape of the boundary contour pixels based on the screened boundary value, establishing the compensated boundary contour data, calculating the matching error after the morphology compensation, and generating the matching error value; Get the separation boundary value of the target area of the image, extract the edge contour of the target area through the image segmentation algorithm, select the Canny operator to calculate the boundary pixel gradient, and set the edge detection threshold
[0035] (in ) to screen the gradient mutation points, calculate the gradient changes in the x and y directions respectively through Sobelf(x,y), and set the gradient threshold To screen significant gradient points and calculate the variance of continuous pixel gradients ,when When the boundary gradient is considered continuous, the boundary closure level is calculated. Set the closed threshold as the ratio of closed boundary pixels to total boundary points Filter the complete boundary area, and use morphological dilation operation to adjust the boundary contour for the filtered boundary data, and set the dilation structure element size Adjust the boundary pixels, construct the compensated boundary contour data, and calculate the matching error between the boundary after morphological compensation and the original boundary , calculate the matching error value through Hausdorff distance , where A is the original boundary point set, B is the compensated boundary point set, is the Euclidean distance, when When the pixel is equal to 0, the compensation is considered successful, and the matching error value is finally generated.
[0036] S402: Based on the matching error value, the classification matching priority of the target area is calculated, and the optical features, including light intensity balance, color gradient and reflection level, are extracted. In combination with the separation boundary value of the target area, the optical contrast, boundary optical gradient and the degree of influence of light interference are calculated to obtain the optical contrast priority value; First, the obtained matching errors need to be grouped and classified according to the established numerical range. For example, the total error interval is 0 to 5, where errors between 0 and 1.5 are classified as high priority, between 1.5 and 3 are classified as medium priority, and areas with errors exceeding 3 are classified as low priority. The error range setting can ensure that the priority distribution covers the entire target area. Then, optical feature extraction operations are performed on each area, including light intensity balance, color gradient, and reflection level. The light intensity balance can be obtained by counting the discrete degree of grayscale values of all pixels in the area. For example, in an industrial production line image, the pixel brightness in the area is concentrated between 125 and 135, indicating a high degree of balance. If the pixel brightness distribution spans 60 to 210, it belongs to an area with a low degree of balance. The color gradient can be extracted by observing the color change trend in the red, green and blue channels of the image. For example, in the blue channel, the color values of adjacent pixels are 70, 75, 72, 110 and 115 respectively. If there is a sudden change, it means that the color gradient in this area is large. If the change is concentrated between 70 and 75, it means that the color gradient is small. In the surface detection of goods, this analysis can be used to distinguish edge barcodes from smooth surfaces. The reflection level can be determined by the intensity of the bright area. In an indoor image, if the brightness of the local area is significantly higher than that of the surrounding area and there is no obvious light source, it means that there is mirror reflection or light interference in this area. The reflection intensity can also be observed by the brightness jump frequency. For example, if the brightness fluctuation exceeds 30 units 6 times in 10 consecutive pixels, then The reflection level is regarded as high. After the optical feature extraction is completed, it is fused with the target area separation boundary value to further calculate the optical contrast. The optical contrast can be observed by observing the difference between the maximum and minimum brightness values. For example, if the brightness value of a certain area fluctuates between 240 and 50, the contrast is obviously high. On the contrary, if it is distributed between 110 and 130, the contrast is low. In actual operation, the contrast difference value exceeding 150 can be set as a high contrast area. The boundary optical gradient is further judged by selecting the pixel line close to the boundary and comparing the brightness difference between every two adjacent pixels in the line. If the overall change is stable, it means that the boundary optical gradient is low. Otherwise, it means that the boundary area is a drastic boundary caused by strong light or color jump. The degree of influence of light interference can be based on the image. Whether there is obvious overexposure or shadow projection in the image, for example, if a straight bright band or a dark black strip appears on the target area, it can be preliminarily identified as a light-interfered area. The number of interfering pixels is counted and compared with the number of pixels in the total area. If it exceeds 30%, the interference is significant. After combining all the above features, each indicator is given an empirically set weight for summary. For example, the weight of light intensity balance is set to 0.3, color gradient 0.4, and reflection level 0.3. The total score is the weighted sum of each indicator score multiplied by their respective weights. In a factory monitoring image, a certain equipment area scored 9.2, and another dark corner area scored 3.1, that is, the former has a higher optical contrast priority and the latter has a lower optical contrast priority. The optical contrast priority value is obtained for reference in subsequent classification and correction.
[0037] S403: Based on the optical contrast priority value, the classification standard of the target area is adjusted, the classification weight correction value is calculated, and the classification data of the target area is corrected according to the matching error value and the optical independence value, and the area that meets the classification correction requirements is selected to obtain the image target classification result; The specific calculation formula for calculating the classification weight correction value is: ; Calculate the classification weight correction value, combine it with the optical independence value, correct the classification data of the target area, select the area that meets the classification correction requirements, and obtain the image target classification result; in, Represents the classification weight correction value, Representative The optical contrast priority value of each target area, Representative The matching error value of the target area, Representative The optical independence value of the target area, Representative The initial classification standard value of the target area, Represents the total number of target areas.
[0038] Optical contrast priority value : Quantified by measuring the difference in light intensity between the target area and the background. According to Edmund Optics, the contrast ratio is calculated as: ; in, and Represent the maximum and minimum light intensity values of the target area respectively. Assuming that (Unit: light intensity value), ,but: ; Matching error value : Determined by calculating the difference between the target area and the reference template. The normalized correlation coefficient matching method is used, and the calculation formula is: ; in, and Represent the pixel values of the template and target area respectively, and is their average value. Assume that .
[0039] Optical independence value : Indicates the degree of independence of the target area in terms of optical properties. By analyzing the optical properties of the target area, such as spectral characteristics or polarization characteristics, its independence is quantified. Assume that the optical independence value of a target area is .
[0040] Initial classification criteria value : The value obtained by preliminary classification of the target area according to the preset classification standard. Assume that the initial classification standard value of a target area is .
[0041] Total number of target areas : represents the number of target areas involved in the calculation. Assume .
[0042] Substitute the above parameters into the formula to calculate the classification weight correction value : Assume there are 5 target areas with the following parameters: Area 1: ; Second area: ; The third area: ; The 4th area: ; The 5th area: ; First, calculate the numerator: ;
[0043] ; Then, calculate the denominator: ;
[0044] ;
[0045] ; Therefore, the denominator is: 1.7958+0.45=2.2458; Finally, the classification weight correction value for: ; The results show that after calculation, the classification weight correction value This value is about 0.4765. This value is used to adjust the classification data of the target area, filter the area that meets the classification correction requirements, and obtain the image target classification result.
[0046] See also Figure 2 , an image data processing system, comprising: The morphological matching adjustment module obtains the pixel values at the boundary of the target area, calculates the gradient change rate of adjacent pixels, counts the pixel density change per unit area, calculates the morphological matching deviation value, determines the offset direction and amplitude, extracts the area with the maximum offset based on the local offset gradient value, sets the morphological adjustment weight, calculates the direction compensation value, adjusts the boundary contour of the target area, calculates the adjusted contour matching difference, and obtains the morphological compensation data set; The illumination matching optimization module calculates the illumination intensity gradient value of the target area based on the morphological compensation data set, extracts the surface spectral reflectance, calculates the difference in optical properties between the target area and the obstruction, calculates the dynamic illumination compensation parameters according to the illumination change trend, and constructs an illumination matching error model in combination with the morphological compensation data set to obtain an illumination matching data set. The optical characteristic analysis module calculates the optical characteristic vector of the target area based on the illumination matching data set, compares the spectral characteristic difference between the target area and the obstruction, calculates the optical independence, analyzes the motion trajectory deviation value, eliminates the area with the same motion mode but different optical characteristics, and obtains the separation boundary value of the image target area; The target classification correction module calculates the target area matching score based on the image target area separation boundary value and the morphological compensation data set, adjusts the classification matching priority, calculates the optical independence score according to the target area separation boundary value, corrects the target classification weight, and obtains the image target classification result.
[0047] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes and apply them to other fields. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A method for processing image data, characterized in that: The following steps are involved: S1: Obtain the pixel data of the image target boundary, calculate the boundary gradient change data and the local pixel density change data, determine the direction and amplitude of the morphological offset, extract the area with the maximum offset, set the local morphological adjustment weight, calculate the direction compensation value, adjust the image target contour, calculate the contour matching difference, and generate the morphological compensation data set; S2: Based on the morphological compensation data set, calculate the illumination gradient of the image target area, extract the spectral reflectance, analyze the difference in optical characteristics between the image target and the obstruction, calculate the dynamic illumination compensation parameters based on the illumination change trend, analyze the illumination matching error, and extract the illumination matching data set; S3: Calculate the optical characteristic vector of the image target area according to the illumination matching data set, compare the spectral feature difference between the image target and the obstruction, analyze the optical independence of the image target area, calculate the motion trajectory difference of the image target area, and obtain the separation boundary value of the image target area; S4: combining the image target region separation boundary value with the morphological compensation data set, calculating the compensated matching score, adjusting the image target region classification matching priority, correcting the classification weight, and obtaining the image target classification result.
2. The image data processing method according to claim 1, characterized in that: The specific steps of S1 are: S101: Obtain boundary pixels of the target area of the image, calculate the gradient change value of the boundary pixels, and count the pixel density change value in the local area, calculate the matching deviation value of the image target morphology according to the pixel density change value and the gradient change value, and judge the morphology deviation direction and amplitude of the target area according to the matching deviation value to obtain morphology deviation data; S102: Based on the morphological offset data, calculating the offset gradient of the local area, extracting the area with the largest offset, setting the local morphological adjustment weight, calculating the direction compensation value according to the morphological adjustment weight, and adjusting the contour of the target area of the image in combination with the direction compensation value to obtain the contour morphological adjustment value; S103: Calculate the contour matching difference based on the contour morphology adjustment value, analyze the morphology change characteristics of the local area in combination with the contour matching difference, screen the offset contour area, calculate the morphology compensation strength of the offset area, and establish a morphology compensation data set in combination with the regional compensation strength.
3. The image data processing method according to claim 1, characterized in that: The specific steps of S2 are: S201: Obtain the illumination intensity of the target area in the morphological compensation data set, calculate the illumination change rate of adjacent pixel points in the horizontal and vertical directions, screen the gradient mutation area, calculate the gradient change trend according to the numerical difference of adjacent gradient points, and obtain the illumination gradient value of the target area of the image; S202: Based on the illumination gradient value of the target area of the image, the spectral reflectance of the pixel points in the target area within the difference wavelength range is calculated, the area with poor reflectance is screened, the spectral reflectance deviation value of the target and the obstruction is calculated, and the difference in optical characteristics of the target and the obstruction is obtained in combination with the illumination gradient change; S203: Based on the difference in optical properties between the target and the obstruction, the illumination intensity variation range is calculated, illumination compensation data is calculated according to the illumination intensity variation and the spectral reflectance deviation, and the illumination matching error between regions is calculated in combination with the morphological compensation information to obtain an illumination matching data set.
4. The image data processing method according to claim 3, characterized in that: The specific calculation formula for the spectral reflectance deviation value between the target and the obstruction is: ; Calculate the spectral reflectance deviation value, and combine the light gradient change to obtain the difference in optical properties between the target and the obstruction; in, Represents the wavelength between the target and the obstruction The spectral reflectance deviation value at Represents pixel At wavelength The light gradient value at Represents pixel The target area is at wavelength The spectral reflectance at Represents pixel The obstruction area is at wavelength , where n represents the total number of pixels selected in the target area and the occluder area. Represents the sum of the illumination gradient values of all selected pixels within the wavelength range.
5. The image data processing method according to claim 1, characterized in that: The specific steps of S3 are: S301: Acquire the illumination matching data set, extract the optical characteristic data of all pixels in the target area, calculate the spectral intensity of the pixels under different wavelengths, and count the numerical distribution range of the illumination characteristics in the area to obtain the distribution information of the optical characteristic data of the target area of the image; S302: Based on the optical characteristic data distribution information of the target area of the image, combined with the optical characteristic data of the area corresponding to the obstruction, the reflectivity ratio of the wavelength of the target area and the obstruction area is calculated, and the spectral deviation is calculated according to the spectral energy distribution, and the change trend of the spectral deviation in the difference band is analyzed to determine the degree of independence of the spectral characteristics of the target area compared with the obstruction, and obtain the optical independence value of the target area of the image; S303: Based on the optical independence value of the image target area and the motion trajectory data of the image target area, the degree of motion trajectory deviation between the target area and the occlusion area is calculated, and the boundary range of the target area is adjusted according to the optical independence value. The optical characteristic changes of the target area and the background area are compared, and the spectrum and motion characteristic change rate of the edge area are calculated. The boundary point of the target area and the background area is obtained according to the change rate to obtain the separation boundary value of the image target area.
6. The image data processing method according to claim 1, characterized in that: The specific steps of S4 are: S401: obtaining the separation boundary value of the target area of the image, calculating the gradient change, continuity and closure level of the boundary pixels, screening the area that meets the integrity requirements, adjusting the morphology of the boundary contour pixels based on the screened boundary value, establishing compensated boundary contour data, calculating the matching error after morphology compensation, and generating a matching error value; S402: Based on the matching error value, the classification matching priority of the target area is calculated, and the optical features, including light intensity balance, color gradient and reflection level, are extracted. In combination with the separation boundary value of the target area, the optical contrast, boundary optical gradient and the degree of influence of light interference are calculated to obtain the optical contrast priority value; S403: Based on the optical contrast priority value, adjust the target area classification standard, calculate the classification weight correction value, correct the classification data of the target area according to the matching error value and the optical independence value, screen the area that meets the classification correction requirements, and obtain the image target classification result.
7. The image data processing method according to claim 6, characterized in that: The specific calculation formula for calculating the classification weight correction value is: ; Calculate the classification weight correction value, combine it with the optical independence value, correct the classification data of the target area, select the area that meets the classification correction requirements, and obtain the image target classification result; in, Represents the classification weight correction value, Representative The optical contrast priority value of each target area, Representative The matching error value of the target area, Representative The optical independence value of the target area, Representative The initial classification standard value of the target area, Represents the total number of target areas.
8. An image data processing system, characterized in that: The image data processing system is used to execute the image data processing method according to any one of claims 1 to 7, and the image data processing system comprises: The morphological matching adjustment module obtains the pixel values at the boundary of the target area, calculates the gradient change rate of adjacent pixels, counts the pixel density change per unit area, calculates the morphological matching deviation value, determines the offset direction and amplitude, extracts the area with the maximum offset based on the local offset gradient value, sets the morphological adjustment weight, calculates the direction compensation value, adjusts the boundary contour of the target area, calculates the adjusted contour matching difference, and obtains the morphological compensation data set; The illumination matching optimization module calculates the illumination intensity gradient value of the target area based on the morphological compensation data set, extracts the surface spectral reflectance, calculates the difference in optical properties between the target area and the obstruction, calculates the dynamic illumination compensation parameters according to the illumination change trend, and constructs an illumination matching error model in combination with the morphological compensation data set to obtain an illumination matching data set; The optical characteristic analysis module calculates the optical characteristic vector of the target area based on the illumination matching data set, compares the spectral feature difference between the target area and the obstruction, calculates the optical independence, analyzes the motion trajectory deviation value, and obtains the separation boundary value of the image target area; The target classification correction module calculates the target area matching score based on the image target area separation boundary value and the morphological compensation data set, adjusts the classification matching priority, calculates the optical independence score according to the target area separation boundary value, corrects the target classification weight, and obtains the image target classification result.
9. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor implements the image data processing system according to claim 8 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the image data processing method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Hyperspectral remote sensing geological surveying and mapping control system and method
CN117949397A
Land utilization category classification method and device and storage medium
CN119006876A
Printed circuit board defect detection method and system based on image recognition
CN119295460A
Colorimetric device, image forming device, image forming system, and image forming management device
US20160366305A1
Cited By
Road foreign matter detection method and system, electronic equipment and product
CN120220117A
Optical compensation method and system of color selector
CN120346994A
Calcium carbonate master batch wind shear forming detection system based on machine vision
CN120404499A
Computer image processing system based on deep learning
CN120747536A
Computer image processing system based on deep learning
CN120747536B