A method for document curve separation and coordinate information extraction based on image processing
Automatically obtain curve image data in scientific literature through image processing-based methods, which solves the problem that existing technology cannot efficiently obtain curve image data, and improves research efficiency and discipline development.
Patent Information
- Application Number
- CN202111490372.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-08
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-12-08
AI Technical Summary
Existing technology cannot automatically obtain curve image data in scientific literature, resulting in low research efficiency and inability to meet the growing research needs.
Using methods based on image processing, including reading documents, curve image segmentation, coordinate axis positioning, character detection and recognition, curve separation and extraction, the coordinate information of the curve image is automatically obtained through computer image recognition technology and saved in the database.
It improves the speed of obtaining scientific literature information, reduces research costs, and promotes the research and development of related disciplines.
Smart Images

Figure CN114332866B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for extracting information from curve images in scientific literature, including curve image segmentation, coordinate extraction and information extraction, etc. The method is applied to the fields of curve graph data extraction and corresponding database construction in literature of different disciplines, and improves the speed of data extraction of literature in the discipline to a certain extent, helps to improve the research progress and research efficiency of the research direction, and promotes the rapid development of the corresponding discipline. Background Art
[0002] In scientific research literature, the data information obtained from the experiment is often described by using curve graphs or tables. The data information in the table is usually displayed, but the coordinate data information of each point in the curve graph is often hidden in the image, so it is particularly important to obtain the curve data information in the curve image. In the early methods, manual selection can be used on the Matlab tool to obtain the points on the curve and export them, but this method is very inefficient and cannot automatically obtain a large amount of data on the curve image, which cannot meet the growing research needs and the explosive growth of literature data information. Therefore, a reliable detection method is needed to realize the automatic extraction of curve coordinate information. With the development of computer technology and image processing technology, the purpose of extracting curve information can be achieved by using computer image recognition technology and image processing methods, but how to combine computer information analysis with image analysis and extract information from the curve image of scientific literature still needs to design a more efficient solution, which has become a technical problem to be solved urgently. Summary of the invention
[0003] In order to solve the problems of the prior art, the purpose of the present invention is to overcome the shortcomings of the existing technology and provide a method for separating document curves and extracting coordinate information based on image processing, including separating curves and extracting coordinate information in document images. In order to extract the coordinate information of curve images in a large number of documents, the present invention proposes a new algorithm that can automatically obtain the coordinate information of curves of different colors in the image. For a curve graph, the coordinate axis can be located, the X-axis coordinate value, the Y-axis coordinate value, and the curve separation problem can be solved. Therefore, the new method proposed by the present invention can realize the information extraction of scientific document curve graphs, improve the speed of document information acquisition, reduce research costs, and promote the research and development of related disciplines.
[0004] In order to achieve the above invention purpose, the present invention adopts the following technical solution:
[0005] A method for separating document curves and extracting coordinate information based on image processing comprises the following steps:
[0006] (1) Read a document, extract the curve image in the document, save it in a picture format, and store the access path of the picture in a path list;
[0007] (2) Read a curve image and segment the curve image into three parts: the X-axis, the Y-axis, and the remaining curve content, and obtain the coordinate information, specifically:
[0008] First, the read curve image is preprocessed, including denoising, binarization, and contrast enhancement;
[0009] Then, according to the rule that the X-axis and the Y-axis are fixed perpendicular to each other, the position information of the coordinate axis perpendicular to each coordinate axis is obtained to complete the image segmentation process;
[0010] (3) Character detection and recognition: For the intercepted X-axis and Y-axis images, character detection and character recognition are performed to obtain the required data information and provide a data source for the conversion between pixel coordinates and real coordinates;
[0011] (4) Curve separation and extraction: After completing the processing of the X-axis and Y-axis, the curve graph is processed. For a standard curve graph with multiple color distinctions, each curve is extracted separately according to the color of the curve to obtain the pixel coordinate information of the curve;
[0012] (5) Curve coordinate calculation: Separate the curves of different colors in the curve image, calculate and export the coordinates, save the data extracted from the curve into the database, and complete the coordinate information extraction.
[0013] Preferably, in step (2), the specific steps of segmenting the curve image are as follows:
[0014] (2-1) Convert the original curve graph to a grayscale image, where the black pixel value is 0, the white pixel value is 255, and the other gray pixel values are between 0 and 255;
[0015] (2-2) Get the coordinate system X-axis information: define a rectangle with a width equal to the image width and a height of one pixel. Set the pixel value in the rectangle to 1. Use this rectangle to slide the image from top to bottom, multiply the pixel value at the corresponding position, and then add the multiplication results of all the image widths to get a set of calculation results. Compare and get the minimum value among all the values. The array number is the pixel coordinate of the required X-axis.
[0016] (2-3) Get the Y-axis information of the coordinate system: define a rectangle with a height equal to the image height and a width of one pixel. Set the pixel value in the rectangle to 1. Use this rectangle to slide the image from left to right, multiply the pixel value at the corresponding position, and then add the multiplication results of all the image heights to get a set of calculation results. Compare and get the minimum value among all the values. The array number is the pixel coordinate of the required Y-axis.
[0017] (2-4) Divide the image into three parts, including the X-axis, the Y-axis and the curve content part, and save these three parts.
[0018] Preferably, in step (3), when character detection and recognition is performed, the region with characters on the X-axis and Y-axis images is detected from the image, and the specific value of the character and its position information are obtained. The specific steps are as follows:
[0019] (3-1) Read a picture of the coordinate axis;
[0020] (3-2) Use the CRAFT text detection model to detect the input image, identify the existing text characters and obtain the location information of the text;
[0021] (3-3) Use the ResNet+LSTM+CTC combined network structure to perform character recognition on the detected text area;
[0022] (3-4) decoding the information obtained in step (3-4) to obtain an output result, thereby obtaining the required text information, that is, the coordinate value information on the coordinate axis;
[0023] The digital character areas in the X-axis and Y-axis images are detected and identified, and the position information of the characters is obtained, providing a data source for the conversion between pixel coordinates and real coordinates.
[0024] Preferably, in step (4), curve separation and extraction are performed, and the curve regions of the curve image are separated according to different colors to generate multiple single curve images. The specific steps are as follows:
[0025] (4-1) Restoring the original color of the pixels in the segmented curve coordinate map;
[0026] (4-2) performing an erosion operation on the result image obtained in step (4-1) to expand the color features of the curve;
[0027] (4-3) Divide the image after corrosion obtained in step (4-2), count the number of times the pixel values of different colors appear, and when the number of times a color appears reaches a set threshold, it is considered that the curve of the entire image contains the color of this category;
[0028] (4-4) The obtained color RGB values are screened, similar colors are deleted, and only one main color is retained as the basis for extracting pixel blocks of this color in the image.
[0029] Preferably, in step (5), the curve coordinates are calculated, and the curves of different colors in the image are separated, and the coordinates are calculated and derived. The specific steps are as follows:
[0030] (5-1) Binarize the extracted separated curve image to obtain the coordinates corresponding to the pixel value of 255, which are the pixel coordinates;
[0031] (5-2) Transform the coordinate origin to the lower left corner;
[0032] (5-3) According to formula (1) and formula (2), the pixel coordinates are converted into real value coordinates and exported.
[0033]
[0034]
[0035] Where X, Y represent the coordinate values of the actual curve point data required for the final conversion; pX, pY are the pixel-level coordinates of each point on the curve; X min , Y min are the data values of the first detected digital coordinate data starting from the origin on the X and Y axes respectively; when obtaining the character values on the coordinate axes, character detection and recognition are required. At the same time, character detection will draw a rectangular detection box for each digital character, pX i , pX j Represents the horizontal coordinate of the pixel at the top left corner of the rectangular box during the detection of the values of the front and rear coordinate axes; X i , X j is the specific value of coordinate detection; pY i , pY j Represents the vertical coordinate of the pixel at the top left corner of the rectangular box during the detection of the values of the upper and lower coordinate axes of the Y axis; i , Y j The specific value after character recognition for coordinate detection;
[0036] (5-4) Finally, the coordinate information of different curves in the curve image is extracted and saved as an Excel file.
[0037] Compared with the prior art, the present invention has the following obvious outstanding substantive features and significant advantages:
[0038] 1. The present invention can separate the X-axis and the Y-axis, thereby realizing the extraction of data on a specific axis;
[0039] 2. The present invention can extract the values of the coordinate axes on the document curve graph;
[0040] 3. The present invention can extract curve information from the curve graph;
[0041] 4. The curve separation and coordinate information extraction method in the document of the present invention can realize coordinate segmentation, content recognition and coordinate extraction, improve the speed of document information extraction, provide a method for building a corresponding subject database, and promote the research and development of the corresponding subject. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 The figure is a flow chart of a method according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the scheme of the present invention, the preferred embodiments of the present invention are combined with the accompanying drawings to clarify and fully describe the technical scheme in the embodiments of the present invention. Obviously, the described embodiments are only part of the implementation cases of the present invention, not all implementation cases. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0044] The above scheme is further described below in conjunction with specific implementation examples. The preferred embodiments of the present invention are described in detail as follows:
[0045] Embodiment 1:
[0046] In this embodiment, see Figure 1 , a method for separating document curves and extracting coordinate information based on image processing, comprising the following steps:
[0047] (1) Read a document, extract the curve image in the document, save it in a picture format, and store the access path of the picture in a path list;
[0048] (2) Read a curve image and segment the curve image into three parts: the X-axis, the Y-axis, and the remaining curve content, and obtain the coordinate information, specifically:
[0049] First, the read curve image is preprocessed, including denoising, binarization, and contrast enhancement;
[0050] Then, according to the rule that the X-axis and the Y-axis are fixed perpendicular to each other, the position information of the coordinate axis perpendicular to each coordinate axis is obtained to complete the image segmentation process;
[0051] (3) Character detection and recognition: For the intercepted X-axis and Y-axis images, character detection and character recognition are performed to obtain the required data information and provide a data source for the conversion between pixel coordinates and real coordinates;
[0052] (4) Curve separation and extraction: After completing the processing of the X-axis and Y-axis, the curve graph is processed. For a standard curve graph with multiple color distinctions, each curve is extracted separately according to the color of the curve to obtain the pixel coordinate information of the curve;
[0053] (5) Curve coordinate calculation: Separate the curves of different colors in the curve image, calculate and export the coordinates, save the data extracted from the curve into the database, and complete the coordinate information extraction.
[0054] The method of this embodiment can automatically obtain the coordinate information of different color curves in the image. For a curve graph, it can locate the coordinate axis, obtain the X-axis coordinate value, the Y-axis coordinate value, separate the curve, and other problems. The method of this embodiment realizes the information extraction of scientific literature curve graphs, improves the speed of obtaining literature information, and reduces research costs. This embodiment is based on the literature curve separation and coordinate information extraction method of image processing, and uses computer image detection methods to realize the segmentation and curve information extraction of literature curve images; first read a curve image, and use the image processing method to segment the curve image; then use the character detection algorithm to find the character area, and obtain the specific value and position information of the character area; then extract the curves of different colors on the curve graph according to the color, and after separating the curve graph into a single curve graph, it is convenient to calculate the coordinates of the curve; the curve separation and coordinate information extraction method in the literature of this embodiment can realize coordinate segmentation, content recognition and coordinate extraction, improve the speed of literature information extraction, and provide a method for building a corresponding subject database to promote the research and development of the corresponding subject.
[0055] Embodiment 2:
[0056] This embodiment is basically the same as the first embodiment, except that:
[0057] In this embodiment, in step (2), the specific steps of segmenting the curve image are as follows:
[0058] (2-1) Convert the original curve graph to a grayscale image, where the black pixel value is 0, the white pixel value is 255, and the other gray pixel values are between 0 and 255;
[0059] (2-2) Get the coordinate system X-axis information: define a rectangle with a width equal to the image width and a height of one pixel. Set the pixel value in the rectangle to 1. Use this rectangle to slide the image from top to bottom, multiply the pixel value at the corresponding position, and then add the multiplication results of all the image widths to get a set of calculation results. Compare and get the minimum value among all the values. The array number is the pixel coordinate of the required X-axis.
[0060] (2-3) Get the Y-axis information of the coordinate system: define a rectangle with a height equal to the image height and a width of one pixel. Set the pixel value in the rectangle to 1. Use this rectangle to slide the image from left to right, multiply the pixel value at the corresponding position, and then add the multiplication results of all the image heights to get a set of calculation results. Compare and get the minimum value among all the values. The array number is the pixel coordinate of the required Y-axis.
[0061] (2-4) Divide the image into three parts, including the X-axis, the Y-axis and the curve content part, and save these three parts.
[0062] This example divides the input curve image into three parts, which provides a basis for the subsequent recognition of coordinate values and separation of curves.
[0063] Embodiment three:
[0064] This embodiment is basically the same as the above embodiment, with the following features:
[0065] In this embodiment, in step (3), when character detection and recognition is performed, the region with characters on the X-axis and Y-axis images is detected from the image, and the specific value of the character and its position information are obtained. The specific steps are as follows:
[0066] (3-1) Read a picture of the coordinate axis;
[0067] (3-2) Use the CRAFT text detection model to detect the input image, identify the existing text characters and obtain the location information of the text;
[0068] (3-3) Use the ResNet+LSTM+CTC combined network structure to perform character recognition on the detected text area;
[0069] (3-4) decoding the information obtained in step (3-4) to obtain an output result, thereby obtaining the required text information, that is, the coordinate value information on the coordinate axis;
[0070] The digital character areas in the X-axis and Y-axis images are detected and identified, and the position information of the characters is obtained, providing a data source for the conversion between pixel coordinates and real coordinates.
[0071] This embodiment detects and recognizes the digital character area in the X-axis and Y-axis images, and also obtains the position information of the character, providing a basis for subsequent coordinate calculation.
[0072] Embodiment 4:
[0073] This embodiment is basically the same as the above embodiment, with the following features:
[0074] In this embodiment, in step (4), curve separation and extraction are performed, and the curve area of the curve image is separated according to the color difference to generate multiple single curve images. The specific steps are as follows:
[0075] (4-1) Restoring the original color of the pixels in the segmented curve coordinate map;
[0076] (4-2) performing an erosion operation on the result image obtained in step (4-1) to expand the color features of the curve;
[0077] (4-3) Divide the image after corrosion obtained in step (4-2), count the number of times the pixel values of different colors appear, and when the number of times a color appears reaches a set threshold, it is considered that the curve of the entire image contains the color of this category;
[0078] (4-4) The obtained color RGB values are screened, similar colors are deleted, and only one main color is retained as the basis for extracting pixel blocks of this color in the image.
[0079] This embodiment separates and extracts curves: after completing the processing of the X-axis and the Y-axis, the curve graph is processed. For a standard curve graph with multiple color distinctions, each curve is extracted separately according to the color of the curve to obtain the pixel coordinate information of the curve.
[0080] Embodiment five:
[0081] This embodiment is basically the same as the above embodiment, with the following features:
[0082] In this embodiment, in step (5), the curve coordinates are calculated, and the curves of different colors in the image are separated, and the coordinates are calculated and derived. The specific steps are as follows:
[0083] (5-1) Binarize the extracted separated curve image to obtain the coordinates corresponding to the pixel value of 255, which are the pixel coordinates;
[0084] (5-2) Transform the coordinate origin to the lower left corner;
[0085] (5-3) According to formula (1) and formula (2), the pixel coordinates are converted into real value coordinates and exported.
[0086]
[0087]
[0088] Where X, Y represent the coordinate values of the actual curve point data required for the final conversion; pX, pY are the pixel-level coordinates of each point on the curve; X min , Y min are the data values of the first detected digital coordinate data starting from the origin on the X and Y axes respectively; when obtaining the character values on the coordinate axes, character detection and recognition are required. At the same time, character detection will draw a rectangular detection box for each digital character, pX i , pX j Represents the horizontal coordinate of the pixel at the top left corner of the rectangular box during the detection of the values of the front and rear coordinate axes; X i , X j is the specific value of coordinate detection; pY i , pY j Represents the vertical coordinate of the pixel at the top left corner of the rectangular box during the detection of the values of the upper and lower coordinate axes of the Y axis; i , Y j The specific value after character recognition for coordinate detection;
[0089] (5-4) Finally, the coordinate information of different curves in the curve image is extracted and saved as an Excel file.
[0090] This embodiment performs curve coordinate calculation, separates curves of different colors in the curve image, and then calculates and exports the coordinates, saves the data extracted from the curve into a database, and completes the extraction of coordinate information.
[0091] In summary, Figure 1It is a flow chart of the method for separating document curves and extracting coordinate information based on image processing in the above embodiment of the present invention. The method of the above embodiment of the present invention first reads a document, extracts the content of the curve part in the document, converts it into a picture format and saves it, and stores the access path of the picture in a path list; reads a curve picture, and needs to segment the document curve image into three parts, the X axis, the Y axis and the curve part; then reads a picture, and pre-processes the read image, including denoising, binarization, contrast improvement, etc.; then, according to the rule that the coordinate axis is fixed perpendicular to the X axis and the Y axis, the position information of the coordinate axis perpendicular to each coordinate axis is obtained, thereby completing the image segmentation process; for the intercepted X axis and Y axis pictures, it is necessary to perform character detection and character recognition to obtain the required data information, and provide a data source for the subsequent conversion between pixel coordinates and real coordinates; for standard curve graphs with multiple color distinctions, the main method adopted is to extract each curve separately according to the different colors of the curves, and then a universal method can be adopted to obtain the pixel coordinate information of the curve.
[0092] The above describes the embodiments of the present invention in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments. Various changes can be made according to the purpose of the invention. Any changes, modifications, substitutions, combinations or simplifications made according to the spirit and principle of the technical solution of the present invention should be equivalent replacement methods. As long as they meet the purpose of the invention and do not deviate from the technical principles and inventive concepts of the present invention, they belong to the protection scope of the present invention.
Claims
1. A method for separating document curves and extracting coordinate information based on image processing, characterized in that: The steps include: (1) Read a document, extract the curve image in the document, save it in a picture format, and store the access path of the picture in a path list; (2) Read a curve image and segment the curve image into three parts: the X-axis, the Y-axis, and the remaining curve content, and obtain the coordinate information, specifically: First, the read curve image is preprocessed, including denoising, binarization, and contrast enhancement; Then, according to the rule that the X-axis and the Y-axis are fixed perpendicular to each other, the position information of the coordinate axis perpendicular to each coordinate axis is obtained to complete the image segmentation process; (3) Character detection and recognition: For the intercepted X-axis and Y-axis images, character detection and character recognition are performed to obtain the required data information and provide a data source for the conversion between pixel coordinates and real coordinates; (4) Curve separation and extraction: After completing the processing of the X-axis and Y-axis, the curve graph is processed. For a standard curve graph with multiple color distinctions, each curve is extracted separately according to the color of the curve to obtain the pixel coordinate information of the curve; (5) Curve coordinate calculation: Separate the curves of different colors in the curve image, calculate and export the coordinates, save the data extracted from the curve into the database, and complete the coordinate information extraction.
2. The method for separating document curves and extracting coordinate information based on image processing according to claim 1, characterized in that: In step (2), the specific steps of segmenting the curve image are as follows: (2-1) Convert the original curve graph to a grayscale image, where the black pixel value is 0, the white pixel value is 255, and the other gray pixel values are between 0 and 255; (2-2) Get the coordinate system X-axis information: define a rectangle with a width equal to the image width and a height of one pixel. Set the pixel value in the rectangle to 1. Use this rectangle to slide the image from top to bottom, multiply the pixel value at the corresponding position, and then add the multiplication results of all the image widths to get a set of calculation results. Compare and get the minimum value among all the values. The array number is the pixel coordinate of the required X-axis. (2-3) Get the Y-axis information of the coordinate system: define a rectangle with a height equal to the image height and a width of one pixel. Set the pixel value in the rectangle to 1. Use this rectangle to slide the image from left to right, multiply the pixel value at the corresponding position, and then add the multiplication results of all the image heights to get a set of calculation results. Compare and get the minimum value among all the values. The array number is the pixel coordinate of the required Y-axis. (2-4) Divide the image into three parts, including the X-axis, the Y-axis and the curve content part, and save these three parts.
3. The method for separating document curves and extracting coordinate information based on image processing according to claim 1, characterized in that: In step (3), when character detection and recognition is performed, the area with characters on the X-axis and Y-axis images is detected from the image, and the specific value of the character and its position information are obtained. The specific steps are as follows: (3-1) Read a picture of the coordinate axis; (3-2) Use the CRAFT text detection model to detect the input image, identify the existing text characters and obtain the location information of the text; (3-3) Use the ResNet+LSTM+CTC combined network structure to perform character recognition on the detected text area; (3-4) decoding the information obtained in step (3-4) to obtain an output result, thereby obtaining the required text information, that is, the coordinate value information on the coordinate axis; The digital character areas in the X-axis and Y-axis images are detected and identified, and the position information of the characters is obtained, providing a data source for the conversion between pixel coordinates and real coordinates.
4. The method for separating document curves and extracting coordinate information based on image processing according to claim 1, characterized in that: In the step (4), curve separation and extraction are performed, and the curve area of the curve image is separated according to the color difference to generate multiple single curve images. The specific steps are as follows: (4-1) Restoring the original color of the pixels in the segmented curve coordinate map; (4-2) performing an erosion operation on the result image obtained in step (4-1) to expand the color features of the curve; (4-3) Divide the image after corrosion obtained in step (4-2), count the number of times the pixel values of different colors appear, and when the number of times a color appears reaches a set threshold, it is considered that the curve of the entire image contains the color of this category; (4-4) The obtained color RGB values are screened, similar colors are deleted, and only one main color is retained as the basis for extracting pixel blocks of this color in the image.
5. The method for separating document curves and extracting coordinate information based on image processing according to claim 1, characterized in that: In step (5), the curve coordinates are calculated, and the curves of different colors in the image are separated, and the coordinates are calculated and exported. The specific steps are as follows: (5-1) Binarize the extracted separated curve image to obtain the coordinates corresponding to the pixel value of 255, which are the pixel coordinates; (5-2) Transform the coordinate origin to the lower left corner; (5-3) According to formula (1) and formula (2), the pixel coordinates are converted into coordinates of real values and exported; Where X, Y represent the coordinate values of the actual curve point data required for the final conversion; pX, pY are the pixel-level coordinates of each point on the curve; X min , Y min are the data values of the first detected digital coordinate data starting from the origin on the X and Y axes respectively; when obtaining the character values on the coordinate axes, character detection and recognition are required. At the same time, character detection will draw a rectangular detection box for each digital character, pX i , pX j Represents the horizontal coordinate of the pixel at the top left corner of the rectangular box during the value detection process of the two coordinate axes before and after the X axis; i , X j The specific value after character recognition for coordinate detection; pY i , pY j Represents the vertical coordinate of the pixel at the top left corner of the rectangular box during the detection of the values of the upper and lower coordinate axes of the Y axis; i , Y j Specific values after character recognition for coordinate detection (5-4) Finally, the coordinate information of different curves in the curve image is extracted and saved as an Excel file.
Citation Information
Patent Citations
Generation method and system for multi-axis curve graph
CN105068807A
Big data image curve reverse analysis method and system
CN107909068A
