CN112328825A - Picture construction method based on natural language processing - Google Patents
Picture construction method based on natural language processing Download PDFInfo
- Publication number
- CN112328825A CN112328825A CN202011082580.5A CN202011082580A CN112328825A CN 112328825 A CN112328825 A CN 112328825A CN 202011082580 A CN202011082580 A CN 202011082580A CN 112328825 A CN112328825 A CN 112328825A
- Authority
- CN
- China
- Prior art keywords
- construction method
- natural language
- picture
- method based
- language processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000010276 construction Methods 0.000 title claims abstract description 21
- 238000003058 natural language processing Methods 0.000 title claims abstract description 18
- 230000007797 corrosion Effects 0.000 claims abstract description 17
- 238000005260 corrosion Methods 0.000 claims abstract description 17
- 238000000605 extraction Methods 0.000 claims description 8
- 238000001914 filtration Methods 0.000 claims description 3
- 230000009466 transformation Effects 0.000 claims 1
- 238000012545 processing Methods 0.000 abstract description 10
- 230000006870 function Effects 0.000 abstract description 6
- 238000005516 engineering process Methods 0.000 abstract description 3
- 238000000034 method Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 230000010339 dilation Effects 0.000 description 2
- 230000003628 erosive effect Effects 0.000 description 2
- 238000013519 translation Methods 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000006740 morphological transformation Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/58—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/583—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
- G06F16/5846—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using extracted text
Landscapes
- Engineering & Computer Science (AREA)
- Library & Information Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a picture construction method based on natural language processing, comprising the following steps of; converting the needed pdf file into a picture through Smallpdf; step two; performing expansion and corrosion operation on the picture by using OpenCV; step three; performing character recognition; step four; the invention relates to the technical field of picture construction, and aims to match recognition results. The picture construction method based on natural language processing provides great convenience for processing of digital images and application of computer vision technology, and the picture construction method not only is completely free open source software, but also contains abundant functions of various image processing and recognition, and improves the running speed and accurate matching.
Description
Technical Field
The invention relates to the technical field of picture searching, in particular to a picture construction method based on natural language processing.
Background
The picture information can reflect the related content of the picture through the characters, most software packages are compiled by adopting C/C + + based on the view of the calculation speed, although the software packages provide great convenience for the research of computer image processing and computer vision, the software packages have the defects, most software packages do not have advanced mathematical calculation functions, and the operation speed is slow; most software packages do not support the development of application programs of a network server structure; most software packages do not support embeddability.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a picture construction method based on natural language processing, an OpenCV image processing algorithm library runs in a VC + + compiling environment, great convenience is provided for the processing of digital images and the application of computer vision technology, and the method not only is completely free open source software, but also contains abundant functions of various image processing and recognition.
In order to achieve the purpose, the invention is realized by the following technical scheme: a picture construction method based on natural language processing comprises the following steps:
step one; converting the needed pdf file into a picture through Smallpdf;
step two; performing expansion and corrosion operation on the picture by using OpenCV;
step three; performing character recognition;
step four; and matching the recognition results.
Further, the digital image converted by the PDF in the step one is operated, and the digital image is an image represented in a two-dimensional array form, and a digital unit of the image is a pixel.
Further, the basic elements of the digital image are pixels, and the pixels are obtained by discretizing a continuous space when the analog image is digitized.
Further, the operation in the step two includes: binary corrosion and expansion, binary switching operation, skeleton extraction, limit corrosion and hit-miss conversion.
Further, the fourth step is specifically to cross-filter the recognition result and the rule-based extraction result to obtain the text.
And further, extracting the longest common substring of the recognition result and the result extracted based on the rule, and simplifying the residual text extracted based on the rule.
Further, the third step is specifically calling an open-source Tesseract OCR API to perform character recognition.
Advantageous effects
The invention provides a picture construction method based on natural language processing. Has the following beneficial effects:
according to the picture construction method based on natural language processing, the picture is subjected to expansion and corrosion operations by using OpenCV, an OpenCV image processing algorithm library runs in a VC + + compiling environment, great convenience is provided for digital image processing and computer vision technology application, the picture construction method not only is completely free open-source software, but also contains abundant functions of various image processing and recognition, and the running speed and the accurate matching are improved.
Drawings
Fig. 1 is a flowchart of a picture construction method based on natural language processing.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, the present invention provides a technical solution: a picture construction method based on natural language processing comprises the following steps: step one; converting the needed pdf file into a picture through Smallpdf; performing operation on a digital image converted by PDF in the first step, wherein the digital image is an image represented in a two-dimensional array form, and a digital unit of the digital image is a pixel; the basic elements of the digital image are pixels, and the digital image is obtained by discretizing a continuous space when an analog image is digitized; step two; performing expansion and corrosion operation on the picture by using OpenCV; the operation in the second step comprises the following steps: binary corrosion and expansion, binary switching operation, skeleton extraction, limit corrosion and hit-miss conversion;
structural element for expansion and corrosion operation in the invention]Is the most important and basic concept. The role of the structural element in the morphological transformation is equivalent to the filtering window in the signal processing, denoted by b (x), and for each point x in the working space E, the definition of erosion and dilation is:
the result of expansion of E by B (x) is a set of points whose intersection of B and E is not empty, as a result of translation of B, and the result of erosion of E by B (x) is a set of all points whose intersection of B is contained in E, as a result of translation of B
The dilation operation convolves the image X with a structuring element B of arbitrary shape, typically square or circular.
When the expansion operation is carried out, the structural element B is drawn across the image X, the maximum pixel value of the coverage area of the structural element B is extracted, and the pixel of the anchor point position is replaced. Obviously, this maximization will cause the bright areas in the image to begin to expand.
And the minimum value of the pixel covered by the structural element is extracted by corrosion, and when the corrosion operation is carried out, the structural element B is drawn by an image X, the minimum pixel value of the area covered by the structural element B is extracted, and the pixel at the anchor point position is replaced.
Step three, the invention; performing character recognition, wherein the third step is specifically calling a Tesseract OCR API of an open source to perform character recognition; step four; and matching the recognition results, wherein the fourth step is specifically that the recognition results and the rule-based extraction results are subjected to cross filtering to obtain texts, the recognition results and the rule-based extraction results are subjected to longest common substring extraction, and part of residual texts extracted based on the rules are simplified.
The process of first corrosion and then expansion is called as open operation, the open operation has the functions of eliminating fine objects, separating the objects at fine positions and smoothing the boundaries of larger objects, the process of first expansion and then corrosion is called as closed operation, and the closed operation has the functions of filling fine cavities in the objects and connecting adjacent objects and smooth boundaries.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.
Claims (7)
1. A picture construction method based on natural language processing comprises the following steps:
step one; converting the needed pdf file into a picture through Smallpdf;
step two; performing expansion and corrosion operation on the picture by using OpenCV;
step three; performing character recognition;
step four; and matching the recognition results.
2. The picture construction method based on natural language processing according to claim 1, wherein: and operating the digital image converted by the PDF in the first step, wherein the digital image is an image represented in a two-dimensional array form, and a digital unit of the digital image is a pixel.
3. The picture construction method based on natural language processing according to claim 2, wherein: the basic elements of the digital image are pixels, and the digital image is obtained by discretizing a continuous space when an analog image is digitized.
4. The picture construction method based on natural language processing according to claim 1, wherein: the operation in the second step comprises the following steps: binary corrosion and expansion, binary switching operation, skeleton extraction, limit corrosion and hit-miss transformation.
5. The picture construction method based on natural language processing according to claim 1, wherein: and step four, specifically, the recognition result and the rule-based extraction result are subjected to cross filtering to obtain a text.
6. The picture construction method based on natural language processing according to claim 5, wherein: and extracting the longest common substring of the recognition result and the result extracted based on the rule, and simplifying the residual text extracted based on the rule.
7. The picture construction method based on natural language processing according to claim 1, wherein: and step three, specifically, calling an open-source Tesseract OCR API to perform character recognition.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011082580.5A CN112328825A (en) | 2020-10-15 | 2020-10-15 | Picture construction method based on natural language processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011082580.5A CN112328825A (en) | 2020-10-15 | 2020-10-15 | Picture construction method based on natural language processing |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112328825A true CN112328825A (en) | 2021-02-05 |
Family
ID=74314687
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011082580.5A Pending CN112328825A (en) | 2020-10-15 | 2020-10-15 | Picture construction method based on natural language processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112328825A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
IN2015CH01303A (en) * | 2015-03-16 | 2015-04-10 | Wipro Ltd | |
CN106203415A (en) * | 2016-06-30 | 2016-12-07 | 三峡大学 | A kind of bank based on Digital Image Processing card number automatic identification equipment |
CN110287784A (en) * | 2019-05-20 | 2019-09-27 | 暨南大学 | An annual report text structure recognition method |
CN110889401A (en) * | 2019-11-01 | 2020-03-17 | 暨南大学 | Text layout identification method based on opencv library |
-
2020
- 2020-10-15 CN CN202011082580.5A patent/CN112328825A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
IN2015CH01303A (en) * | 2015-03-16 | 2015-04-10 | Wipro Ltd | |
US9412052B1 (en) * | 2015-03-16 | 2016-08-09 | Wipro Limited | Methods and systems of text extraction from images |
CN106203415A (en) * | 2016-06-30 | 2016-12-07 | 三峡大学 | A kind of bank based on Digital Image Processing card number automatic identification equipment |
CN110287784A (en) * | 2019-05-20 | 2019-09-27 | 暨南大学 | An annual report text structure recognition method |
CN110889401A (en) * | 2019-11-01 | 2020-03-17 | 暨南大学 | Text layout identification method based on opencv library |
Non-Patent Citations (1)
Title |
---|
冯平、程涛: "PCB自动光学检测数字图像处理技术", vol. 2018, 西南交通大学出版社, pages: 113 - 121 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113657390B (en) | Training method of text detection model and text detection method, device and equipment | |
US11030420B2 (en) | Translating language characters in media content | |
Arai et al. | Method for real time text extraction of digital manga comic | |
JPH05500874A (en) | Polygon-based method for automatic extraction of selected text in digitized documents | |
Demilew et al. | Ancient Geez script recognition using deep learning | |
CN112989995B (en) | Text detection method and device and electronic equipment | |
Qu et al. | The algorithm of accelerated cracks detection and extracting skeleton by direction chain code in concrete surface image | |
Panchal et al. | An investigation on feature and text extraction from images using image recognition in Android | |
CN118015644B (en) | Social media keyword data analysis method and device based on pictures and characters | |
CN112328825A (en) | Picture construction method based on natural language processing | |
Gong et al. | Automatic segmentation of the fine structures of sunspots in high-resolution solar images | |
CN113468906B (en) | Graphic code extraction model construction method, identification device, equipment and medium | |
CN116030472A (en) | Text coordinate determining method and device | |
CN114399782A (en) | Text image processing method, device, equipment, storage medium and program product | |
CN111291758B (en) | Method and device for recognizing seal characters | |
Patience et al. | Enhanced Text Recognition in Images Using Tesseract OCR within the Laravel Framework | |
Tsang et al. | Image coding using neighbourhood relations | |
CN117423116B (en) | Training method of text detection model, text detection method and device | |
Hwang et al. | An Implementation of a System for Video Translation Using OCR | |
CN114005114B (en) | Identification method and device, segmentation model training method and device | |
Zorins et al. | Review of data preprocessing methods for sign language recognition systems based on artificial neural networks | |
Vuong et al. | Design and implementation of multilanguage name card reader on android platform | |
Wang et al. | Document image rectification method combined with semantic segmentation | |
Tadesse et al. | Amharic Handwritten Document Recognition using Deep Learning | |
Kassa et al. | An Adaptive Segmentation Technique For the Ancient Ethiopian Ge’ez Language Digital Manuscripts |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20210205 |
|
WD01 | Invention patent application deemed withdrawn after publication |