A smooth filtering image centroid calculation method with high stability
By determining the centroid calculation area on the target surface of the image sensor, optimizing the exposure time, and using the average of multiple frames of images to calculate the reference centroid coordinates, the real-time and stability problems of centroid calculation for irregular geometric images are solved, and centroid calculation of smoothed filtered images with high stability is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-03-27
AI Technical Summary
Existing methods for calculating the centroid of irregular geometric images have problems in the field of deep space exploration, such as high difficulty in real-time processing, high computational complexity, low real-time performance, or the need for physical experimental measurement.
By determining the centroid calculation area on the target surface of the image sensor, optimizing the exposure time, calculating the reference centroid coordinates using the average of multiple frames of images, and removing fluctuating data through standard deviation filtering, the centroid calculation of the smoothed filtered image is achieved.
It improves the stability and accuracy of centroid calculation for irregular geometric images, reduces random fluctuations caused by unstable data volume, and ensures the real-time performance and accuracy of image centroid calculation.
Smart Images

Figure CN121120758B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a centroid calculation method of an image, in particular to a smooth filtering centroid calculation method of an image with high stability. BACKGROUND
[0002] The centroid is the geometric center of a geometric image. For regular geometric images, the coordinates can be directly calculated by integral method or segmentation method. However, for irregular geometric images, the centroid calculation is a relatively complex problem.
[0003] At present, the existing irregular geometric image centroid calculation methods in the industry usually include segmentation method, analytical method, numerical integral method and barycenter method. The segmentation method: for irregular geometric images that can be segmented into simple shapes with known centroids, the overall centroid can be calculated by weighted average method. However, the segmentation method has high complexity and difficulty in real-time processing for unknown shape image centroid calculation in deep space exploration engineering. The analytical method: if the boundary of the irregular geometric image can be described by a mathematical function, such as a parameter equation, the centroid can be calculated by double integral method. However, the analytical method is only suitable for geometric images that can be represented by mathematical functions. The numerical integral method: for complex irregular geometric images that cannot be described by simple functions, the numerical integral method can be used to approximate the centroid position. The image is usually discretized into a series of small units, such as triangular meshes, and then the integral sum of each unit is calculated. However, the numerical integral method and the segmentation method have similar ideas, and have low real-time performance, high complexity and large amount of calculation. The barycenter method: the centroid of the irregular geometric image is determined by physical experiment, for example, a thin line is hung on the edge of the irregular geometric image and the balance point is found, or the centroid position is estimated by supporting the irregular geometric image at different points and measuring the moment. However, the barycenter method needs to be measured by experiment on the real object, and has a narrow application range, which cannot be applied to real-time observation in deep space exploration. SUMMARY
[0004] The present application aims to solve the technical problems of the existing irregular geometric image centroid calculation methods, such as the difficulty of real-time processing of the segmentation method, the limitation of the analytical method to geometric images represented by mathematical functions, the low real-time performance, high complexity and large amount of calculation of the numerical integral method, and the need for experimental measurement on the real object of the barycenter method, which cannot be applied to real-time observation in deep space exploration, and provides a smooth filtering centroid calculation method of an image with high stability.
[0005] In order to achieve the above-mentioned purpose, the technical solutions provided by the present application are as follows:
[0006] The application discloses a smooth filtering image centroid calculation method with high stability.
[0007] Step 1, determining a centroid calculation region according to a photosensitive imaging region of a target to be measured on a target surface of an image sensor; the centroid calculation region is a square region containing a circumscribed circle of the entire photosensitive imaging region;
[0008] Step 2, reading pixel values DN of all pixel points in the centroid calculation region of a current frame image output by the image sensor and performing normalization processing on the pixel values; calculating a quantity S1 of pixel points whose normalized pixel values DN are greater than or equal to a normalization threshold value in the current frame image;
[0009] Step 3, defining a quantity S2 of all pixel points in the centroid calculation region of the current frame image; calculating and judging a relationship between a value of S1 / S2 and a set threshold value interval; if the value of S1 / S2 is in the set threshold value interval, taking a current exposure time as an optimal exposure time; if the value of S1 / S2 is less than a minimum value of the set threshold value interval, increasing a next frame exposure time; if the value of S1 / S2 is greater than a maximum value of the set threshold value interval, decreasing the next frame exposure time; outputting a next frame image according to the adjusted next frame exposure time, and returning to step 2 until the value of S1 / S2 is in the set threshold value interval;
[0010] Step 4, solving a reference centroid coordinate;
[0011] Step 4.1, performing M frame continuous frame imaging with the optimal exposure time obtained in step 3, and M is greater than or equal to 2;
[0012] Step 4.2, reading pixel values DN of all pixel points in the centroid calculation region of a current frame image output by the image sensor and performing normalization processing on the pixel values; calculating a quantity of pixel points whose normalized pixel values DN are greater than or equal to a normalization threshold value in the current frame image, and a horizontal coordinate accumulated sum and a vertical coordinate accumulated sum of the pixel points, and then obtaining a centroid coordinate of the current frame image in the centroid calculation region;
[0013] Step 4.3, calculating centroid coordinates of other frame images in the centroid calculation region according to the method in step 4.2; taking an average value of the centroid coordinates of all continuous frame images in the centroid calculation region as the reference centroid coordinate;
[0014] Step 5: Calculate the centroid coordinates of the new frame image within the centroid calculation region according to the method in Step 4.2, and calculate the standard deviation of the standard deviation from the reference centroid coordinates; determine whether the standard deviation meets the preset requirements. If it does, use the average centroid coordinates of the current frame image and the previous M-1 frames within the centroid calculation region as the centroid coordinates of the current frame image, and update the centroid coordinates of the current frame image to the reference centroid coordinates of the next frame image. Otherwise, do not output the centroid coordinates of the current frame image.
[0015] Step 6: Use the method in Step 5 to solve for the centroid coordinates of each subsequent frame image.
[0016] Further, in step 1, the centroid calculation region is a square region containing the circumcircle of the entire photosensitive imaging region and having a side length of 3R, where R is the radius of the circumcircle of the photosensitive imaging region.
[0017] Further, in step 3, the set threshold range is... .
[0018] Furthermore, in step 3, if ≤S1 / S2≤ If S1 / S2 < Then the exposure time T of the next frame N =1.2*T C If S1 / S2 > Then the exposure time T of the next frame N =0.8*T C , among which, T C T is the exposure time of the current frame. N The exposure time for the next frame is T. N .
[0019] Furthermore, step 4.2 specifically involves:
[0020] Step 4.2.1: After the image sensor outputs a frame of image, it reads the pixel value DN of all pixels in the centroid calculation area of the current frame image and normalizes it.
[0021] Step 4.2.2: Calculate the number S of pixels S in the normalized pixel value DN of all pixels in the current frame image that are greater than or equal to the normalization threshold; calculate the sum of the x-coordinates SUM of the pixels in the normalized pixel value DN of all pixels in the current frame image that are greater than or equal to the normalization threshold. x SUM with the sum of the vertical axes y ;
[0022] Step 4.2.3: Obtain the x-coordinate of the centroid coordinates of the current frame image within the centroid calculation region as SUM. x / S, the ordinate is SUM y / S.
[0023] Further, in step 4.1, 10≤M≤100.
[0024] Further, in step 4.1, M=50.
[0025] Further, in step 2 and step 4.2, the normalization threshold is D max / 2, D max is the saturation value of the image sensor for the image pixel.
[0026] Further, in step 1, the image sensor is CMOS or CCD.
[0027] Compared with the prior art, the present application has the following advantages:
[0028] 1. The image centroid calculation method provided by the present application has high stability, which first determines a regular centroid calculation region according to the photosensitive imaging region of the target to be measured on the target surface of the image sensor, then determines the optimal exposure time in combination with the centroid calculation region, performs continuous frame imaging at the optimal exposure time, and obtains the reference centroid coordinate according to the mean value of the centroid coordinates of all continuous frame images in the centroid calculation region, thereby ensuring that the data amount of image centroid calculation is moderate, effectively reducing the random fluctuations caused by unstable data amount, and ensuring the stability of image centroid calculation.
[0029] 2. The image centroid calculation method provided by the present application has high stability, which breaks the traditional idea of directly calculating the centroid coordinate according to each frame of image, and instead uses the mean value of the centroid coordinates of multiple frame images in the centroid calculation region as the reference centroid coordinate, thereby providing a reference for subsequent filtering; by comparing the standard deviation of the centroid coordinate of each frame of image and the corresponding reference centroid coordinate, the large fluctuation data is removed and filtered, thereby further ensuring the accuracy and stability of the centroid calculation. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 FIG. 1 is a schematic diagram of step 1 in the embodiment of the image centroid calculation method with high stability and smooth filtering according to the present application. DETAILED DESCRIPTION
[0031] In order to make the advantages and characteristics of the present application clearer, the present application will be further described in detail below in combination with the drawings and specific embodiments.
[0032] An image centroid calculation method with high stability and smooth filtering, comprising the following steps:
[0033] Step 1, determining the centroid calculation region.
[0034] like Figure 1 As shown, the blue area represents the image sensor target surface, the pink area represents the circumcircle of the photosensitive imaging area of the target on the image sensor target surface, and the gray area represents the centroid calculation area. Since the target in this embodiment is a celestial body, the radius of the circumcircle of the photosensitive imaging area of the celestial body on the image sensor target surface is denoted as R. In this invention, the centroid calculation area is designed as a square area encompassing the entire circumcircle of the photosensitive imaging area. In this embodiment, the side length of the square area is 3R.
[0035] The image sensor can be either a CCD or a CMOS sensor; in this embodiment, it is a CCD.
[0036] Step 2: After the CCD outputs a frame of image, read the pixel value DN of all pixels in the centroid calculation area of the current frame image, and normalize the pixel value DN of all pixels in the current frame image.
[0037] Calculate the number of pixels in the current frame image whose normalized pixel value DN is greater than or equal to the normalization threshold, and take the number of pixels S1 greater than or equal to the normalization threshold as the number of pixels in the current frame image that satisfy the normalization threshold within the centroid calculation region. In this embodiment, the normalization threshold is D. max / 2, where D max This represents the saturation value of the photosensitive image pixels from the image sensor.
[0038] Step 3: Obtain the optimal exposure time for the image.
[0039] Since the centroid calculation region is square, the existing method is used to calculate the number of all pixels in the current frame image within the centroid calculation region, and this number is denoted as S2.
[0040] Calculate and determine the value of S1 / S2, and define the current frame exposure time of the image output by the image sensor as T. C The exposure time of the next frame is T. N In this embodiment, the threshold range is set to... That is, if ≤S1 / S2≤ Then the current frame exposure time T will be... C As the optimal exposure time for the image, proceed to step 4; if S1 / S2 < Then the exposure time T of the next frame N =1.2*T C If S1 / S2 > Then the exposure time T of the next frame N =0.8*T C In both cases, the next frame image is output based on the adjusted next frame exposure time, and the process returns to step 2 until... ≤S1 / S2≤ In other embodiments of the present application, the threshold interval can be adjusted in combination with the area relationship between the centroid calculation area and the circumscribed circle of the photosensitive imaging area.
[0041] Step 4, solve the reference centroid coordinates.
[0042] Step 4.1, M frames of continuous frame imaging are performed with the optimal exposure time obtained in step 3, and in this embodiment, M=50.
[0043] Step 4.2, after the image sensor outputs a frame of image, the DN values of all pixel points in the current frame image in the centroid calculation area are read, and the DN values of all pixel points in the current frame image are normalized.
[0044] The number S of pixel points in the current frame image whose normalized DN values are greater than or equal to the normalized threshold value is calculated. Meanwhile, the horizontal coordinates and vertical coordinates of the pixel points in the current frame image whose normalized DN values are greater than or equal to the normalized threshold value are calculated, and then the horizontal coordinate sum SUM x and the vertical coordinate sum SUM y of all pixel points in the current frame image that satisfy the normalized threshold value are obtained.
[0045] Finally, the centroid coordinates (X , Y ) of the current frame image in the centroid calculation area are calculated, wherein x =SUM / S, y =SUM
[0046] Step 4.3, according to the method of step 4.2, the centroid coordinates of the other 49 frames of images in the centroid calculation area are calculated respectively.
[0047] Then, the mean value of the centroid coordinates of the 50 frames of continuous images in the centroid calculation area is obtained, and the reference centroid coordinates (X , Y ) are obtained, wherein , m=1,...,50.
[0048] Step 5, the centroid coordinates (X , Y ) of a new frame of image in the centroid calculation area are calculated according to the method of step 4.2, and the standard deviation of the centroid coordinates (X , Y Xσ, the standard deviation of the ordinate Y and joint standard deviation σ XY , where σ X = , σ Y = , σ XY = .
[0049] Determine the standard deviation σ of the x-axis X σ, the standard deviation of the ordinate Y and joint standard deviation σ XY Do all of them meet the preset requirements? If σ X ≤0.3, σ Y ≤0.3, and σ XY If the value is ≤0.25, then the average centroid coordinates of the current frame image and the previous 49 frames within the centroid calculation region are used as the centroid coordinates of the current frame image, i.e., the x-coordinate of the current frame image's centroid coordinates. = y-axis = Otherwise, the centroid coordinates of the current frame image will not be output. The centroid coordinates of the current frame image ( The centroid coordinates of the current frame image within the photosensitive imaging area are calculated each time. After that, the centroid coordinates of the current frame image are set. The standard deviation of the next frame image is calculated using the reference centroid coordinates as the reference. .
[0050] Step 6: Use the method in Step 5 to solve for the centroid coordinates of each subsequent frame image.
[0051] It is worth noting that in other embodiments of the present invention, when S1 / S2 < When or S1 / S2> At that time, the next frame exposure time T N The magnitude of the increase or decrease can be adjusted according to actual needs. Similarly, the standard deviation σ on the horizontal axis... X σ, the standard deviation of the ordinate Y and joint standard deviation σ XY The comparison threshold can also be adjusted according to actual needs.
[0052] The above description is only used to illustrate the technical solutions of the present invention, and is not intended to limit them. For those skilled in the art, modifications can be made to the specific technical solutions described in the above embodiments, or equivalent substitutions can be made to some of the technical features. However, these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions protected by the present invention.
Claims
1. A method for calculating the centroid of a smoothed filtered image with high stability, characterized in that, Includes the following steps: Step 1: Determine the centroid calculation area based on the photosensitive imaging area of the target on the image sensor target surface; The centroid calculation region is a square region that includes the circumcircle of the entire photosensitive imaging region; Step 2: After the image sensor outputs a frame of image, read the pixel value DN of all pixels in the centroid calculation area of the current frame image and normalize it; calculate the number S1 of pixels in the normalized pixel value DN of all pixels in the current frame image that is greater than or equal to the normalization threshold. Step 3: Define the number of all pixels in the centroid calculation area of the current frame image as S2; calculate and determine the relationship between the value of S1 / S2 and the set threshold range: if the value of S1 / S2 is within the set threshold range, then the current frame exposure time is taken as the optimal exposure time; If the value of S1 / S2 is less than the minimum value of the set threshold range, the exposure time of the next frame is increased; if the value of S1 / S2 is greater than the maximum value of the set threshold range, the exposure time of the next frame is decreased. The next frame image is output according to the adjusted exposure time of the next frame, and the process returns to step 2 until the value of S1 / S2 is within the set threshold range. Step 4: Solve for the coordinates of the reference centroid; Step 4.1: Perform M consecutive frame imaging using the optimal exposure time obtained in step 3, where M ≥ 2; Step 4.2: After the image sensor outputs a frame of image, it reads the pixel value DN of all pixels in the centroid calculation region of the current frame image and normalizes it; it calculates the number of pixels in the normalized pixel value DN of all pixels in the current frame image that are greater than or equal to the normalization threshold, and the sum of the horizontal coordinates and the sum of the vertical coordinates of the pixels in the normalized pixel value DN of all pixels in the current frame image that are greater than or equal to the normalization threshold, and then obtains the centroid coordinates of the current frame image in the centroid calculation region. Step 4.3: Calculate the centroid coordinates of other frame images within the centroid calculation region according to the method in Step 4.2; take the average centroid coordinates of all consecutive frame images within the centroid calculation region as the reference centroid coordinates. Step 5: Calculate the centroid coordinates of the new frame image within the centroid calculation region according to the method in Step 4.2, and calculate the standard deviation of the standard deviation from the reference centroid coordinates; determine whether the standard deviation meets the preset requirements. If it does, use the average centroid coordinates of the current frame image and the previous M-1 frames within the centroid calculation region as the centroid coordinates of the current frame image, and update the centroid coordinates of the current frame image to the reference centroid coordinates of the next frame image. Otherwise, do not output the centroid coordinates of the current frame image. Step 6: Use the method in Step 5 to solve for the centroid coordinates of each subsequent frame image.
2. The method for calculating the centroid of a smoothed filtered image with high stability according to claim 1, characterized in that: In step 1, the centroid calculation region is a square region containing the circumcircle of the entire photosensitive imaging region and having a side length of 3R, where R is the radius of the circumcircle of the photosensitive imaging region.
3. The method for calculating the centroid of a smoothed filtered image with high stability according to claim 2, characterized in that: In step 3, the set threshold range is: .
4. The method for calculating the centroid of a smoothed filtered image with high stability according to claim 3, characterized in that: In step 3, if ≤S1 / S2≤ If so, the current frame exposure time will be taken as the optimal exposure time; If S1 / S2 < Then the exposure time T of the next frame N =1.2*T C If S1 / S2 > Then the exposure time T of the next frame N =0.8*T C , among which, T C T is the exposure time of the current frame. N The exposure time for the next frame is T. N .
5. The method for calculating the centroid of a smoothed filtered image with high stability according to claim 4, characterized in that, Step 4.2 specifically involves: Step 4.2.1: After the image sensor outputs a frame of image, it reads the pixel value DN of all pixels in the centroid calculation area of the current frame image and normalizes it. Step 4.2.2: Calculate the number S of pixels S in the normalized pixel value DN of all pixels in the current frame image that is greater than or equal to the normalization threshold; Calculate the sum of the x-coordinates (SUM) of all pixels in the current frame image whose normalized pixel values (DN) are greater than or equal to the normalization threshold. x SUM with the sum of the vertical axes y ; Step 4.2.3: Obtain the x-coordinate of the centroid coordinates of the current frame image within the centroid calculation region as SUM. x / S, with the ordinate being SUM y / S.
6. The method for calculating the centroid of a smoothed filtered image with high stability according to claim 5, characterized in that: In step 4.1, 10 ≤ M ≤ 100.
7. The method for calculating the centroid of a smoothed filtered image with high stability according to claim 6, characterized in that: In step 4.1, M=50.
8. The method for calculating the centroid of a smoothed filtered image with high stability according to claim 1, characterized in that: In steps 2 and 4.2, the normalization threshold is D. max / 2,D max This represents the pixel saturation value of the photosensitive image from the image sensor.
9. The method for calculating the centroid of a smoothed filtered image with high stability according to claim 1, characterized in that: In step 1, the image sensor is either a CMOS or a CCD.
Citation Information
Patent Citations
Method for detecting liquid level of czochralski silicon single crystal furnace by inhibiting fluctuation
CN105350071A
Automatic exposure control method based on image multi-threshold control
CN111225160A