A method and system for converting an elliptical ring image

By constructing an arc length-angle lookup table and determining the angular radial line, the accurate conversion from elliptical ring image to rectangular image is achieved, solving the problem of inaccurate detection results of elliptical ring image and improving the accuracy and completeness of detection.

CN122289217APending Publication Date: 2026-06-26SHENZHEN BOHR INTELLIGENT MFG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN BOHR INTELLIGENT MFG TECH CO LTD
Filing Date
2026-03-31
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In existing technologies, the processing methods for elliptical annular region images result in inaccurate detection results. Conventional filter kernels produce uneven responses in the arc edge region, causing problems such as edge blurring and artifacts.

Method used

By determining the parameters of the elliptical ring, an arc length-angle lookup table is constructed. Based on the rectangular image and the parameters of the elliptical ring, the target angle and angular radial line are determined. Pixels are mapped to the rectangular image in a preset direction, thus achieving accurate conversion from the elliptical ring image to the rectangular image.

Benefits of technology

It improves the accuracy of elliptical ring image detection results, avoids detection errors caused by the complex shape of the elliptical ring, and presents image details more completely and accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122289217A_ABST
    Figure CN122289217A_ABST
Patent Text Reader

Abstract

This invention provides a method and system for converting elliptical ring images, relating to the field of image processing technology. The method includes: determining the elliptical ring parameters of an input target image containing an elliptical ring; wherein the elliptical ring parameters include the center coordinates of the elliptical ring, the major semi-axis of the elliptical ring, the minor semi-axis of the elliptical ring, the rotation angle, the starting angle, and the angle range; constructing an arc length-angle lookup table for the elliptical ring based on the elliptical ring parameters; determining the target angle corresponding to each rectangular column based on multiple rectangular columns contained in a preset rectangular image, the elliptical ring parameters, and the arc length-angle lookup table; determining the angular radial line corresponding to each target angle based on the rotation angle and the elliptical ring parameters; and sequentially mapping the pixels of the angular radial lines corresponding to each target angle to the rectangular image according to a preset direction to obtain the target rectangular image corresponding to the target image. This invention improves the accuracy of detection results for elliptical ring images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method and system for converting elliptical ring images. Background Technology

[0002] In industrial vision inspection, applications such as connector housing inspection, circumferential weld inspection, and bearing raceway defect inspection often require the analysis and processing of target images with elliptical ring-shaped regions. Post-processing of such images typically includes key steps such as filtering and noise reduction, edge extraction, feature recognition, and defect detection. The processing effectiveness directly determines the accuracy and reliability of the final inspection results.

[0003] Currently, processing methods for images with elliptical annular regions typically involve directly processing the original elliptical annular image space, applying conventional algorithms such as Gaussian filtering, median filtering, and Sobel / Canny edge detection directly to the original image. However, the geometric characteristics of the elliptical annulus cause conventional isotropic or radially symmetric filter kernels to produce uneven responses in its arc edge region, leading to problems such as edge blurring and artifacts, resulting in inaccurate detection results for elliptical annular images. Summary of the Invention

[0004] In view of the shortcomings of the prior art, the purpose of this invention is to provide a method for converting elliptical ring images, which can solve the technical problem that the detection results of elliptical ring images are not accurate enough in the prior art.

[0005] A first aspect of this invention provides a method for converting an elliptical ring image, comprising: Determine the elliptical ring parameters of the input target image containing the elliptical ring; wherein, the elliptical ring parameters include the center coordinates of the elliptical ring, the major semi-axis of the elliptical ring, the minor semi-axis of the elliptical ring, the rotation angle, the starting angle, and the angle range; Construct an arc length-angle lookup table for the elliptical ring based on the parameters of the elliptical ring; Based on the multiple rectangular columns contained in the preset rectangular image, the elliptical ring parameters, and the arc length-angle lookup table, the target angle corresponding to each rectangular column is determined. Based on the rotation angle and the elliptical ring parameters, determine the angular radial line corresponding to each target angle; The pixels of the radial lines corresponding to each target angle are sequentially mapped to the rectangular image according to a preset direction to obtain the target rectangular image corresponding to the target image.

[0006] Optionally, constructing the arc length-angle lookup table of the elliptical ring based on the elliptical ring parameters specifically includes: Divide the angle range into equal parts to obtain multiple equally divided parameter angles; Determine the minute arc length corresponding to each equally divided parameter angle; Based on multiple equally divided parameter angles, the starting angle, and the angle range, multiple cumulative parameter angles are determined; wherein, the angle of the first cumulative parameter angle is the same as the angle of the equally divided parameter angle, and the difference between the angles of two adjacent cumulative parameter angles is the same as the angle of the equally divided parameter angle; Based on the minute arc lengths corresponding to each equally divided parameter angle, the cumulative arc lengths corresponding to each cumulative parameter angle are determined, and an arc length-angle lookup table representing the correspondence between cumulative parameter angles and cumulative arc lengths is obtained.

[0007] Optionally, determining the target angle corresponding to each rectangular column based on multiple rectangular columns contained in a preset rectangular image, the elliptical ring parameters, and the arc length-angle lookup table specifically includes: Determine the number of columns of multiple rectangles contained in a preset rectangular image; wherein the column width of the rectangle is 1 pixel, and the length of the rectangle is the same as the width of the rectangular image; Based on the elliptical ring parameters, determine the total arc length of the outer ring of the elliptical ring; Based on the number of columns, the column width, and the total arc length, determine the target arc length corresponding to each rectangular column; Based on the arc length-angle lookup table and the target arc length corresponding to each rectangle column, the target angle corresponding to each rectangle column is determined.

[0008] Optionally, based on the rotation angle and the elliptical ring parameters, an angular radial line corresponding to a target angle is determined, specifically including: Based on the elliptical ring parameters, determine the inner and outer ring points corresponding to the target angle on the elliptical ring; Based on the rotation angle, determine the inner ring coordinates and outer ring coordinates of the inner ring point and the outer ring point in the target image; The line segment determined based on the inner ring coordinates and the outer ring coordinates is identified as the angular radial line corresponding to the target angle.

[0009] Optionally, the step of sequentially mapping the pixels of the radial lines corresponding to each target angle to the rectangular image according to a preset direction to obtain the target rectangular image corresponding to the target image specifically includes: Determine the effective angular radial lines from the angular radial lines corresponding to each target angle; The pixels of each effective angle radial line are sequentially mapped to the rectangular image according to a preset direction to obtain an initial rectangular image; A preset right-side region is copied from the right side of the initial rectangular image to obtain a right-side copied image; A preset left-side region is copied from the left side of the initial rectangular image to obtain a left-side copied image; The right-side copied image is stitched to the left side of the initial rectangular image, and the left-side copied image is stitched to the right side of the initial rectangular image to obtain the target rectangular image corresponding to the target image.

[0010] Optionally, determining the effective angular radial line from the angular radial lines corresponding to each target angle specifically includes: Determine the first and last valid pixels on the radial line corresponding to each target angle; Based on the first and last valid pixel points on each angular radial line, the valid angular radial lines corresponding to each target angle are determined; wherein, all the valid angular radial lines are valid pixels.

[0011] Optionally, the pixels of a target effective angle radial line are mapped to the rectangular image according to a preset direction, specifically including: Determine the coordinates of the first effective pixel of the first effective pixel and the coordinates of the last effective pixel of the last effective pixel along the radial line of the target effective angle; Based on the coordinates of the first pixel and the coordinates of the last pixel, determine the step size of the horizontal coordinate and the step size of the vertical coordinate. Based on the horizontal coordinate step size and the vertical coordinate step size, the coordinates of the first pixel point are accumulated and recursively calculated to obtain multiple pixel point coordinates to be mapped, until the current pixel point coordinate of the accumulated and recursively calculated is the coordinates of the last pixel point, at which point the accumulation and recursion stops; wherein, the multiple pixel point coordinates to be mapped include the coordinates of the first pixel point and the coordinates of the last pixel point. Obtain the column of target rectangles corresponding to the radial lines of the effective angle of the target from the rectangular image; The pixel coordinates of the plurality of pixels to be mapped are mapped to the target rectangle column.

[0012] Optionally, after obtaining the target rectangular image corresponding to the elliptical ring image, the method further includes: When a rewind command is received, the overlapping area in the target rectangular image is determined; The overlapping regions in the target rectangular image are deleted to obtain the current rectangular image; Based on a preset order, each rectangular column in the current rectangular image is rewound and written into the reconstructed elliptical ring image.

[0013] Optionally, after writing to the reconstructed elliptical ring image, the method further includes: Unassigned pixels are identified from the reconstructed elliptical ring image; Obtain the nearest valid neighbor pixel corresponding to the unassigned pixel; The pixel value of the nearest neighbor valid pixel is assigned to the unassigned pixel to obtain the elliptical ring image after assignment.

[0014] A second aspect of this invention provides a system for converting elliptical ring images, comprising: The first determining unit is used to determine the elliptical ring parameters of the input target image containing the elliptical ring; wherein, the elliptical ring parameters include the center coordinates of the elliptical ring, the major semi-axis of the elliptical ring, the minor semi-axis of the elliptical ring, the rotation angle, the starting angle, and the angle range. A construction unit is used to construct an arc length-angle lookup table for the elliptical ring based on the elliptical ring parameters; The second determining unit is used to determine the target angle corresponding to each rectangular column based on the multiple rectangular columns contained in the preset rectangular image, the elliptical ring parameters, and the arc length-angle lookup table. The third determining unit is used to determine the angular radial line corresponding to each target angle based on the rotation angle and the elliptical ring parameters; The mapping unit is used to sequentially map the pixels of the radial lines corresponding to each target angle to the rectangular image according to a preset direction, so as to obtain the target rectangular image corresponding to the target image.

[0015] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: In this embodiment of the invention, by accurately determining the parameters of the elliptical ring, the features of the elliptical ring can be comprehensively and meticulously described, providing an accurate foundation for subsequent processing. Constructing an arc length-angle lookup table allows for the rapid establishment of the correspondence between arc length and angle, improving processing efficiency. Based on the rectangular columns of the rectangular image, the elliptical ring parameters, and the lookup table, the target angle is determined, and the radial line of the angle is further determined, enabling precise positioning of various positions on the elliptical ring. Finally, the pixels of the radial line of the angle are mapped to the rectangular image according to a preset direction, achieving an accurate conversion from the elliptical ring image to a rectangular image. This conversion method effectively avoids the detection errors caused by the complex shape of the elliptical ring in traditional methods, allowing for a more complete and accurate presentation of the detailed information of the elliptical ring image, thereby improving the accuracy of the detection results for the elliptical ring image. Attached Figure Description

[0016] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0017] Figure 1 This is a flowchart illustrating a method for converting an elliptical ring image according to an embodiment of the present invention; Figure 2 This is a schematic diagram of an elliptical ring image provided in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the conversion of an elliptical ring image into a matrix image according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an elliptical ring image conversion system provided in an embodiment of the present invention. Detailed Implementation

[0018] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0019] The method for converting elliptical ring images provided by the present invention will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0020] Reference manual attached Figure 1 The diagram illustrates a flowchart of a method for converting an elliptical ring image according to an embodiment of the present invention.

[0021] This invention provides a method for converting an elliptical ring image, which may include the following steps: S1: Determine the parameters of the elliptical ring in the input target image containing the elliptical ring.

[0022] In this embodiment, the parameters of the elliptical ring include the coordinates of the elliptical ring center, the major semi-axis of the elliptical ring, the minor semi-axis of the elliptical ring, the rotation angle, the starting angle, and the angle range. A rectangular coordinate system can be preset on the target image. The rotation angle can be the angle between the major semi-axis of the elliptical ring and the horizontal axis of the rectangular coordinate system.

[0023] S2: Construct an arc length-angle lookup table for the elliptical ring based on the parameters of the elliptical ring.

[0024] In this embodiment, the arc length-angle lookup table is a bidirectional lookup table between the elliptic parameter angle θ and its corresponding cumulative arc length s.

[0025] As an optional implementation, S2 may construct the arc length-angle lookup table of the elliptical ring based on the elliptical ring parameters in the following ways: Divide the angle range into equal parts to obtain multiple equally divided parameter angles; Determine the minute arc length corresponding to each equally divided parameter angle; Based on multiple equally divided parameter angles and the starting angle and angle range, multiple cumulative parameter angles are determined; wherein, the angle of the first cumulative parameter angle is the same as the angle of the equally divided parameter angle, and the difference between the angles of two adjacent cumulative parameter angles is the same as the angle of the equally divided parameter angle; Based on the minute arc lengths corresponding to each equally divided parameter angle, the cumulative arc lengths corresponding to each cumulative parameter angle are determined, and an arc length-angle lookup table representing the correspondence between cumulative parameter angles and cumulative arc lengths is obtained.

[0026] This implementation method, by equally dividing the angle range into multiple equal-division parameter angles, can subdivide the complex angular changes of the elliptical ring into manageable small units. Determining the minute arc length corresponding to each equal-division parameter angle allows for precise quantification of local arc length changes. Based on the equal-division parameter angles, the initial angle, and the angle range, the cumulative parameter angle is determined, enabling the orderly integration of angle information. Finally, an arc length-angle lookup table is obtained, clearly presenting the correspondence between the cumulative parameter angles and the cumulative arc lengths. This provides a precise basis for subsequent elliptical ring image processing, helping to improve the accuracy of elliptical ring image conversion and detection operations.

[0027] S3: Based on the multiple rectangular columns contained in the preset rectangular image, the elliptical ring parameters, and the arc length-angle lookup table, determine the target angle corresponding to each rectangular column.

[0028] As an optional implementation, S3 can determine the target angle corresponding to each rectangular column based on multiple rectangular columns contained in a preset rectangular image, the elliptical ring parameters, and the arc length-angle lookup table, in a manner that may include: Determine the number of columns of multiple rectangles contained in a preset rectangular image; wherein the column width of the rectangle is 1 pixel, and the length of the rectangle is the same as the width of the rectangular image; Based on the elliptical ring parameters, determine the total arc length of the outer ring of the elliptical ring; Based on the number of columns, the column width, and the total arc length, determine the target arc length corresponding to each rectangular column; Based on the arc length-angle lookup table and the target arc length corresponding to each rectangle column, the target angle corresponding to each rectangle column is determined.

[0029] This implementation method first clarifies the number of rectangular columns in the rectangular image and sets reasonable column widths to lay the foundation for subsequent calculations. Determining the total arc length of the outer ring using the elliptical ring parameters allows for a precise grasp of the overall dimensional characteristics of the elliptical ring. Based on the number of columns, column widths, and total arc length, the target arc length corresponding to each rectangular column is determined, achieving a reasonable allocation of arc lengths. Finally, using an arc length-angle lookup table, the target angle is quickly and accurately determined from the target arc length, establishing a precise correspondence between the rectangular columns and the angles of the elliptical ring. This helps improve the accuracy and effectiveness of elliptical ring image conversion and subsequent processing.

[0030] S4: Based on the rotation angle and the elliptical ring parameters, determine the angular radial line corresponding to each target angle.

[0031] As an optional implementation, the method for determining the angular radial line corresponding to a target angle based on the rotation angle and the elliptical ring parameters may include: Based on the elliptical ring parameters, determine the inner and outer ring points corresponding to the target angle on the elliptical ring; Based on the rotation angle, determine the inner ring coordinates and outer ring coordinates of the inner ring point and the outer ring point in the target image; The line segment determined based on the inner ring coordinates and the outer ring coordinates is identified as the angular radial line corresponding to the target angle.

[0032] This implementation method first precisely locates the inner and outer ring points corresponding to the target angle based on the elliptical ring parameters, ensuring the accuracy of key position determination. Then, combined with the rotation angle, the points on the elliptical ring are accurately transformed into the target image coordinate system, obtaining the inner and outer ring coordinates, fully considering the rotation of the elliptical ring. Finally, the line segment determined by the inner and outer ring coordinates is used as the angular radial line, providing a clear and accurate path for the subsequent pixel mapping from the elliptical ring image to the rectangular image, helping to improve the accuracy of image conversion and thus enhancing the accuracy of related operations such as elliptical ring image detection.

[0033] S5: Map the pixels of the radial lines corresponding to each target angle to the rectangular image in sequence according to the preset direction to obtain the target rectangular image corresponding to the target image.

[0034] In this embodiment of the application, the method of mapping the pixels of the radial lines corresponding to each target angle to the rectangular image can be a bilinear interpolation algorithm or a nearest neighbor interpolation algorithm.

[0035] As an optional implementation, S5 sequentially maps the pixels of the radial lines corresponding to each target angle to the rectangular image according to a preset direction, and the method for obtaining the target rectangular image corresponding to the target image may include: Determine the effective angular radial lines from the angular radial lines corresponding to each target angle; The pixels of each effective angle radial line are sequentially mapped to the rectangular image according to a preset direction to obtain an initial rectangular image; A preset right-side region is copied from the right side of the initial rectangular image to obtain a right-side copied image; A preset left-side region is copied from the left side of the initial rectangular image to obtain a left-side copied image; The right-side copied image is stitched to the left side of the initial rectangular image, and the left-side copied image is stitched to the right side of the initial rectangular image to obtain the target rectangular image corresponding to the target image.

[0036] This implementation method first selects effective angular radial lines and maps them according to a preset direction to obtain an initial rectangular image, ensuring the accuracy of the basic transformation. By copying preset areas from the left and right sides of the initial rectangular image, left and right copy images are obtained, cleverly utilizing image edge information. Finally, the left and right copy images are stitched together to the opposite sides of the initial rectangular image, effectively solving the problem of image edge discontinuity. This makes the target rectangular image complete and coherent, avoiding differences in the filtered image caused by discontinuities in the image information on the left and right sides of the rectangle, improving image quality, and providing a more reliable foundation for subsequent processing and analysis based on the rectangular image.

[0037] Specifically, the rightmost column of the initial rectangular image, left_overlap, is copied and appended to the left side of the initial rectangular image, and the leftmost column of the initial rectangular image, right_overlap, is copied and appended to the right side of the initial rectangular image. left_overlap is the preset number of overlapping pixels on the left, and right_overlap is the preset number of overlapping pixels on the right.

[0038] Optionally, the method for determining the effective angular radial line from the angular radial lines corresponding to each target angle may include: Determine the first and last valid pixels on the radial line corresponding to each target angle; Based on the first and last valid pixel points on each angular radial line, the valid angular radial lines corresponding to each target angle are determined; wherein, all the valid angular radial lines are valid pixels.

[0039] This implementation method, by determining the first and last valid pixels on the radial line corresponding to each target angle, accurately defines the effective pixel range. Based on this determination of the effective radial line, it ensures that all pixels on the radial line are valid, eliminating interference from invalid pixels. Therefore, when subsequently mapping the radial line pixels to the rectangular image, only valid information is used, avoiding errors and interference from invalid pixels. This makes the mapping process more accurate and reliable, contributing to improved quality of the final target rectangular image and laying a solid foundation for subsequent image processing and analysis.

[0040] As an optional implementation, mapping the pixels of a target effective angle radial line to the rectangular image according to a preset direction may include: Determine the coordinates of the first effective pixel of the first effective pixel and the coordinates of the last effective pixel of the last effective pixel along the radial line of the target effective angle; Based on the coordinates of the first pixel and the coordinates of the last pixel, determine the step size of the horizontal coordinate and the step size of the vertical coordinate. Based on the horizontal coordinate step size and the vertical coordinate step size, the coordinates of the first pixel point are accumulated and recursively calculated to obtain multiple pixel point coordinates to be mapped, until the current pixel point coordinate of the accumulated and recursively calculated is the coordinates of the last pixel point, at which point the accumulation and recursion stops; wherein, the multiple pixel point coordinates to be mapped include the coordinates of the first pixel point and the coordinates of the last pixel point. Obtain the column of target rectangles corresponding to the radial lines of the effective angle of the target from the rectangular image; The pixel coordinates of the plurality of pixels to be mapped are mapped to the target rectangle column.

[0041] This implementation method first determines the coordinates of the first and last pixels of the effective radial line of the target angle, providing a benchmark for subsequent calculations. The step sizes of the horizontal and vertical coordinates are determined by these first and last coordinates, enabling precise planning of the pixel mapping path. Multiple pixel coordinates to be mapped are obtained through recursive accumulation based on the step sizes, ensuring the completeness and accuracy of pixel selection. The corresponding target rectangular column is obtained from the rectangular image, and the pixels are accurately mapped into it, achieving an ordered conversion of pixels from the elliptical ring image to the rectangular image. This avoids pixel misalignment and omissions, effectively improving the quality of image conversion and providing a reliable guarantee for subsequent processing.

[0042] As an optional implementation, after step S5, the following steps may also be performed: When a rewind command is received, the overlapping area in the target rectangular image is determined; The overlapping regions in the target rectangular image are deleted to obtain the current rectangular image; Based on a preset order, each rectangular column in the current rectangular image is rewound and written into the reconstructed elliptical ring image.

[0043] This implementation method, upon receiving a rewinding command, first identifies and removes overlapping areas in the target rectangular image, effectively resolving potential overlap issues during image conversion and resulting in a more regular image. Then, based on a preset order, each rectangular column of the current rectangular image is rewound, accurately restoring the structure and features of the elliptical ring image. This processing method enhances the flexibility and controllability of image processing, allowing for adjustments and reconstruction of the image according to actual needs, improving image quality, and providing a higher-quality image foundation for subsequent operations based on the elliptical ring image.

[0044] In this embodiment, the efficient rewinding path employs a rewinding method that "traverses the rectangular image column, calculates the ellipse coordinates, and assigns them," ensuring that all traversed regions are valid. This avoids the drawback of traversing invalid regions of the elliptical image in traditional methods, significantly improving efficiency.

[0045] Traditional rewinding methods involve traversing the elliptical image, which requires traversing a large number of invalid pixels, wasting computing power.

[0046] Optionally, after writing to the reconstructed elliptical ring image, the following steps can also be performed: Unassigned pixels are identified from the reconstructed elliptical ring image; Obtain the nearest valid neighbor pixel corresponding to the unassigned pixel; The pixel value of the nearest neighbor valid pixel is assigned to the unassigned pixel to obtain the elliptical ring image after assignment.

[0047] This implementation method identifies unassigned pixels from the reconstructed elliptical ring image, accurately locating areas of missing information in the image. It obtains the nearest-neighbor valid pixels, fully utilizing local image correlation to find reference pixels in a reasonable manner. Assigning the values ​​of the nearest-neighbor valid pixels to the unassigned pixels effectively fills in image gaps, making the image more complete and continuous, reducing information gaps caused by operations such as rewinding, improving image quality, and making the details of the elliptical ring image clearer, providing strong support for subsequent accurate image analysis and processing.

[0048] In this embodiment, after filtering is performed on the expanded rectangular image, the expanded overlapping area is cropped to restore the original rectangular image size.

[0049] Please refer to the following: Figure 2 and Figure 3 , Figure 2 This is a schematic diagram of an elliptical ring image provided in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the conversion of an elliptical ring image into a matrix image according to an embodiment of the present invention.

[0050] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: In this embodiment of the invention, by accurately determining the parameters of the elliptical ring, the features of the elliptical ring can be comprehensively and meticulously described, providing an accurate foundation for subsequent processing. Constructing an arc length-angle lookup table allows for the rapid establishment of the correspondence between arc length and angle, improving processing efficiency. Based on the rectangular columns of the rectangular image, the elliptical ring parameters, and the lookup table, the target angle is determined, and the radial line of the angle is further determined, enabling precise positioning of various positions on the elliptical ring. Finally, the pixels of the radial line of the angle are mapped to the rectangular image according to a preset direction, achieving an accurate conversion from the elliptical ring image to a rectangular image. This conversion method effectively avoids the detection errors caused by the complex shape of the elliptical ring in traditional methods, allowing for a more complete and accurate presentation of the detailed information of the elliptical ring image, thereby improving the accuracy of the detection results for the elliptical ring image.

[0051] Reference manual attached Figure 4 The diagram illustrates a structural schematic of an elliptical ring image conversion system provided in an embodiment of the present invention. The system includes: The first determining unit 401 is used to determine the elliptical ring parameters of the input target image containing the elliptical ring; wherein, the elliptical ring parameters include the center coordinates of the elliptical ring, the major semi-axis of the elliptical ring, the minor semi-axis of the elliptical ring, the rotation angle, the starting angle, and the angle range. Construction unit 402 is used to construct an arc length-angle lookup table of the elliptical ring based on the elliptical ring parameters; The second determining unit 403 is used to determine the target angle corresponding to each rectangular column based on the multiple rectangular columns contained in the preset rectangular image, the elliptical ring parameters, and the arc length-angle lookup table. The third determining unit 404 is used to determine the angular radial line corresponding to each target angle based on the rotation angle and the elliptical ring parameters; The mapping unit 405 is used to sequentially map the pixels of the radial lines corresponding to each target angle to the rectangular image according to a preset direction, so as to obtain the target rectangular image corresponding to the target image.

[0052] This invention provides another system for converting elliptical ring images, including a processor and a memory; The memory stores programs or instructions that can run on the processor. When the program or instructions are executed by the processor, they implement the steps of the above-described method for converting elliptical ring images and achieve the same technical effect. To avoid repetition, the present invention will not elaborate further.

[0053] It should be understood that the processor in the embodiments of the present invention can be a Central Processing Unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0054] It should also be understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM).

[0055] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0056] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0057] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0058] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0059] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0060] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0061] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0062] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0063] This invention provides a readable storage medium comprising: storing a program or instructions on the readable storage medium, wherein when the program or instructions are executed by a processor, the program or instructions implement the steps of the above-described method for converting an elliptical ring image, and can achieve the same technical effect. To avoid repetition, this invention will not elaborate further.

[0064] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the protection scope of the present invention.

Claims

1. A conversion method of an elliptical ring image, characterized by, The method includes: Determine the elliptical ring parameters of the input target image containing the elliptical ring; wherein, the elliptical ring parameters include the center coordinates of the elliptical ring, the major semi-axis of the elliptical ring, the minor semi-axis of the elliptical ring, the rotation angle, the starting angle, and the angle range; Construct an arc length-angle lookup table for the elliptical ring based on the parameters of the elliptical ring; Based on the multiple rectangular columns contained in the preset rectangular image, the elliptical ring parameters, and the arc length-angle lookup table, the target angle corresponding to each rectangular column is determined. Based on the rotation angle and the elliptical ring parameters, determine the angular radial line corresponding to each target angle; The pixels of the radial lines corresponding to each target angle are sequentially mapped to the rectangular image according to a preset direction to obtain the target rectangular image corresponding to the target image.

2. The conversion method of an elliptical ring image according to claim 1, characterized in that, The construction of the arc length-angle lookup table for the elliptical ring based on the elliptical ring parameters specifically includes: Divide the angle range into equal parts to obtain multiple equally divided parameter angles; Determine the minute arc length corresponding to each equally divided parameter angle; Based on multiple equally divided parameter angles, the starting angle, and the angle range, multiple cumulative parameter angles are determined; wherein, the angle of the first cumulative parameter angle is the same as the angle of the equally divided parameter angle, and the difference between the angles of two adjacent cumulative parameter angles is the same as the angle of the equally divided parameter angle; Based on the tiny arc lengths corresponding to each equally divided parameter angle, the cumulative arc lengths corresponding to each cumulative parameter angle are determined, and an arc length-angle lookup table representing the correspondence between the cumulative parameter angles and the cumulative arc lengths is obtained.

3. The conversion method of an elliptical ring image according to claim 1, wherein, The determination of the target angle corresponding to each rectangular column based on multiple rectangular columns contained in a preset rectangular image, the elliptical ring parameters, and the arc length-angle lookup table specifically includes: Determine the number of columns of multiple rectangles contained in a preset rectangular image; wherein the column width of the rectangle is 1 pixel, and the length of the rectangle is the same as the width of the rectangular image; Based on the elliptical ring parameters, determine the total arc length of the outer ring of the elliptical ring; Based on the number of columns, the column width, and the total arc length, determine the target arc length corresponding to each rectangular column; Based on the arc length-angle lookup table and the target arc length corresponding to each rectangle column, the target angle corresponding to each rectangle column is determined.

4. The conversion method of an elliptical ring image according to claim 1, wherein, Based on the rotation angle and the elliptical ring parameters, determine the radial line corresponding to a target angle, specifically including: Based on the elliptical ring parameters, determine the inner and outer ring points corresponding to the target angle on the elliptical ring; Based on the rotation angle, determine the inner ring coordinates and outer ring coordinates of the inner ring point and the outer ring point in the target image; The line segment determined based on the inner ring coordinates and the outer ring coordinates is identified as the angular radial line corresponding to the target angle.

5. The conversion method of an elliptical ring image according to claim 4, characterized in that, The step of sequentially mapping the pixels of the radial lines corresponding to each target angle to the rectangular image according to a preset direction to obtain the target rectangular image corresponding to the target image specifically includes: The effective angular radial line is determined from the angular radial lines corresponding to each target angle; The pixels of each effective angle radial line are sequentially mapped to the rectangular image according to a preset direction to obtain an initial rectangular image; A preset right-side region is copied from the right side of the initial rectangular image to obtain a right-side copied image; A preset left-side region is copied from the left side of the initial rectangular image to obtain a left-side copied image; The right-side copied image is stitched to the left side of the initial rectangular image, and the left-side copied image is stitched to the right side of the initial rectangular image to obtain the target rectangular image corresponding to the target image.

6. The conversion method of an elliptical ring image according to claim 5, wherein, The determination of the effective angular radial line from the angular radial lines corresponding to each target angle specifically includes: Determine the first and last valid pixels on the radial line corresponding to each target angle; Based on the first and last valid pixel points on each angular radial line, the valid angular radial lines corresponding to each target angle are determined; wherein, all the valid angular radial lines are valid pixels.

7. The conversion method of an elliptical ring image according to claim 6, wherein, Mapping the pixels of a target effective angle radial line into the rectangular image according to a preset direction specifically includes: Determine the coordinates of the first effective pixel of the first effective pixel and the coordinates of the last effective pixel of the last effective pixel along the radial line of the target effective angle; Based on the coordinates of the first pixel and the coordinates of the last pixel, determine the step size of the horizontal coordinate and the step size of the vertical coordinate. Based on the horizontal coordinate step size and the vertical coordinate step size, the coordinates of the first pixel point are accumulated and recursively calculated to obtain multiple pixel point coordinates to be mapped, until the current pixel point coordinate of the accumulated and recursively calculated is the coordinates of the last pixel point, at which point the accumulation and recursion stops; wherein, the multiple pixel point coordinates to be mapped include the coordinates of the first pixel point and the coordinates of the last pixel point. Obtain the column of target rectangles corresponding to the radial lines of the effective angle of the target from the rectangular image; The pixel coordinates of the plurality of pixels to be mapped are mapped to the target rectangle column.

8. The conversion method of an elliptical ring image according to claim 1, wherein, After obtaining the target rectangular image corresponding to the elliptical ring image, the method further includes: When a rewind command is received, the overlapping area in the target rectangular image is determined; The overlapping regions in the target rectangular image are deleted to obtain the current rectangular image; Based on a preset order, each rectangular column in the current rectangular image is rewound and written into the reconstructed elliptical ring image.

9. The conversion method of an elliptical ring image according to claim 2, wherein, After writing to the reconstructed elliptical ring image, the method further includes: Unassigned pixels are identified from the reconstructed elliptical ring image; Obtain the nearest valid neighbor pixel corresponding to the unassigned pixel; The pixel value of the nearest neighbor valid pixel is assigned to the unassigned pixel to obtain the elliptical ring image after assignment.

10. A system for converting an elliptical ring image, characterized by The system includes: The first determining unit is used to determine the elliptical ring parameters of the input target image containing the elliptical ring; wherein, the elliptical ring parameters include the center coordinates of the elliptical ring, the major semi-axis of the elliptical ring, the minor semi-axis of the elliptical ring, the rotation angle, the starting angle, and the angle range. A construction unit is used to construct an arc length-angle lookup table for the elliptical ring based on the elliptical ring parameters; The second determining unit is used to determine the target angle corresponding to each rectangular column based on the multiple rectangular columns contained in the preset rectangular image, the elliptical ring parameters, and the arc length-angle lookup table. The third determining unit is used to determine the angular radial line corresponding to each target angle based on the rotation angle and the elliptical ring parameters; The mapping unit is used to sequentially map the pixels of the radial lines corresponding to each target angle to the rectangular image according to a preset direction, so as to obtain the target rectangular image corresponding to the target image.