Method and device for determining three-dimensional surface shape, electronic equipment and readable storage medium
By filtering, smoothing, and gain processing the gradient image, the problem of blurred edges and details after gradient image denoising is solved, and accurate reconstruction of three-dimensional surface shape is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING LUSTER LIGHTTECH
- Filing Date
- 2025-12-29
- Publication Date
- 2026-06-02
AI Technical Summary
Existing techniques often blur or weaken the edges and details of images after gradient image denoising, leading to a decrease in the accuracy of 3D surface reconstruction.
By filtering and smoothing the gradient image, the residual image is determined, and the residual image is superimposed with gain to restore the edges and details of the image. The three-dimensional surface shape is reconstructed based on the gradient image after gain.
While reducing noise, it accurately restores the edges and details of the image, improving the accuracy of 3D surface reconstruction.
Smart Images

Figure CN122134580A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image processing technology, and in particular relates to a method, apparatus, electronic device and readable storage medium for determining a three-dimensional surface shape. Background Technology
[0002] Gradient images based on 2D physical objects can be used for 3D surface reconstruction. Related techniques directly reconstruct 3D surfaces after denoising the gradient image. However, after denoising, the edges and details of the gradient image are often blurred or weakened, leading to a decrease in the accuracy of subsequent processing. Summary of the Invention
[0003] This application aims to at least solve one of the technical problems existing in the related art. To this end, this application proposes a method, apparatus, electronic device, and readable storage medium for determining a three-dimensional surface shape, which can restore the edges and details of an image while reducing noise, and accurately determine the three-dimensional surface shape of the physical image based on the restored, gained gradient image.
[0004] In a first aspect, this application provides a method for determining a three-dimensional surface shape, the method comprising: The gradient image of the real object image is filtered to obtain the filtered gradient image; The filtered gradient image is smoothed to obtain a gradient-smoothed image. Determine the residual image between the gradient image and the gradient smoothing image; Gain the residual image, then superimpose the gained residual image onto the filtered gradient image to obtain the gained gradient image. The three-dimensional surface shape of the physical object is determined based on the gradient image after gain.
[0005] According to the method for determining the three-dimensional surface shape of this application, the gradient image of the object image is filtered to obtain a filtered gradient image; the filtered gradient image is smoothed to obtain a smoothed gradient image; the residual image between the gradient image and the smoothed gradient image is determined; the residual image is amplified, and the amplified residual image is superimposed on the filtered gradient image to obtain an amplified gradient image; based on the amplified gradient image, the three-dimensional surface shape of the object image is determined, thereby reducing noise while repairing the edges and details of the image. Based on the repaired amplified gradient image, the three-dimensional surface shape of the object image can be accurately determined.
[0006] According to one embodiment of this application, determining the three-dimensional surface shape of a physical image based on the gained gradient image includes: The initial multivariate polynomial representing the three-dimensional surface shape to be determined is approximated by multiple univariate polynomial functions corresponding to the horizontal and vertical directions respectively; the initial multivariate polynomial includes multiple target coefficients; Based on the horizontal and vertical gradient values of each pixel in the gained gradient image, each target coefficient is determined, and each target coefficient is substituted into the initial multivariate polynomial to obtain the target multivariate polynomial. Substitute the coordinates of each pixel in the physical image into the target multivariate polynomial to obtain the height of each pixel in the three-dimensional surface.
[0007] According to one embodiment of this application, each target coefficient is determined based on the horizontal and vertical gradient values corresponding to each pixel in the gained gradient image, including: Determine the horizontal and vertical partial derivatives of the initial multivariate polynomial in the horizontal and vertical directions, respectively; Based on the equivalence relationship between horizontal partial derivatives and horizontal gradient values, and the equivalence relationship between vertical partial derivatives and vertical gradient values, the overdetermined linear function between the gradient value matrix and the target coefficients is determined. The target coefficients are determined by solving the least-squares solution of the overdetermined linear function using the normal equation system.
[0008] According to one embodiment of this application, the univariate polynomial is any one of Legendre polynomial, Laguerre polynomial, Hermite polynomial, and Maclaurin polynomial.
[0009] According to one embodiment of this application, smoothing the filtered gradient image to obtain a gradient-smoothed image includes: The gradient image after the wave is smoothed by using a Gaussian blur algorithm to obtain a gradient smoothed image.
[0010] According to one embodiment of this application, the gradient image of a physical object image is filtered to obtain a filtered gradient image, including: Salt-and-pepper noise in the gradient image of a real object image is filtered using an adaptive median filtering algorithm to obtain the filtered gradient image.
[0011] Secondly, this application provides a three-dimensional surface shape determination device, the device comprising: The first processing module is used to filter the gradient image of the physical object to obtain the filtered gradient image. The second processing module is used to smooth the filtered gradient image to obtain a gradient-smoothed image. The third processing module is used to determine the residual image between the gradient image and the gradient smoothing image; The fourth processing module is used to gain the residual image, and then superimpose the gained residual image onto the filtered gradient image to obtain the gained gradient image. The fifth processing module is used to determine the three-dimensional surface shape of the physical object image based on the gradient image after gain.
[0012] According to the three-dimensional surface shape determination device of this application, the gradient image of the object image is filtered to obtain a filtered gradient image; the filtered gradient image is smoothed to obtain a smoothed gradient image; a residual image between the gradient image and the smoothed gradient image is determined; the residual image is amplified and superimposed on the filtered gradient image to obtain an amplified gradient image; based on the amplified gradient image, the three-dimensional surface shape of the object image is determined, thereby reducing noise while repairing the edges and details of the image. Based on the repaired amplified gradient image, the three-dimensional surface shape of the object image can be accurately determined.
[0013] According to one embodiment of this application, the fifth processing module is configured to: The initial multivariate polynomial representing the three-dimensional surface shape to be determined is approximated by multiple univariate polynomial functions corresponding to the horizontal and vertical directions respectively; the initial multivariate polynomial includes multiple target coefficients; Based on the horizontal and vertical gradient values of each pixel in the gained gradient image, each target coefficient is determined, and each target coefficient is substituted into the initial multivariate polynomial to obtain the target multivariate polynomial. Substitute the coordinates of each pixel in the physical image into the target multivariate polynomial to obtain the height of each pixel in the three-dimensional surface.
[0014] According to one embodiment of this application, the fifth processing module is used to determine the horizontal partial derivative and vertical partial derivative of the initial multivariate polynomial in the horizontal and vertical directions, respectively. Based on the equivalence relationship between horizontal partial derivatives and horizontal gradient values, and the equivalence relationship between vertical partial derivatives and vertical gradient values, the overdetermined linear function between the gradient value matrix and the target coefficients is determined. The target coefficients are determined by solving the least-squares solution of the overdetermined linear function using the normal equation system.
[0015] According to one embodiment of this application, the univariate polynomial is any one of Legendre polynomial, Laguerre polynomial, Hermite polynomial, and Maclaurin polynomial.
[0016] According to one embodiment of this application, the second processing module is used to smooth the gradient image after wave using a Gaussian blur algorithm to obtain a gradient smoothed image.
[0017] According to one embodiment of this application, a first processing module is configured to: perform filtering processing on the gradient image of the physical object image to obtain a filtered gradient image, including: Salt-and-pepper noise in the gradient image of a real object image is filtered using an adaptive median filtering algorithm to obtain the filtered gradient image.
[0018] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for determining a three-dimensional surface as described in the first aspect above.
[0019] Fourthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for determining a three-dimensional surface shape as described in the first aspect above.
[0020] Fifthly, this application provides a chip including a processor and a communication interface coupled to the processor, the processor being used to run programs or instructions to implement the method for determining three-dimensional surface shapes as provided in the first aspect.
[0021] In a sixth aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method for determining a three-dimensional surface as described in the first aspect above.
[0022] The above-described one or more technical solutions in the embodiments of this application have at least one of the following technical effects: The gradient image of the object image is filtered to obtain a filtered gradient image. The filtered gradient image is then smoothed to obtain a smoothed gradient image. The residual image between the gradient image and the smoothed gradient image is determined. The residual image is then amplified and superimposed onto the filtered gradient image to obtain a amplified gradient image. Based on the amplified gradient image, the three-dimensional surface shape of the object image is determined, thereby reducing noise while repairing the edges and details of the image. The three-dimensional surface shape of the object image can be accurately determined based on the repaired amplified gradient image.
[0023] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0024] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is one of the flowcharts illustrating the method for determining a three-dimensional surface shape provided in the embodiments of this application; Figure 2 This is a schematic diagram of the structure of the three-dimensional surface shape determination device provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0025] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0026] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0027] In the field of industrial visual inspection, 2D image inspection (such as analysis based on grayscale, texture, and shape) has long been the mainstream method, widely used for the identification of planar defects such as surface scratches, stains, and dimensional deviations. However, 2D images can only reflect the two-dimensional projection information of an object's surface and cannot obtain the height (depth) information of defects. This leads to a fundamental limitation in detecting three-dimensional defects (such as protrusions, depressions, and abnormal weld height). 1) For defects with small height differences (such as tiny protrusions at the 0.1mm level), they may only appear as slight grayscale changes in 2D images, making them difficult to detect with the naked eye. Some defects are easily confused with interference such as uneven lighting and material differences, leading to misjudgment or missed detection; 2) For defects on complex curved or inclined surfaces, perspective distortion in 2D images will further obscure height features, making it impossible to quantify the three-dimensional morphology of the defect (such as depth and volume), which is difficult to meet the needs of high-precision industrial quality inspection (such as automotive parts, semiconductor chips, and precision molds).
[0028] To overcome this limitation, 3D reconstruction technology has gradually become a core direction in industrial inspection. Among them, gradient image-based 3D reconstruction algorithms have become a research hotspot due to their advantages such as low cost, high robustness, and adaptability to dynamic inspection scenarios. Its core logic is to deduce the 3D surface shape by extracting gradient information (slope, direction) from the surface of the object. Gradient images can be acquired through various methods such as monocular / binocular vision, structured light, and laser scanning, without requiring expensive 3D sensors, and can adapt to the high-speed inspection needs of production lines (such as dynamic image capture on assembly lines).
[0029] To address the challenges of detecting certain defects in 2D images, the inability to obtain true height, and the high cost of 3D cameras, this application proposes a method for determining three-dimensional surface shapes that can suppress interference from gradient images and quickly and accurately reconstruct 3D topography.
[0030] The following description, in conjunction with the accompanying drawings, details the method, apparatus, electronic device, and readable storage medium for determining three-dimensional surface shapes provided in this application, through specific embodiments and application scenarios.
[0031] The method for determining the three-dimensional surface shape can be applied to the terminal, specifically executed by the hardware or software within the terminal.
[0032] The method for determining a three-dimensional surface shape provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the method for determining the three-dimensional surface shape. The electronic devices mentioned in this application embodiment include, but are not limited to, mobile phones, tablets, computers, cameras, and wearable devices. The method for determining a three-dimensional surface shape provided in this application embodiment will be described below using an electronic device as the execution subject.
[0033] like Figure 1 As shown, the method for determining the three-dimensional surface shape includes steps 110, 120, 130, 140, and 150.
[0034] Step 110: Filter the gradient image of the physical object to obtain the filtered gradient image.
[0035] The embodiments of this application can obtain gradient images of the object in the horizontal direction (X direction) and vertical direction (Y direction) by means of structured light phase shifting method, photometric stereo, etc.
[0036] A physical object image typically refers to an image or graphic that is a photograph or depiction of an actual object, reflecting its appearance and details, including color, shape, texture, and lighting effects. While a physical object image does not usually directly show the height information of the actual object, the height of each pixel can be determined based on the gradient image of the physical object image.
[0037] Gradient images are a way to describe changes in image brightness. By calculating the gradient at each point in the image, edges and features can be effectively extracted.
[0038] Since there is noise in the gradient image, it is necessary to filter the gradient image to obtain a filtered gradient image in order to remove the noise.
[0039] Step 120: Smooth the filtered gradient image to obtain a smoothed gradient image.
[0040] After image denoising, smoothing, or compression, the edges and details of the image are often blurred or weakened, leading to a decrease in the accuracy of subsequent processing. Therefore, it is necessary to restore the edges and details of the image.
[0041] The core purpose of edge and detail restoration is to enhance weakened edges and details and restore image clarity and feature recognition without amplifying noise.
[0042] Based on the filtered gradient image, a smoothed version of the filtered gradient image can be generated by Gaussian blur to obtain a gradient smoothed image, thereby preserving the smoothed low-frequency regions and filtering out high-frequency edges and details. The gradient smoothed image specifically includes a horizontal gradient smoothed image and a vertical gradient smoothed image.
[0043] Step 130: Determine the residual image between the gradient image and the gradient smoothing image.
[0044] Next, the gradient-smoothed image can be subtracted from the original gradient image to obtain a residual image containing edge and detail information (i.e., the blurred high-frequency components).
[0045] Step 140: Gain the residual image, and then superimpose the gained residual image onto the filtered gradient image to obtain the gained gradient image.
[0046] Then, an appropriate gain is applied to the residual image (to control the enhancement intensity) to magnify the effective details.
[0047] Then, the residual image of the gain is superimposed back onto the filtered gradient image, making the gray-level differences at the edges steeper and the subtle features more prominent. At the same time, by limiting the gain and filtering the noise residual, the noise is not amplified or artifacts are avoided. Finally, the image clarity and feature recognition are restored while suppressing noise.
[0048] Step 150: Determine the three-dimensional surface shape of the physical image based on the gained gradient image.
[0049] Next, the three-dimensional surface shape can be reconstructed based on the gradient image after gain, thereby determining the three-dimensional surface shape of the object image. The three-dimensional surface shape includes the height of each pixel in the object image. Based on the three-dimensional surface shape, defect identification or object detection can be performed.
[0050] According to the method for determining the three-dimensional surface shape provided in the embodiments of this application, the gradient image of the object image is filtered to obtain a filtered gradient image; the filtered gradient image is smoothed to obtain a smoothed gradient image; a residual image between the gradient image and the smoothed gradient image is determined; the residual image is amplified, and the amplified residual image is superimposed on the filtered gradient image to obtain an amplified gradient image; based on the amplified gradient image, the three-dimensional surface shape of the object image is determined, thereby reducing noise while repairing the edges and details of the image. Based on the repaired amplified gradient image, the three-dimensional surface shape of the object image can be accurately determined.
[0051] In some embodiments, smoothing the filtered gradient image to obtain a gradient-smoothed image includes: The gradient image after the wave is smoothed by using a Gaussian blur algorithm to obtain a gradient smoothed image.
[0052] Gaussian blur is a widely used image blurring technique that achieves a blurring effect by convolving an image with a Gaussian function. This algorithm has important applications in image processing and computer vision, such as noise reduction, edge detection, and image smoothing.
[0053] The embodiments of this application can use a Gaussian blur algorithm to smooth the gradient image after the wave, thereby obtaining a gradient-smoothed image.
[0054] In some embodiments, filtering is performed on the gradient image of the physical object to obtain a filtered gradient image, including: Salt-and-pepper noise in the gradient image of a real object image is filtered using an adaptive median filtering algorithm to obtain the filtered gradient image.
[0055] The adaptive median filtering algorithm is an improved filtering algorithm for salt-and-pepper noise (impulse noise). It can dynamically adjust the size of the filter kernel according to the noise density of the local area, effectively removing high-density noise while preserving image edges and details to the greatest extent.
[0056] In some embodiments, determining the three-dimensional surface shape of the physical image based on the gained gradient image includes: The initial multivariate polynomial representing the three-dimensional surface shape to be determined is approximated by multiple univariate polynomial functions corresponding to the horizontal and vertical directions respectively; the initial multivariate polynomial includes multiple target coefficients; Based on the horizontal and vertical gradient values of each pixel in the gained gradient image, each target coefficient is determined, and each target coefficient is substituted into the initial multivariate polynomial to obtain the target multivariate polynomial. Substitute the coordinates of each pixel in the physical image into the target multivariate polynomial to obtain the height of each pixel in the three-dimensional surface.
[0057] This application's embodiments can fit a 3D surface shape using a specific pattern. According to function approximation theory, a complex function can be approximated by a linear combination of a series of simple functions. The specific pattern is the simple function, and the 3D surface shape to be measured is a complex multivariate polynomial function. .
[0058] The initial multivariate polynomial of any pixel of a three-dimensional surface can be represented by the following formula (1): (1), in, for The more univariate polynomials in the direction, and the more numerous M and N are, the higher the accuracy of the approximation of the initial multivariate polynomial. for Univariate polynomials in the direction of for A univariate polynomial in the direction, multiplied by the two and then multiplied by the target coefficient. ( A three-dimensional surface can be represented by M*N numbers. , Since the coefficients are known quantities, we only need to find the coefficients to reconstruct the three-dimensional surface shape according to Equation 1.
[0059] In some embodiments, the univariate polynomial is any one of Legendre polynomial, Laguerre polynomial, Hermite polynomial, and Maclaurin polynomial.
[0060] In some embodiments, each target coefficient is determined based on the horizontal and vertical gradient values corresponding to each pixel in the gained gradient image, including: Determine the horizontal and vertical partial derivatives of the initial multivariate polynomial in the horizontal and vertical directions, respectively; Based on the equivalence relationship between horizontal partial derivatives and horizontal gradient values, and the equivalence relationship between vertical partial derivatives and vertical gradient values, the overdetermined linear function between the gradient value matrix and the target coefficients is determined. The target coefficients are determined by solving the least-squares solution of the overdetermined linear function using the normal equation system.
[0061] The horizontal and vertical gradient values at any point on a three-dimensional surface can be obtained by calculating the horizontal and vertical partial derivatives of formula (1), and can be characterized by the following formulas (2) and (3): (2), (3), in, for The directional gradient is equivalent to the horizontal partial derivative of the initial multivariate polynomial. for The directional gradient is equivalent to the vertical partial derivative of the initial multivariate polynomial. for The first derivative of a univariate polynomial in the direction of , for The first derivative of a univariate polynomial in a given direction.
[0062] Formulas (2) and (3) above can be extended to all pixels on the physical image and can be represented in matrix form: (4), Wherein, assuming the image width and height are W and H, then S is a gradient value matrix of 2*W*H rows and 1 column: .
[0063] D is a product matrix of the first derivative and the product of univariate polynomials with rows of 2*W*H and columns of M*N:
[0064] C is an M*N row, 1 column coefficient matrix, where each element is a target coefficient: , Formula (4) is an overdetermined linear system of equations. This system has no solution and its least-squares solution needs to be calculated. The solution is found using the normal equations method. It becomes the following form: (5), To improve operating speed, It can be calculated in advance.
[0065] When the surface to be measured is rectangular, Legendre polynomials can be used to approximate the three-dimensional surface. Legendre polynomials are orthogonal polynomials, and their input variable x (the horizontal coordinate of the pixel) is between [-1, 1], as shown in equation (6) below: (6), in, When the range of the input variable x is [a,b], it needs to be transformed to [-1,1] through equation (7).
[0066] (7), For example, for a gradient image with a width of 81, the coordinate range of its column direction is [1, 81]. It needs to be converted to [-1, 1] using formula (7) before inputting the Legendre polynomial.
[0067] The final calculated parameters Substituting back into formula (1), the reconstructed 3D surface shape can be obtained. .
[0068] The method for determining a three-dimensional surface shape provided in this application can be executed by a device for determining a three-dimensional surface shape. This application uses an example of a device for determining a three-dimensional surface shape executing the method to illustrate the device for determining a three-dimensional surface shape provided in this application.
[0069] This application also provides a device for determining a three-dimensional surface shape.
[0070] like Figure 2 As shown, the device for determining the three-dimensional surface shape includes: a first processing module 210, a second processing module 220, a third processing module 230, a fourth processing module 240, and a fifth processing module 250.
[0071] The first processing module 210 is used to filter the gradient image of the physical object image to obtain the filtered gradient image. The second processing module 220 is used to smooth the filtered gradient image to obtain a gradient smoothed image. The third processing module 220 is used to determine the residual image between the gradient image and the gradient smoothing image; The fourth processing module 240 is used to gain the residual image and superimpose the gained residual image onto the filtered gradient image to obtain the gained gradient image. The fifth processing module 250 is used to determine the three-dimensional surface shape of the object image based on the gradient image after gain.
[0072] According to the three-dimensional surface shape determination apparatus provided in the embodiments of this application, a filtered gradient image is obtained by filtering the gradient image of a physical object; a smoothed gradient image is obtained by smoothing the filtered gradient image; a residual image is determined between the gradient image and the smoothed gradient image; the residual image is amplified and superimposed onto the filtered gradient image to obtain an amplified gradient image; based on the amplified gradient image, the three-dimensional surface shape of the physical object is determined, thereby reducing noise while repairing the edges and details of the image. The three-dimensional surface shape of the physical object can be accurately determined based on the repaired amplified gradient image.
[0073] In some embodiments, the fifth processing module 250 is configured to: The initial multivariate polynomial representing the three-dimensional surface shape to be determined is approximated by multiple univariate polynomial functions corresponding to the horizontal and vertical directions respectively; the initial multivariate polynomial includes multiple target coefficients; Based on the horizontal and vertical gradient values of each pixel in the gained gradient image, each target coefficient is determined, and each target coefficient is substituted into the initial multivariate polynomial to obtain the target multivariate polynomial. Substitute the coordinates of each pixel in the physical image into the target multivariate polynomial to obtain the height of each pixel in the three-dimensional surface.
[0074] In some embodiments, the fifth processing module 250 is used to determine the horizontal partial derivative and vertical partial derivative of the initial multivariate polynomial in the horizontal and vertical directions, respectively. Based on the equivalence relationship between horizontal partial derivatives and horizontal gradient values, and the equivalence relationship between vertical partial derivatives and vertical gradient values, the overdetermined linear function between the gradient value matrix and the target coefficients is determined. The target coefficients are determined by solving the least-squares solution of the overdetermined linear function using the normal equation system.
[0075] In some embodiments, the univariate polynomial is any one of Legendre polynomial, Laguerre polynomial, Hermite polynomial, and Maclaurin polynomial.
[0076] In some embodiments, the second processing module 220 is used to smooth the gradient image after wave using a Gaussian blur algorithm to obtain a gradient smoothed image.
[0077] In some embodiments, the first processing module 220 is configured to: perform filtering processing on the gradient image of the physical object image to obtain a filtered gradient image, including: Salt-and-pepper noise in the gradient image of a real object image is filtered using an adaptive median filtering algorithm to obtain the filtered gradient image.
[0078] The device for determining the three-dimensional surface shape in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0079] The device for determining the three-dimensional surface shape in this application embodiment can be a device with an operating system. This operating system can be a Microsoft (Windows) operating system, an Android operating system, an iOS operating system, or other possible operating systems; this application embodiment does not specifically limit it.
[0080] The three-dimensional surface shape determination device provided in this application embodiment can achieve Figure 1 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0081] In some embodiments, such as Figure 3 As shown, this application embodiment also provides an electronic device 300, including a processor 301, a memory 302, and a computer program stored in the memory 302 and executable on the processor 301. When the program is executed by the processor 301, it implements the various processes of the above-described method embodiment for determining the three-dimensional surface shape and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0082] Processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 301 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0083] The memory 302 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or it may be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.
[0084] The memory 302 is used to store computer programs that execute the embodiments of this application, and the execution is controlled by the processor 301. The processor 301 is used to execute the computer programs stored in the memory 302 to implement the steps shown in the foregoing method embodiments.
[0085] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0086] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described method embodiment for determining the three-dimensional surface shape and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0087] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0088] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method for determining a three-dimensional surface.
[0089] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0090] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described method embodiment for determining three-dimensional surface shapes, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0091] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0092] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0093] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0094] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0095] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0096] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for determining a three-dimensional surface shape, characterized in that, include: The gradient image of the real object image is filtered to obtain the filtered gradient image; The filtered gradient image is smoothed to obtain a gradient-smoothed image; Determine the residual image between the gradient image and the gradient smoothing image; The residual image is amplified, and the amplified residual image is superimposed on the filtered gradient image to obtain the amplified gradient image. Based on the gradient image after gain, the three-dimensional surface shape of the physical image is determined.
2. The method for determining a three-dimensional surface shape according to claim 1, characterized in that, Determining the three-dimensional surface shape of the physical image based on the gained gradient image includes: An initial multivariate polynomial characterizing the three-dimensional surface shape to be determined is approximated by multiple univariate polynomial functions corresponding to the horizontal and vertical directions respectively; the initial multivariate polynomial includes multiple target coefficients; Based on the horizontal and vertical gradient values of each pixel in the gained gradient image, each target coefficient is determined, and each target coefficient is substituted into the initial multivariate polynomial to obtain the target multivariate polynomial. Substitute the coordinates of each pixel in the physical image into the target multivariate polynomial to obtain the height of each pixel in the three-dimensional surface.
3. The method for determining a three-dimensional surface shape according to claim 2, characterized in that, The determination of each target coefficient based on the horizontal and vertical gradient values corresponding to each pixel in the gained gradient image includes: Determine the horizontal and vertical partial derivatives of the initial multivariate polynomial in the horizontal and vertical directions, respectively; Based on the equivalence relationship between horizontal partial derivatives and horizontal gradient values, and the equivalence relationship between vertical partial derivatives and vertical gradient values, an overdetermined linear function between the gradient value matrix and the target coefficients is determined. The target coefficients are determined by solving the least-squares solution of the overdetermined linear function using the system of normal equations.
4. The method for determining a three-dimensional surface shape according to any one of claims 2, characterized in that, The univariate polynomial is any one of Legendre polynomial, Laguerre polynomial, Hermite polynomial, and Maclaurin polynomial.
5. The method for determining a three-dimensional surface shape according to any one of claims 1-4, characterized in that, The step of smoothing the filtered gradient image to obtain a gradient-smoothed image includes: The gradient image after the wave is smoothed by using a Gaussian blur algorithm to obtain a gradient smoothed image.
6. The method for determining a three-dimensional surface shape according to any one of claims 1-4, characterized in that, The step of filtering the gradient image of the physical object to obtain the filtered gradient image includes: Salt-and-pepper noise in the gradient image of the physical object is filtered using an adaptive median filtering algorithm to obtain the filtered gradient image.
7. A device for determining a three-dimensional surface shape, characterized in that, include: The first processing module is used to filter the gradient image of the physical object to obtain the filtered gradient image. The second processing module is used to smooth the filtered gradient image to obtain a gradient smoothed image. The third processing module is used to determine the residual image between the gradient image and the gradient smoothing image; The fourth processing module is used to gain the residual image and superimpose the gained residual image onto the filtered gradient image to obtain the gained gradient image. The fifth processing module is used to determine the three-dimensional surface shape of the physical image based on the gained gradient image.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method for determining the three-dimensional surface shape as described in any one of claims 1-6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the method for determining a three-dimensional surface as described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for determining the three-dimensional surface shape as described in any one of claims 1-6.