Three-dimensional shape measurement method based on multi-threshold Otsu algorithm

By combining the multi-threshold Otsu algorithm and the least squares method, the brightness of the projected stripe pattern is adjusted to solve the problem of measurement accuracy of objects with large surface reflectivity changes, achieving high dynamic range three-dimensional topography measurement with fast speed and low cost, ensuring measurement accuracy and efficiency.

CN118654598APending Publication Date: 2024-09-17HEFEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410616401.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Existing structured light three-dimensional topography measurement technology is difficult to effectively measure objects with large surface reflectivity changes, resulting in reduced measurement accuracy. Traditional methods are time-consuming or affect the properties of the workpiece.

Method used

The multi-threshold Otsu algorithm is used to adjust the brightness of the projected stripe pattern, and the least squares method is used to calculate the relationship between the acquisition brightness and the projection brightness, segment the object surface area, and perform image fusion to restore the three-dimensional topography.

Benefits of technology

It achieves high dynamic range three-dimensional topography measurement, which is fast, low-cost, and does not require additional hardware to ensure measurement accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118654598A
    Figure CN118654598A
Patent Text Reader

Abstract

The invention discloses a three-dimensional topography measurement method based on a multi-threshold Otsu algorithm, which is characterized in that high-dynamic-range three-dimensional topography measurement is realized by adjusting the brightness of a projected fringe pattern, a digital projector is adopted, pure light with equal brightness intervals is projected to a measured object, and a primary relationship between acquisition brightness and projection brightness is obtained by using a least square method; the method comprises the following steps: drawing a gray level distribution histogram for a primary coefficient and a constant term of the primary coefficient, segmenting a measured object comprising a plurality of different surface reflectivities into a plurality of corresponding parts by using a multi-threshold Otsu algorithm to obtain corresponding suitable brightness, respectively projecting, taking out the suitable parts, and carrying out image fusion, thereby recovering the three-dimensional shape of the measured object. According to the invention, thresholds obtained by factors such as a measured object and ambient light can be automatically adjusted, and the measurement speed is high; and processing the uniform light sequence to obtain the surface reflectivity and ambient light of each pixel point, thereby realizing the measurement of the overall surface contour of the measured object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of optical three-dimensional measurement, and specifically relates to a high-dynamic object target three-dimensional shape measurement method based on a multi-threshold Otsu algorithm, which can be used for high-dynamic three-dimensional shape measurement of objects with large changes in surface reflectivity. Background Art

[0002] The fringe projection technology based on structured light is widely used in the field of three-dimensional shape measurement. It has the advantages of fast measurement speed, non-contact, and high accuracy. However, it is only applicable to diffuse reflection surfaces, and the surface reflectivity cannot change too much. For mirror reflection, it is actually difficult for the camera to capture the structured light fringes on the mirror surface. In actual production, there are workpieces with large differences in surface reflectivity, and such workpieces also need to be measured. At this time, ordinary fringe projection is difficult to feedback the fringe information of highlight areas and dark areas, which greatly affects the measurement accuracy.

[0003] There are many solutions to this problem. One is to use a high-precision but slow three-dimensional coordinate measuring machine to return from non-contact to contact. Another is to spray a layer on the measured object to change the surface type of the object, changing the highlight surface to a diffuse reflection surface. However, this method is difficult to ensure uniform spraying, and it will also reduce measurement efficiency and affect the properties of the workpiece itself, making it difficult to apply in industry.

[0004] There are also several solutions for measuring highly reflective objects using fringe projection technology without changing the measurement technology and the surface of the object.

[0005] The existing methods are as follows:

[0006] ① By synthesizing a series of stripe images taken at different exposure times, stripes with better image quality are generated. This method effectively improves the dynamic measurement range. However, since the influence of exposure time is not quantified, a large number of images with different exposure times are required to obtain high-contrast stripes, so this method is time-consuming. ② The grayscale histogram is used to directly estimate the required number of projections and exposure time, and the object to be measured is exposed separately. Pictures are taken at different optimal exposure times for image fusion, and the three-dimensional morphology is restored based on the fused images. However, direct manual estimation is not scientific and the data obtained is not optimal. ③ The method of projecting stripe patterns by modifying the output light intensity solves this problem, avoids saturation, and fuses the synthesized image with the original stripe image captured under different illumination. However, when the intensity of the projected light decreases, the contrast of the stripes may decrease. Summary of the invention

[0007] In view of the above problems, the present invention aims to propose a method for high dynamic range three-dimensional shape measurement by adjusting the brightness of the projected fringe pattern based on the multi-threshold Otsu algorithm. The method obtains the reflectivity of the object to be measured based on the multi-threshold Otsu algorithm, thereby calculating the projection fringe brightness required for measuring the object, extracts and fuses images according to the corresponding areas, and uses the fused images to restore the three-dimensional shape of the object to be measured.

[0008] In order to achieve the purpose of the invention, the technical solution provided by the present invention is:

[0009] A three-dimensional shape measurement method based on a multi-threshold Otsu algorithm realizes high dynamic range three-dimensional shape measurement by adjusting the brightness of a projected fringe pattern. A digital projector is used to project pure light of equal brightness intervals onto a measured object. A linear relationship between the collected brightness and the projected brightness is obtained using the least square method. A grayscale distribution histogram is drawn for its linear coefficient and a constant term. A measurement object including a plurality of different surface reflectivities is divided into corresponding parts using the multi-threshold Otsu algorithm to obtain corresponding suitable brightness, and the parts are projected separately. The suitable parts are taken out and image fusion is performed to restore the three-dimensional shape of the measured object.

[0010] The specific steps include:

[0011] Step S1, projecting a uniform light sequence of different brightness;

[0012] Project a sequence of pure lights with the same brightness and intervals onto the object to be measured.

[0013] In the step S1, under the influence of the gamma effect, the grayscale value range of the projector projection pattern is generally between 40 and 220, and the upper and lower limits of the projected uniform light sequence are set to 40 and 220, with an interval of d, and divided into q groups.

[0014] Projection gray value

[0015]

[0016] i is the i-th group of pure light

[0017] Furthermore, the reflectivity of the measured objects varies greatly. Different objects may have significantly different surface reflectivity. The use of the multi-threshold Otsu algorithm requires first calculating the surface reflectivity and ambient light of the measured object. Theoretically, the maximum grayscale value is 255. Considering the noise influence of the image sensor, the grayscale value threshold is usually 245-250, which is set to At this time, the signal-to-noise ratio is high. Ideally, the grayscale value of the pure light sequence projected in step S1 is

[0018]

[0019] Then the optimal fringe pattern image gray value collected by the camera is

[0020]

[0021] Step S2, using the same gain and exposure time to collect the pure light sequence generated in step S1;

[0022] The camera gain is set to k = 1, i.e. 0 dB, the lens field of view and aperture are fixed, and the brightness of each group of projections is collected, respectively. in, is the collected brightness, i is the i-th group of pure light, and n is a natural number;

[0023] Step S3, calculating the relationship between the acquisition brightness and the projection brightness;

[0024] The least square method is used to establish the functional relationship between the collected brightness and the projected brightness, and the linear function relationship coefficient a(x, y) and the constant term b(x, y) can be obtained; x is the array horizontal coordinate and y is the array vertical coordinate;

[0025] The specific method is:

[0026] When calculating the relationship between the collected brightness and the projected brightness, the correlation is a linear function relationship. The linear function coefficient is set to a(x, y). a(x, y) is determined by the exposure time, camera sensitivity and surface reflectivity. After fixing the exposure time and camera sensitivity, the coefficient can be solved for the surface reflectivity of different objects. The linear function constant term is set to b(x, y).

[0027] Then the functional relationship between the acquisition brightness and the projection brightness is:

[0028]

[0029] Here To collect brightness, is the projection brightness,

[0030] Solve a(x,y) and b(x,y) using the least squares method;

[0031] Step S4, using the multi-threshold Otsu algorithm to obtain the segmentation threshold;

[0032] The surface area of ​​the object to be measured is segmented by collecting the functional relationship between the brightness and the projection brightness and using the multi-threshold Otsu algorithm, and the optimal threshold I is determined using the maximum inter-class variance algorithm. opt (x,y); x is the horizontal coordinate of the array and y is the vertical coordinate of the array;

[0033] Specifically:

[0034] The multi-threshold Otsu algorithm is used to segment a(x, y) obtained in step S2. When there are many segmented areas, the final reconstruction quality is high. However, considering the efficiency of measurement, the value of n is taken as 3, which can meet most cases. That is, the areas corresponding to the three segmentation thresholds are normalized in brightness and combined to obtain a fused image, which is convenient for reconstruction.

[0035] The least squares method is used to obtain the linear function relationship, and the multi-threshold Otsu algorithm is used on the linear function coefficient array to obtain the segmentation threshold that maximizes the inter-class variance; the calculation formula is:

[0036]

[0037] where σ 2 is the inter-class variance, k is the threshold, p A (k) is the probability of a pixel being classified into A, where A is the segmentation area., m Z is the gray value of the entire image, and m is the cumulative mean of gray level k;

[0038] Step S5, calculating the required projection fringe pattern brightness according to the threshold value;

[0039] After obtaining the segmentation threshold, the formula is used

[0040]

[0041] Solve for the required projected fringe pattern brightness, where is the required projection fringe pattern brightness, is the gray value threshold in step S1.

[0042] Step S6, projecting and collecting according to the brightness of the fringe pattern;

[0043] According to the brightness of the projected fringe pattern obtained in step S5, projection is performed, images are collected and the brightness is unified to complete image fusion;

[0044] Specifically:

[0045] The projection brightness stripes of the segmented areas of the surface of the object to be measured are calculated using the projection pattern brightness formula in step S5 respectively;

[0046] Further, the different brightness segmentation areas on the surface of the measured object are projected and collected separately;

[0047] Step S7, brightness normalization and image fusion;

[0048] Normalize the brightness after acquisition.

[0049] The image collected in S6 is masked to extract the part with good capture effect for image fusion

[0050] Step S8, performing three-dimensional reconstruction to restore the three-dimensional shape of the object being measured.

[0051] Repeat steps S1-S7 to complete all uniform light sequences with different brightness;

[0052] The fused image is phase unwrapped to restore the three-dimensional morphology of the object being measured.

[0053] The beneficial effects of the present invention include:

[0054] 1. The present invention can automatically adjust the thresholds obtained by factors such as the measured object and ambient light according to the multi-threshold Otsu algorithm, and has a high measurement speed compared to multiple exposures;

[0055] 2. The present invention obtains the surface reflectivity and ambient light of each pixel by processing the uniform light sequence, thereby ensuring that each segmented area obtains high-contrast stripes, and can achieve overall contour measurement of the surface of the object being measured.

[0056] 3. The equipment is simple, no additional hardware is required, the cost is low, and the method is simple, fast and accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0058] Figure 1 is a schematic diagram of a fringe projection measurement system;

[0059] Figure 2 is a flow chart of the measuring method of the present invention;

[0060] Figure 3 The image captured by the camera when pure light sequence projection is used is too bright or too dark in some places;

[0061] Figure 4 It is a full-brightness image collected by a camera using general fringe projection technology, and the brightness distribution is uneven, which affects the final reconstruction quality;

[0062] Figure 5 It uses multi-threshold Otsu algorithm for segmentation to obtain different brightness;

[0063] Figure 6 Normalize and fuse the segmented images;

[0064] Figure 7The final imaging effect is compared with the traditional method. Figure 7 a is the method of this paper, Figure 7 b is the traditional method.

[0065] Figure 8 This is a comparison between the final imaging effect of the metal blade and the traditional method. Figure 8 a is the method of the present invention, Figure 8 b is the traditional method. DETAILED DESCRIPTION

[0066] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings.

[0067] System Introduction

[0068] Schematic diagram of fringe projection measurement system Figure 1 As shown, it includes 1 a projector, 2 a camera, 3 an object to be measured, and 4 a reference plane. The projector projects the required stripes onto the object to be measured, and the reflected light is captured by the camera for relevant processing.

[0069] The present invention is a method for adjusting the brightness of the projected fringe pattern based on the multi-threshold Otsu algorithm to achieve high dynamic range three-dimensional shape measurement. The method obtains the projection fringe brightness required for the measured object based on the multi-threshold Otsu algorithm, and the camera captures it separately and extracts and fuses the images according to the corresponding areas, and uses the fused images to restore the three-dimensional shape of the measured object, which can effectively deal with the large difference in the reflectivity of the surface of the measured object, and the occurrence of highlights or too dark.

[0070] Specific implementation steps are attached Figure 2 The instructions are as follows:

[0071] Step S1, projecting a uniform light sequence of different brightness;

[0072] Project a sequence of pure lights with the same brightness and intervals onto the object to be measured.

[0073] In the step S1, under the influence of the gamma effect, the grayscale value range of the projector projection pattern is generally between 40 and 220, and the upper and lower limits of the projected uniform light sequence are set to 40 and 220, with an interval of d, and divided into q groups.

[0074] Projection gray value i is the i-th group of pure light

[0075] Furthermore, the reflectivity of the measured objects varies greatly. Different objects may have significantly different surface reflectivity. The use of the multi-threshold Otsu algorithm requires first calculating the surface reflectivity and ambient light of the measured object. Theoretically, the maximum grayscale value is 255. Considering the noise influence of the image sensor, the grayscale value threshold is usually 245-250, which is set to At this time, the signal-to-noise ratio is high. Ideally, the grayscale value of the pure light sequence projected in step S1 is

[0076]

[0077] Then the optimal fringe pattern image gray value collected by the camera is

[0078]

[0079] Figure 3 It is the image collected by the camera when pure light sequence projection is used. There are some places that are too bright or too dark. Relatively speaking, Figure 4 It is a full-brightness image collected by a camera using general fringe projection technology, and the brightness distribution is uneven, which affects the final reconstruction quality.

[0080] Step S2, using the same gain and exposure time to collect the pure light sequence generated in step S1;

[0081] The camera gain is set to k = 1, i.e. 0 dB, the lens field of view and aperture are fixed, and the brightness of each group of projections is collected, respectively. in, is the collected brightness, i is the i-th group of pure light, and n is a natural number;

[0082] Step S3, calculating the relationship between the acquisition brightness and the projection brightness;

[0083] The least square method is used to establish the functional relationship between the collected brightness and the projected brightness, and the linear function relationship coefficient a(x, y) and the constant term b(x, y) can be obtained; x is the array horizontal coordinate and y is the array vertical coordinate;

[0084] The specific method is:

[0085] When calculating the relationship between the collected brightness and the projected brightness, the correlation is a linear function relationship. The linear function coefficient is set to a(x, y). a(x, y) is determined by the exposure time, camera sensitivity and surface reflectivity. After fixing the exposure time and camera sensitivity, the coefficient can be solved for the surface reflectivity of different objects. The linear function constant term is set to b(x, y).

[0086] Then the functional relationship between the acquisition brightness and the projection brightness is:

[0087]

[0088] Here To collect brightness, is the projection brightness,

[0089] Solve a(x,y) and b(x,y) using the least squares method;

[0090] Step S4, using the multi-threshold Otsu algorithm to obtain the segmentation threshold;

[0091] The surface area of ​​the object to be measured is segmented by collecting the functional relationship between the brightness and the projection brightness and using the multi-threshold Otsu algorithm, and the optimal threshold I is determined using the maximum inter-class variance algorithm. opt (x,y);

[0092] Specifically:

[0093] The multi-threshold Otsu algorithm is used to segment a(x, y) obtained in step S2. When there are many segmented areas, the final reconstruction quality is high. However, considering the efficiency of measurement, the value of n is taken as 3, which can meet most cases. That is, the areas corresponding to the three segmentation thresholds are normalized in brightness and combined to obtain a fused image, which is convenient for reconstruction.

[0094] The least squares method is used to obtain the linear function relationship, and the multi-threshold Otsu algorithm is used on the linear function coefficient array to obtain the segmentation threshold that maximizes the inter-class variance; the calculation formula is:

[0095]

[0096] where σ 2 is the inter-class variance, k is the threshold, p A (k) is the probability of a pixel being classified into A, where A is the segmentation area., m Z is the gray value of the entire image, and m is the cumulative mean of gray level k;

[0097] Step S5, calculating the required projection fringe pattern brightness according to the threshold value;

[0098] After obtaining the segmentation threshold, the formula is used

[0099]

[0100] Solve for the required projected fringe pattern brightness, where is the required projection fringe pattern brightness, is the gray value threshold in step S1.

[0101] like Figure 5 As shown, Figure 5 The multi-threshold Otsu algorithm is used for segmentation to obtain different brightness.

[0102] Step S6, projecting and collecting according to the brightness of the fringe pattern;

[0103] According to the brightness of the projected fringe pattern obtained in step S5, projection is performed, images are collected and the brightness is unified to complete image fusion;

[0104] Specifically:

[0105] The projection brightness stripes of the segmented areas of the surface of the object to be measured are calculated using the projection pattern brightness formula in step S5 respectively;

[0106] Further, the different brightness segmentation areas on the surface of the measured object are projected and collected separately;

[0107] Step S7, brightness normalization and image fusion;

[0108] Normalize the brightness after acquisition.

[0109] The images collected in S6 are masked and the parts with good capture effect are extracted for image fusion. Figure 6 It is a schematic diagram of normalizing and fusing the segmented images.

[0110] Step S8, performing three-dimensional reconstruction to restore the three-dimensional shape of the object being measured.

[0111] Repeat steps S1-S7 to complete all uniform light sequences with different brightness;

[0112] The fused image is phase unwrapped to restore the three-dimensional morphology of the object being measured.

[0113] Figure 7 The final imaging effect is compared with the traditional method. Figure 7 a is the method of the present invention, Figure 7 b is the traditional method.

[0114] Figure 8 This is a comparison between the final imaging effect of the metal blade and the traditional method. Figure 7 a is the method of the present invention, Figure 7 b is the traditional method.

[0115] The described embodiments are only a part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

Claims

1. A three-dimensional shape measurement method based on a multi-threshold Otsu algorithm, which achieves high dynamic range three-dimensional shape measurement by adjusting the brightness of the projected fringe pattern, characterized in that: A digital projector is used to project pure light of equal brightness intervals onto the measured object. The least square method is used to obtain the linear relationship between the collected brightness and the projected brightness. A grayscale distribution histogram is drawn for its linear coefficient and the constant term. The multi-threshold Otsu algorithm is used to divide a measurement object including a variety of different surface reflectivities into corresponding parts to obtain the corresponding appropriate brightness. The parts are projected separately, and the appropriate parts are taken out for image fusion, thereby restoring the three-dimensional morphology of the measured object. The specific steps include: Step S1, projecting a uniform light sequence of different brightness; Project a sequence of pure lights with the same brightness intervals onto the object to be measured. In the step S1, under the influence of the gamma effect, the gray value range of the projector projection pattern is between 40 and 220, and the upper and lower limits of the projected uniform light sequence are set to 40 and 220, with an interval of d, and divided into q groups. Projection gray value i is the i-th group of pure light; Step S2, using the same gain and exposure time to collect the pure light sequence generated in step S1; The camera gain is set to k = 1, i.e. 0 dB, the lens field of view and aperture are fixed, and the brightness of each group of projections is collected, respectively. in, is the collected brightness, i is the i-th group of pure light, and n is a natural number; Step S3, calculating the relationship between the acquisition brightness and the projection brightness; The least square method is used to solve the functional relationship between the collected brightness and the projected brightness, and the linear function relationship coefficient a(x, y) and the constant term b(x, y) can be obtained; x is the array horizontal coordinate and y is the array vertical coordinate; The specific method is: When calculating the relationship between the collected brightness and the projected brightness, the correlation is a linear function relationship. The linear function coefficient is set to a(x, y). a(x, y) is determined by the exposure time, camera sensitivity and surface reflectivity. After fixing the exposure time and camera sensitivity, the coefficient can be solved for the surface reflectivity of different objects. The linear function constant term is set to b(x, y). Then the functional relationship between the acquisition brightness and the projection brightness is: Here To collect brightness, is the projection brightness, Solve a(x,y) and b(x,y) using the least squares method; Step S4, using the multi-threshold Otsu algorithm to obtain the segmentation threshold; The surface area of ​​the object to be measured is segmented by collecting the functional relationship between the brightness and the projection brightness and using the multi-threshold Otsu algorithm, and the optimal threshold I is determined using the maximum inter-class variance algorithm. opt (x,y); x is the horizontal coordinate of the array and y is the vertical coordinate of the array; Step S5, calculating the required projection fringe pattern brightness according to the threshold value obtained in step S4; Step S6, projecting and collecting according to the brightness of the fringe pattern; According to the brightness of the projected fringe pattern obtained in step S5, projection is performed and an image is collected; Step S7, brightness normalization and image fusion; Normalizing the brightness after acquisition, and using a mask to extract the area with good capture effect from the image acquired in step S6 for image fusion; Step S8, performing three-dimensional reconstruction to restore the three-dimensional shape of the object being measured. The fused image is phase unwrapped to restore the three-dimensional morphology of the object being measured.

2. A three-dimensional shape measurement method based on multi-threshold Otsu algorithm according to claim 1, characterized in that: The gray value of the pure light sequence projected in step S1 is Then the optimal fringe pattern image gray value collected by the camera is 3. The three-dimensional shape measurement method based on the multi-threshold Otsu algorithm according to claim 1 is characterized in that: In step S4, the specific process of using the multi-threshold Otsu algorithm to obtain the segmentation threshold is: The multi-threshold Otsu algorithm is used to segment a(x, y) obtained in step S2, and the linear function relationship is obtained using the least squares method. The multi-threshold Otsu algorithm is used on the linear function coefficient array to obtain the segmentation threshold that maximizes the inter-class variance; the calculation formula is: where σ 2 is the inter-class variance, k is the threshold, p A (k) is the probability of a pixel being classified into A, where A is the segmentation area., m Z is the gray value of the entire image, and m is the cumulative mean of the gray level k.

4. The three-dimensional shape measurement method based on the multi-threshold Otsu algorithm according to claim 3 is characterized in that: The step S5 is specifically as follows: After obtaining the segmentation threshold, the formula is used Solve for the required projected fringe pattern brightness, where is the required projection fringe pattern brightness, is the gray value threshold in step S1.

5. The three-dimensional shape measurement method based on the multi-threshold Otsu algorithm according to claim 4 is characterized in that: The step S6 is specifically as follows: The projection brightness stripes of the segmented areas of the surface of the object to be measured are calculated using the projection pattern brightness formula in step S5 respectively; The different brightness segmentation areas on the surface of the object to be measured are further projected and collected separately.