An image processing method, apparatus, electronic device, and storage medium

By vertically supplementing the original coordinates of adjacent horizontal coordinates in image processing, the minimum vertical coordinate difference between two adjacent columns of drawn coordinates is made equal to 1, which solves the problems of low efficiency and poor smoothness in OpenCV and achieves more efficient image processing results.

CN115601285BActive Publication Date: 2026-03-13SONOSCAPE MEDICAL CORP
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-28
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies, OpenCV suffers from low efficiency and poor smoothness when fitting coordinate points, resulting in poor image processing performance.

Method used

By obtaining the x and y coordinates of the original coordinate points in the image, vertical supplementation is performed to make the minimum y coordinate difference between two adjacent columns of drawn coordinate points equal to 1, thereby reducing the drawing of redundant points and achieving a smooth transition between adjacent columns.

Benefits of technology

It improves the efficiency and smoothness of image processing, reduces the occurrence of small broken lines, and enhances the fitting effect of coordinate points.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115601285B_ABST
    Figure CN115601285B_ABST
Patent Text Reader

Abstract

This application discloses an image processing method, apparatus, electronic device, and computer-readable storage medium. The method includes: acquiring the x-coordinate and y-coordinate of original coordinate points in an image; wherein each column in the image has corresponding original coordinate points; and performing vertical coordinate point supplementation on the original coordinate points with adjacent x-coordinates, such that the minimum y-coordinate difference between the drawn coordinate points in two adjacent columns is equal to 1; wherein the drawn coordinate points include the original coordinate points and the supplemented coordinate points; and wherein if the y-coordinate of an original coordinate point falls into the drawn coordinate points of an adjacent column, the column containing the original coordinate point does not need to be supplemented. The image processing method provided by this application improves the efficiency and smoothness of image processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more specifically, to an image processing method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] In related technologies, OpenCV (a cross-platform computer vision and machine learning software library) uses the following method to fit coordinate points: obtain the horizontal and vertical coordinates of two adjacent columns of coordinate points, and draw coordinate points in the horizontal and vertical directions respectively based on these coordinates. The coordinate points of two adjacent columns are fitted in the form of straight line segments. Visually, some broken lines and redundant drawing points will appear, which leads to low image processing efficiency and poor smoothness.

[0003] Therefore, how to improve the efficiency and smoothness of image processing is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention

[0004] The purpose of this application is to provide an image processing method, apparatus, electronic device, and computer-readable storage medium, which improve the efficiency and smoothness of image processing.

[0005] To achieve the above objectives, this application provides an image processing method, comprising:

[0006] Obtain the x and y coordinates of the original coordinate points in the image; wherein, each column in the image has a corresponding original coordinate point;

[0007] The original coordinate points of adjacent horizontal coordinates are supplemented by drawing coordinate points in the vertical direction, so that the minimum vertical coordinate difference between two adjacent columns of drawn coordinate points is equal to 1; wherein, the drawn coordinate points include the original coordinate points and the supplemented coordinate points.

[0008] If the ordinate of the original coordinate point falls into the adjacent column of already drawn coordinate points, the column containing the original coordinate point does not need to be redrawn.

[0009] The step of supplementing the original coordinate points of adjacent horizontal coordinates with vertical coordinates, such that the minimum vertical coordinate difference between two adjacent columns of drawn coordinate points is equal to 1, includes:

[0010] Determine the adjacent first target column and second target column, and determine whether the minimum ordinate difference between the coordinate points in the first target column and the coordinate points in the second target column is greater than 1;

[0011] If so, then the coordinate points of the first target column and / or the second target column are supplemented in the vertical direction so that the minimum vertical coordinate difference between the coordinate points already drawn in the first target column and the coordinate points already drawn in the second target column is equal to 1, and the step of determining the adjacent first target column and second target column is re-entered until the coordinate point supplementation operation of all columns in the image is completed.

[0012] If not, then re-enter the step of determining the adjacent first target column and second target column until all columns in the image have completed the drawing of coordinate points.

[0013] Specifically, the process of supplementing the coordinate points of the first target column and / or the second target column vertically, so that the minimum vertical coordinate difference between the drawn coordinate points in the first target column and the drawn coordinate points in the second target column is equal to 1, includes:

[0014] Determine a first coordinate point on the first target column and a second coordinate point on the second target column; wherein, the difference in the ordinate between the first coordinate point and the second coordinate point is the minimum difference in the ordinate between the drawn coordinate points on the first target column and the drawn coordinate points on the second target column;

[0015] If the x-coordinate of the first coordinate point is less than the x-coordinate of the second coordinate point and the y-coordinate of the first coordinate point is less than the y-coordinate of the second coordinate point, then a coordinate point is drawn below the second coordinate point so that the minimum y-coordinate difference between the first coordinate point and the coordinate point already drawn on the second target column is equal to 1.

[0016] If the x-coordinate of the first coordinate point is less than the x-coordinate of the second coordinate point and the y-coordinate of the first coordinate point is greater than the y-coordinate of the second coordinate point, then a coordinate point is drawn above the second coordinate point so that the minimum y-coordinate difference between the first coordinate point and the already drawn coordinate point on the second target column is equal to 1.

[0017] Specifically, the process of supplementing the coordinate points of the first target column and / or the second target column vertically, so that the minimum vertical coordinate difference between the drawn coordinate points in the first target column and the drawn coordinate points in the second target column is equal to 1, includes:

[0018] Determine a first coordinate point on the first target column and a second coordinate point on the second target column; wherein, the difference in the ordinate between the first coordinate point and the second coordinate point is the minimum difference in the ordinate between the drawn coordinate points on the first target column and the drawn coordinate points on the second target column;

[0019] If the x-coordinate of the first coordinate point is greater than the x-coordinate of the second coordinate point and the y-coordinate of the first coordinate point is less than the y-coordinate of the second coordinate point, then a coordinate point is drawn below the second coordinate point so that the minimum y-coordinate difference between the first coordinate point and the coordinate points already drawn on the second target column is equal to 1.

[0020] If the x-coordinate of the first coordinate point is greater than the x-coordinate of the second coordinate point and the y-coordinate of the first coordinate point is greater than the y-coordinate of the second coordinate point, then a coordinate point is drawn above the second coordinate point so that the minimum y-coordinate difference between the first coordinate point and the coordinate points already drawn on the second target column is equal to 1.

[0021] Specifically, the process of supplementing the coordinate points of the first target column and / or the second target column vertically, so that the minimum vertical coordinate difference between the drawn coordinate points in the first target column and the drawn coordinate points in the second target column is equal to 1, includes:

[0022] Determine a first coordinate point on the first target column and a second coordinate point on the second target column; wherein, the difference in the ordinate between the first coordinate point and the second coordinate point is the minimum difference in the ordinate between the drawn coordinate points on the first target column and the drawn coordinate points on the second target column;

[0023] If the ordinate of the first coordinate point is less than the ordinate of the second coordinate point, then add coordinate points above the first coordinate point and below the second coordinate point, so that the minimum difference in ordinate between the coordinate points already drawn on the first target column and the coordinate points already drawn on the second target column is equal to 1;

[0024] If the ordinate of the first coordinate point is greater than the ordinate of the second coordinate point, then add coordinate points below the first coordinate point and above the second coordinate point, so that the minimum ordinate difference between the coordinate points already drawn on the first target column and the coordinate points already drawn on the second target column is equal to 1.

[0025] The drawn coordinate points are the coordinate points in the image whose pixel values ​​are preset values.

[0026] To achieve the above objectives, this application provides an image processing apparatus, comprising:

[0027] The acquisition module is used to acquire the x-coordinate and y-coordinate of the original coordinate points in the image; wherein, each column in the image has a corresponding original coordinate point;

[0028] The supplementary drawing module is used to supplement the original coordinate points of adjacent horizontal coordinates in the vertical direction, so that the minimum vertical coordinate difference between two adjacent columns of drawn coordinate points is equal to 1; wherein, the drawn coordinate points include the original coordinate points and the supplementary coordinate points.

[0029] If the ordinate of the original coordinate point falls into the adjacent column of already drawn coordinate points, the column containing the original coordinate point does not need to be redrawn.

[0030] The supplementary drawing module includes:

[0031] The judgment unit is used to determine the adjacent first target column and second target column, and to determine whether the minimum ordinate difference between the coordinate points on the first target column and the coordinate points on the second target column is greater than 1; if yes, the workflow of the supplementary drawing unit is started; if no, the workflow of the judgment unit is restarted.

[0032] The supplementary drawing unit is used to supplement the coordinate points of the first target column and / or the second target column in the vertical direction, so that the minimum vertical coordinate difference between the coordinate points already drawn on the first target column and the coordinate points already drawn on the second target column is equal to 1, and then re-enter the step of determining the adjacent first target column and second target column, until all columns in the image have completed the supplementary drawing of coordinate points.

[0033] To achieve the above objectives, this application provides an electronic device, comprising:

[0034] Memory, used to store computer programs;

[0035] A processor for executing the computer program to implement the steps of the image processing method described above.

[0036] To achieve the above objectives, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the image processing method described above.

[0037] As can be seen from the above scheme, the image processing method provided in this application includes: obtaining the x-coordinate and y-coordinate of the original coordinate points in the image; wherein, each column in the image has a corresponding original coordinate point; performing coordinate point supplementation on the original coordinate points of adjacent x-coordinates in the vertical direction, such that the minimum y-coordinate difference between the drawn coordinate points of two adjacent columns is equal to 1; wherein, the drawn coordinate points include the original coordinate points and the supplemented coordinate points; wherein, if the y-coordinate of the original coordinate point falls into the drawn coordinate points of an adjacent column, the column where the original coordinate point is located does not need to be supplemented.

[0038] The image processing method provided in this application, if the ordinate of the original coordinate point falls within the adjacent column of already drawn coordinate points, does not require additional drawing of coordinate points in that column, reducing redundant drawing of points, reducing the occurrence of small polylines, and improving the fitting efficiency of coordinate points. Furthermore, in the process of connecting the original coordinate points of adjacent horizontal coordinates, additional drawing of coordinate points is performed vertically starting from the original coordinate point, ensuring that the minimum ordinate difference between the drawn coordinate points in two adjacent columns is equal to 1. That is, adjacent columns intersect diagonally at the intersection, achieving a smooth transition between adjacent columns and improving the smoothness of the linear fitting of coordinate points. This application also discloses an image processing device, an electronic device, and a computer-readable storage medium, which can achieve the same technical effects.

[0039] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this application. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. The drawings are used to provide a further understanding of this disclosure and constitute a part of the specification. They are used together with the following detailed description to explain this disclosure, but do not constitute a limitation of this disclosure. In the drawings:

[0041] Figure 1 This is a flowchart illustrating an image processing method according to an exemplary embodiment;

[0042] Figure 2 A flowchart illustrating another image processing method according to an exemplary embodiment;

[0043] Figure 3 This is an illustration of the effect of image processing according to an exemplary embodiment;

[0044] Figure 4 This is a structural diagram of an image processing apparatus according to an exemplary embodiment;

[0045] Figure 5 This is a structural diagram of an electronic device according to an exemplary embodiment. Detailed Implementation

[0046] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Furthermore, in the embodiments of this application, "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0047] This application discloses an image processing method that improves the efficiency and smoothness of image processing.

[0048] See Figure 1 A flowchart illustrating an image processing method according to an exemplary embodiment, such as... Figure 1 As shown, it includes:

[0049] S101: Obtain the x and y coordinates of the original coordinate points in the image; wherein, each column in the image has a corresponding original coordinate point;

[0050] The purpose of this embodiment is to connect the original coordinate points in an image. Here, coordinate points refer to pixels in the image, and the original coordinate points can be coordinate points with preset pixel values. In this step, the x-coordinate and y-coordinate of the original coordinate points are obtained. It should be noted that in this embodiment, each column in the image has a corresponding original coordinate point, and subsequent steps connect the original coordinate points of adjacent x-coordinates. As a feasible implementation, the image in this step can be a spectral image corresponding to the diagnostic site. The original coordinate points are the points with the highest amplitude in the spectral image. Connecting the points with the highest amplitude of adjacent x-coordinates yields an envelope. Based on this envelope, the diagnostic parameters corresponding to the diagnostic site can be determined. For example, if the image is a spectral image of a blood vessel, the resulting envelope can be used to determine blood flow parameters.

[0051] S102: The original coordinate points of adjacent horizontal coordinates are supplemented by drawing coordinate points in the vertical direction, so that the minimum vertical coordinate difference between the two adjacent columns of drawn coordinate points is equal to 1; wherein, the drawn coordinate points include the original coordinate points and the supplemented coordinate points; wherein, if the vertical coordinate of the original coordinate point falls into the column of drawn coordinate points of the adjacent column, the column where the original coordinate point is located does not need to be supplemented by drawing coordinate points.

[0052] The purpose of this step is to connect the original coordinate points of adjacent horizontal axes. In practice, the coordinate points are supplemented vertically starting from the original coordinate points. After supplementation, the drawn coordinate points in the image include both the original coordinate points and the supplemented coordinate points. These can also be coordinate points with preset pixel values. After supplementation, the minimum vertical coordinate difference between the drawn coordinate points of two adjacent columns is equal to 1, meaning that adjacent columns intersect diagonally at the intersection.

[0053] It should be noted that if the ordinate of the original coordinate point falls into the adjacent column of drawn coordinate points, that is, if the original coordinate point has the same ordinate as the drawn coordinate point in the adjacent column, it means that the original coordinate point has been connected with the drawn coordinate points in the adjacent column, and the column where the original coordinate point is located does not need to be drawn again.

[0054] The image processing method provided in this application embodiment, if the ordinate of the original coordinate point falls into the adjacent column of already drawn coordinate points, does not require additional drawing of coordinate points in that column, reducing redundant drawing of points, reducing the occurrence of small polylines, and improving the fitting efficiency of coordinate points. Furthermore, in the process of connecting the original coordinate points of adjacent horizontal coordinates, additional drawing of coordinate points is performed vertically starting from the original coordinate point, ensuring that the minimum ordinate difference between the drawn coordinate points in the adjacent two columns is equal to 1. That is, adjacent columns intersect at the intersection in the form of diagonal lines, achieving a smooth transition between adjacent columns and improving the smoothness of the linear fitting of coordinate points.

[0055] This application discloses an image processing method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:

[0056] See Figure 2 A flowchart illustrating another image processing method according to an exemplary embodiment, such as Figure 2 As shown, it includes:

[0057] S201: Obtain the x and y coordinates of the original coordinate points in the image; wherein, each column in the image has a corresponding original coordinate point;

[0058] S202: Determine the adjacent first target column and second target column;

[0059] S203: Determine whether the minimum ordinate difference between the coordinate points on the first target column and the coordinate points on the second target column is greater than 1; if yes, proceed to S204; if no, re-enter S202 until all columns in the image have completed the coordinate point completion operation.

[0060] In this embodiment, for adjacent first target columns and second target columns, if the minimum ordinate difference between the coordinate points on the first target column and the coordinate points on the second target column is greater than 1, the coordinate points need to be supplemented to connect the coordinate points in the first target column and the second target column. Otherwise, the adjacent first target columns and second target columns are re-determined until all columns in the image have completed the coordinate point supplementation operation.

[0061] S204: The coordinate points of the first target column and / or the second target column are supplemented in the vertical direction so that the minimum vertical coordinate difference between the drawn coordinate points in the first target column and the drawn coordinate points in the second target column is equal to 1; wherein, the drawn coordinate points include the original coordinate points and the supplemented coordinate points.

[0062] It should be noted that this embodiment does not limit the connection order of coordinate points. Coordinate points can be connected sequentially from the left side of the image to the right side. Specifically, this step includes: determining a first coordinate point on the first target column and a second coordinate point on the second target column; wherein the difference in the ordinate between the first and second coordinate points is the minimum difference in the ordinate between the already drawn coordinate points on the first and second target columns; if the x-coordinate of the first coordinate point is less than the x-coordinate of the second coordinate point and the ordinate of the first coordinate point is less than the ordinate of the second coordinate point, then a coordinate point is drawn below the second coordinate point so that the minimum difference in the ordinate between the first coordinate point and the already drawn coordinate points on the second target column equals 1; if the x-coordinate of the first coordinate point is less than the x-coordinate of the second coordinate point and the ordinate of the first coordinate point is greater than the ordinate of the second coordinate point, then a coordinate point is drawn above the second coordinate point so that the minimum difference in the ordinate between the first coordinate point and the already drawn coordinate points on the second target column equals 1. In specific implementation, initially, a first coordinate point and a second coordinate point with adjacent x-coordinates are selected from the leftmost side of the image and connected, and then the first and second coordinate points are sequentially moved to the right and updated. In this scenario, the x-coordinate of the first coordinate point is less than the x-coordinate of the second coordinate point. When connecting the first and second coordinate points, the coordinate point is drawn in the column containing the coordinate point with the larger x-coordinate, i.e., the second coordinate point. If the y-coordinate of the first coordinate point is less than the y-coordinate of the second coordinate point, a new coordinate point is drawn below the second coordinate point. If the y-coordinate of the first coordinate point is greater than the y-coordinate of the second coordinate point, a new coordinate point is drawn above the second coordinate point.

[0063] Of course, coordinate points on the right side of the image can also be sequentially connected to coordinate points on the left side of the image. This step includes: determining a first coordinate point on the first target column and a second coordinate point on the second target column; wherein the difference in the ordinate between the first and second coordinate points is the minimum difference in the ordinate between the already drawn coordinate points on the first and second target columns; if the x-coordinate of the first coordinate point is greater than the x-coordinate of the second coordinate point and the ordinate of the first coordinate point is less than the ordinate of the second coordinate point, then a coordinate point is drawn below the second coordinate point so that the minimum difference in the ordinate between the first coordinate point and the already drawn coordinate points on the second target column equals 1; if the x-coordinate of the first coordinate point is greater than the x-coordinate of the second coordinate point and the ordinate of the first coordinate point is greater than the ordinate of the second coordinate point, then a coordinate point is drawn above the second coordinate point so that the minimum difference in the ordinate between the first coordinate point and the already drawn coordinate points on the second target column equals 1. In specific implementation, initially, a first coordinate point and a second coordinate point with adjacent x-coordinates are selected from the far right of the image and connected, and then the first and second coordinate points are sequentially moved to the left and updated. In this scenario, if the x-coordinate of the first coordinate point is greater than that of the second coordinate point, when connecting the first and second coordinate points, the coordinate point with the smaller x-coordinate (i.e., the column containing the second coordinate point) is drawn. If the y-coordinate of the first coordinate point is less than that of the second coordinate point, a new coordinate point is drawn below the second coordinate point. If the y-coordinate of the first coordinate point is greater than that of the second coordinate point, a new coordinate point is drawn above the second coordinate point.

[0064] Furthermore, coordinate points can be simultaneously drawn on both the first and second target columns. This step includes: determining a first coordinate point on the first target column and a second coordinate point on the second target column; wherein the difference in the ordinate between the first and second coordinate points is the minimum difference in the ordinate between the already drawn coordinate points on the first and second target columns; if the ordinate of the first coordinate point is less than the ordinate of the second coordinate point, coordinate points are drawn above the first coordinate point and below the second coordinate point to make the minimum difference in the ordinate between the already drawn coordinate points on the first and second target columns equal to 1; if the ordinate of the first coordinate point is greater than the ordinate of the second coordinate point, coordinate points are drawn below the first coordinate point and above the second coordinate point to make the minimum difference in the ordinate between the already drawn coordinate points on the first and second target columns equal to 1. In a specific implementation, if the ordinate of the first coordinate point is less than the ordinate of the second coordinate point, coordinate points are drawn above the first coordinate point and below the second coordinate point. If the ordinate of the first coordinate point is greater than the ordinate of the second coordinate point, then add coordinate points below the first coordinate point and above the second coordinate point.

[0065] The following describes an application embodiment provided in this application; see [link to application example]. Figure 3 , Figure 3 The solid points in the diagram represent the initial coordinate points, while the hollow points represent the final drawn coordinate points. Specifically, this may include the following steps:

[0066] Step 1: Starting from the points in the first column, during the process of connecting the points in the first column to the points in the second column, calculate the difference in the ordinates between the points in the first column and the points in the second column. If the difference in the ordinates is less than or equal to 1, no additional point drawing operation is required. If the difference in the ordinates is greater than or equal to 2, proceed to Step 2 to perform the point drawing operation.

[0067] Step 2: Draw points along the vertical coordinates of the points in the second column, continuing until the vertical coordinate of the points differs from that of the first point by 1. The first and second columns intersect in the form of a diagonal line, achieving a smooth transition between the two columns.

[0068] Step 3: Starting from the point in the second column, connect the points in the third column in the same way as described above, and so on, connecting the points in all columns.

[0069] Step 4: If the left point of a point in a column has already been drawn, such as column 10, then there is no need to draw the sink point in the vertical direction of that column.

[0070] Figure 3The connection between points is represented by lines. These lines do not exist in reality; they are only used to represent the effect. In reality, the vertical coordinate difference between discrete pixels is not too large, which visually creates the effect of connecting lines.

[0071] The following describes an image processing apparatus provided in an embodiment of this application. The image processing apparatus described below and the image processing method described above can be referred to each other.

[0072] See Figure 4 A structural diagram of an image processing apparatus according to an exemplary embodiment is shown, such as... Figure 4 As shown, it includes:

[0073] The acquisition module 401 is used to acquire the x-coordinate and y-coordinate of the original coordinate points in the image; wherein, each column in the image has a corresponding original coordinate point;

[0074] The supplementary drawing module 402 is used to supplement the original coordinate points of adjacent horizontal coordinates in the vertical direction, so that the minimum vertical coordinate difference between two adjacent columns of drawn coordinate points is equal to 1; wherein, the drawn coordinate points include the original coordinate points and the supplementary coordinate points.

[0075] If the ordinate of the original coordinate point falls into the adjacent column of already drawn coordinate points, the column containing the original coordinate point does not need to be redrawn.

[0076] The image processing apparatus provided in this application embodiment, if the ordinate of the original coordinate point falls into the adjacent column of already drawn coordinate points, does not require additional drawing of coordinate points in that column, reducing redundant drawing of points, reducing the occurrence of small polylines, and improving the fitting efficiency of coordinate points. Furthermore, in the process of connecting the original coordinate points of adjacent horizontal coordinates, additional drawing of coordinate points is performed vertically starting from the original coordinate point, ensuring that the minimum ordinate difference between the drawn coordinate points in the adjacent two columns is equal to 1. That is, adjacent columns intersect at the intersection in the form of diagonal lines, achieving a smooth transition between adjacent columns and improving the smoothness of the linear fitting of coordinate points.

[0077] Based on the above embodiments, as a preferred embodiment, the supplementary drawing module includes:

[0078] The judgment unit is used to determine the adjacent first target column and second target column, and to determine whether the minimum ordinate difference between the coordinate points on the first target column and the coordinate points on the second target column is greater than 1; if yes, the workflow of the supplementary drawing unit is started; if no, the workflow of the judgment unit is restarted.

[0079] The supplementary drawing unit is used to supplement the coordinate points of the first target column and / or the second target column in the vertical direction, so that the minimum vertical coordinate difference between the coordinate points already drawn on the first target column and the coordinate points already drawn on the second target column is equal to 1, and then re-enter the step of determining the adjacent first target column and second target column, until all columns in the image have completed the supplementary drawing of coordinate points.

[0080] Based on the above embodiments, as a preferred embodiment, the supplementary drawing unit includes:

[0081] A sub-unit is defined to determine a first coordinate point on the first target column and a second coordinate point on the second target column; wherein the difference in the ordinate between the first coordinate point and the second coordinate point is the minimum difference in the ordinate between the drawn coordinate points on the first target column and the drawn coordinate points on the second target column.

[0082] The first supplementary drawing subunit is used to supplement a coordinate point below the second coordinate point if the x-coordinate of the first coordinate point is less than the x-coordinate of the second coordinate point and the y-coordinate of the first coordinate point is less than the y-coordinate of the second coordinate point, so that the minimum y-coordinate difference between the first coordinate point and the already drawn coordinate point on the second target column is equal to 1.

[0083] The second supplementary drawing subunit is used to supplement a coordinate point above the second coordinate point if the x-coordinate of the first coordinate point is less than the x-coordinate of the second coordinate point and the y-coordinate of the first coordinate point is greater than the y-coordinate of the second coordinate point, so that the minimum y-coordinate difference between the first coordinate point and the already drawn coordinate point on the second target column is equal to 1.

[0084] Based on the above embodiments, as a preferred embodiment, the supplementary drawing unit includes:

[0085] A sub-unit is defined to determine a first coordinate point on the first target column and a second coordinate point on the second target column; wherein the difference in the ordinate between the first coordinate point and the second coordinate point is the minimum difference in the ordinate between the drawn coordinate points on the first target column and the drawn coordinate points on the second target column.

[0086] The third supplementary drawing subunit is used to supplement a coordinate point below the second coordinate point if the x-coordinate of the first coordinate point is greater than the x-coordinate of the second coordinate point and the y-coordinate of the first coordinate point is less than the y-coordinate of the second coordinate point, so that the minimum y-coordinate difference between the first coordinate point and the already drawn coordinate point on the second target column is equal to 1.

[0087] The fourth supplementary drawing subunit is used to draw a coordinate point above the second coordinate point if the x-coordinate of the first coordinate point is greater than the x-coordinate of the second coordinate point and the y-coordinate of the first coordinate point is greater than the y-coordinate of the second coordinate point, so that the minimum y-coordinate difference between the first coordinate point and the already drawn coordinate point on the second target column is equal to 1.

[0088] Based on the above embodiments, as a preferred embodiment, the supplementary drawing unit includes:

[0089] A sub-unit is defined to determine a first coordinate point on the first target column and a second coordinate point on the second target column; wherein the difference in the ordinate between the first coordinate point and the second coordinate point is the minimum difference in the ordinate between the drawn coordinate points on the first target column and the drawn coordinate points on the second target column.

[0090] The fifth supplementary drawing subunit is used to supplement coordinate points above the first coordinate point and below the second coordinate point if the ordinate of the first coordinate point is less than the ordinate of the second coordinate point, so that the minimum ordinate difference between the coordinate points already drawn on the first target column and the coordinate points already drawn on the second target column is equal to 1.

[0091] The sixth supplementary drawing subunit is used to supplement coordinate points below the first coordinate point and above the second coordinate point if the ordinate of the first coordinate point is greater than the ordinate of the second coordinate point, so that the minimum ordinate difference between the coordinate points already drawn on the first target column and the coordinate points already drawn on the second target column is equal to 1.

[0092] Based on the above embodiments, as a preferred embodiment, the drawn coordinate points are coordinate points in the image whose pixel values ​​are preset values.

[0093] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0094] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiments of this application, the embodiments of this application also provide an electronic device. Figure 5 This is a structural diagram of an electronic device according to an exemplary embodiment, such as... Figure 5 As shown, the electronic device includes:

[0095] Communication interface 1 enables information exchange with other devices, such as network devices;

[0096] Processor 2 is connected to communication interface 1 to enable information interaction with other devices and to execute the image processing methods provided by one or more of the above-mentioned technical solutions when running computer programs. The computer program is stored in memory 3.

[0097] Of course, in practical applications, the various components in an electronic device are coupled together through bus system 4. It can be understood that bus system 4 is used to achieve communication and connection between these components. In addition to the data bus, bus system 4 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 5 The general will label all buses as Bus System 4.

[0098] The memory 3 in this embodiment is used to store various types of data to support the operation of the electronic device. Examples of such data include any computer program used to operate on the electronic device.

[0099] It is understood that memory 3 can be volatile memory or non-volatile memory, or both. 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), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. 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 RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 2 described in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0100] The methods disclosed in the embodiments of this application can be applied to processor 2, or implemented by processor 2. Processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 2 or by instructions in the form of software. The processor 2 may be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 2 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory 3. Processor 2 reads the program in memory 3 and completes the steps of the aforementioned method in combination with its hardware.

[0101] When processor 2 executes the program, it implements the corresponding processes in the various methods of the embodiments of this application. For the sake of brevity, these will not be described in detail here.

[0102] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory 3 that stores a computer program, which can be executed by a processor 2 to complete the steps described in the aforementioned method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.

[0103] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0104] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the prior art, 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 an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0105] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An image processing method, characterized by, The method comprises the following steps: acquiring the horizontal coordinate and the vertical coordinate of the original coordinate point in the image; wherein, each column in the image has a corresponding original coordinate point; performing coordinate point filling in the vertical direction on the original coordinate points with adjacent horizontal coordinates, so that the minimum vertical coordinate difference between the drawn coordinate points of the adjacent two columns is equal to 1; wherein, the drawn coordinate points include the original coordinate points and the filled coordinate points; wherein, if the vertical coordinate of the original coordinate point falls into the drawn coordinate points of the adjacent column, the column where the original coordinate point is located does not need to perform coordinate point filling; wherein, the performing coordinate point filling in the vertical direction on the original coordinate points with adjacent horizontal coordinates, so that the minimum vertical coordinate difference between the drawn coordinate points of the adjacent two columns is equal to 1, comprises: determining the first target column and the second target column adjacent to each other, and judging whether the minimum vertical coordinate difference between the coordinate points on the first target column and the coordinate points on the second target column is greater than 1; if yes, performing coordinate point filling in the vertical direction on the first target column and / or the second target column, so that the minimum vertical coordinate difference between the drawn coordinate points on the first target column and the drawn coordinate points on the second target column is equal to 1, and returning to the step of determining the first target column and the second target column adjacent to each other until all the columns in the image complete the coordinate point filling operation; if no, returning to the step of determining the first target column and the second target column adjacent to each other until all the columns in the image complete the coordinate point filling.

2. The image processing method of claim 1, wherein, The performing coordinate point filling in the vertical direction on the first target column and / or the second target column, so that the minimum vertical coordinate difference between the drawn coordinate points on the first target column and the drawn coordinate points on the second target column is equal to 1, comprises: determining the first coordinate point on the first target column and the second coordinate point on the second target column; wherein, the vertical coordinate difference between the first coordinate point and the second coordinate point is the minimum vertical coordinate difference between the drawn coordinate points on the first target column and the drawn coordinate points on the second target column; if the horizontal coordinate of the first coordinate point is less than the horizontal coordinate of the second coordinate point and the vertical coordinate of the first coordinate point is less than the vertical coordinate of the second coordinate point, filling a coordinate point below the second coordinate point, so that the minimum vertical coordinate difference between the first coordinate point and the drawn coordinate points on the second target column is equal to 1; if the horizontal coordinate of the first coordinate point is less than the horizontal coordinate of the second coordinate point and the vertical coordinate of the first coordinate point is greater than the vertical coordinate of the second coordinate point, filling a coordinate point above the second coordinate point, so that the minimum vertical coordinate difference between the first coordinate point and the drawn coordinate points on the second target column is equal to 1.

3. The image processing method of claim 1, wherein, The performing coordinate point filling in the vertical direction on the first target column and / or the second target column, so that the minimum vertical coordinate difference between the drawn coordinate points on the first target column and the drawn coordinate points on the second target column is equal to 1, comprises: determining a first coordinate point on the first target column and a second coordinate point on the second target column; wherein a vertical coordinate difference between the first coordinate point and the second coordinate point is a minimum vertical coordinate difference between the drawn coordinate point on the first target column and the drawn coordinate point on the second target column; if the horizontal coordinate of the first coordinate point is greater than the horizontal coordinate of the second coordinate point and the vertical coordinate of the first coordinate point is less than the vertical coordinate of the second coordinate point, drawing a coordinate point below the second coordinate point so that the minimum vertical coordinate difference between the first coordinate point and the drawn coordinate point on the second target column is equal to 1; if the horizontal coordinate of the first coordinate point is greater than the horizontal coordinate of the second coordinate point and the vertical coordinate of the first coordinate point is greater than the vertical coordinate of the second coordinate point, drawing a coordinate point above the second coordinate point so that the minimum vertical coordinate difference between the first coordinate point and the drawn coordinate point on the second target column is equal to 1.

4. The image processing method of claim 1, wherein, complementally drawing coordinate points in the vertical direction of the first target column and / or the second target column so that the minimum vertical coordinate difference between the drawn coordinate point on the first target column and the drawn coordinate point on the second target column is equal to 1, comprising: determining a first coordinate point on the first target column and a second coordinate point on the second target column; wherein a vertical coordinate difference between the first coordinate point and the second coordinate point is a minimum vertical coordinate difference between the drawn coordinate point on the first target column and the drawn coordinate point on the second target column; if the vertical coordinate of the first coordinate point is less than the vertical coordinate of the second coordinate point, drawing coordinate points above the first coordinate point and below the second coordinate point so that the minimum vertical coordinate difference between the drawn coordinate point on the first target column and the drawn coordinate point on the second target column is equal to 1; if the vertical coordinate of the first coordinate point is greater than the vertical coordinate of the second coordinate point, drawing coordinate points below the first coordinate point and above the second coordinate point so that the minimum vertical coordinate difference between the drawn coordinate point on the first target column and the drawn coordinate point on the second target column is equal to 1.

5. The image processing method of claim 1, wherein, the drawn coordinate point is a coordinate point with a preset value in the image.

6. An image processing apparatus characterized by comprising: comprising: an acquisition module, configured to acquire horizontal coordinates and vertical coordinates of original coordinate points in an image; wherein each column in the image has corresponding original coordinate points; a complementally drawing module, configured to complementally draw coordinate points in the vertical direction of the original coordinate points with adjacent horizontal coordinates so that the minimum vertical coordinate difference between the drawn coordinate points of two adjacent columns is equal to 1; wherein the drawn coordinate points include the original coordinate points and complementally drawn coordinate points; wherein if the vertical coordinate of an original coordinate point falls into the drawn coordinate points of an adjacent column, the column where the original coordinate point is located does not need to be complementally drawn; wherein the complementally drawing module comprises: A judging unit is configured to determine adjacent first target columns and second target columns, and determine whether a minimum vertical coordinate difference between a coordinate point on the first target column and a coordinate point on the second target column is greater than 1; if yes, a workflow of a filling unit is started; if no, the workflow of the judging unit is restarted; The filling unit is configured to fill coordinate points in a vertical direction for the first target column and / or the second target column, so that the minimum vertical coordinate difference between the coordinate points on the first target column and the coordinate points on the second target column is equal to 1, and the step of determining adjacent first target columns and second target columns is re-entered until all columns in the image complete the filling of coordinate points.

7. An electronic device, comprising: Comprise: a memory for storing a computer program; a processor for implementing the steps of the image processing method according to any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium, and the computer program is executed by the processor to implement the steps of the image processing method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Eye fundus image distortion correction method and confocal laser eye fundus imager

    CN112826443A

  • Picuture processor

    JP1992309072A