CN113011131A - Typesetting method based on picture electronic book, electronic equipment and storage medium - Google Patents

Typesetting method based on picture electronic book, electronic equipment and storage medium Download PDF

Info

Publication number
CN113011131A
CN113011131A CN202110301334.2A CN202110301334A CN113011131A CN 113011131 A CN113011131 A CN 113011131A CN 202110301334 A CN202110301334 A CN 202110301334A CN 113011131 A CN113011131 A CN 113011131A
Authority
CN
China
Prior art keywords
picture
area
frame
region
line
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.)
Granted
Application number
CN202110301334.2A
Other languages
Chinese (zh)
Other versions
CN113011131B (en
Inventor
张恒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ireader Technology Co Ltd
Original Assignee
Ireader Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ireader Technology Co Ltd filed Critical Ireader Technology Co Ltd
Priority to CN202110301334.2A priority Critical patent/CN113011131B/en
Publication of CN113011131A publication Critical patent/CN113011131A/en
Application granted granted Critical
Publication of CN113011131B publication Critical patent/CN113011131B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Analysis (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a typesetting method based on a photo e-book, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring a plurality of picture elements obtained by analyzing an original page of an electronic book and position information of each picture element in the original page, and merging a plurality of picture elements adjacent in position into a picture group; determining a circumscribed rectangular region corresponding to the picture group and a region frame line thereof, and determining each picture element contained in the picture group and arranged along the region frame line as a frame picture element corresponding to the region frame line; judging whether the picture grouping meets a frame checking condition or not according to the obtained length accumulation of each frame picture element along the direction of the region frame line and a comparison result between the length accumulation and the length of the region frame line; if yes, executing screenshot processing aiming at the picture grouping, and typesetting the page according to the screenshot picture. The method can avoid the problem that a plurality of picture elements in the same picture are split in the typesetting process.

Description

Typesetting method based on picture electronic book, electronic equipment and storage medium
Technical Field
The invention relates to the field of computers, in particular to a typesetting method based on a photo-like electronic book, electronic equipment and a storage medium.
Background
In the electronic book typesetting process, the electronic book manuscript in format typesetting needs to be identified, and typesetting with a custom effect is realized through a streaming typesetting mode according to the identification result. Among them, electronic book documents are usually in an uneditable format such as PDF. In the process of identifying the electronic book manuscript, various page elements in the manuscript can be automatically identified, and the page elements specifically comprise various types such as character elements and picture elements. And then, automatically converting the file into a streaming document according to the recognition result to realize custom typesetting.
However, in the process of implementing the present invention, the inventor finds that the above solution in the prior art has at least the following defects: in order to enrich the display effect of pictures, pictures in electronic books are not generally composed of a single picture element, but are combined by a plurality of picture elements. Accordingly, if the typesetting is directly performed according to each page element obtained by the analysis, the positional relationship among a plurality of picture elements for forming the same picture is changed, so that the composition mode of the picture itself is damaged, and the finally obtained typesetting content is inconsistent with the original content of the electronic book.
Disclosure of Invention
In view of the above problems, the present invention has been made to provide a method, an electronic device, and a storage medium for composing a photo-based e-book that overcome or at least partially solve the above problems.
According to one aspect of the present invention, there is provided a method for composing a photo-based e-book, the method comprising:
acquiring a plurality of picture elements obtained by analyzing an original page of an electronic book and position information of each picture element in the original page, and merging a plurality of picture elements adjacent in position into a picture group;
determining a circumscribed rectangular region corresponding to the picture grouping and a region frame line of the circumscribed rectangular region, and determining each picture element arranged along the region frame line included in the picture grouping as a frame picture element corresponding to the region frame line;
judging whether the picture grouping meets a frame checking condition or not according to the obtained length accumulation of each frame picture element along the direction of the region frame line and a comparison result between the length accumulation of each frame picture element and the length of the region frame line;
if yes, executing screenshot processing aiming at the picture group to obtain screenshot pictures corresponding to the picture group, and generating a typesetting page corresponding to the original page according to the screenshot pictures.
According to another aspect of the present invention, there is provided an electronic apparatus including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to:
acquiring a plurality of picture elements obtained by analyzing an original page of an electronic book and position information of each picture element in the original page, and merging a plurality of picture elements adjacent in position into a picture group;
determining a circumscribed rectangular region corresponding to the picture grouping and a region frame line of the circumscribed rectangular region, and determining each picture element arranged along the region frame line included in the picture grouping as a frame picture element corresponding to the region frame line;
judging whether the picture grouping meets a frame checking condition or not according to the obtained length accumulation of each frame picture element along the direction of the region frame line and a comparison result between the length accumulation of each frame picture element and the length of the region frame line;
if yes, executing screenshot processing aiming at the picture group to obtain screenshot pictures corresponding to the picture group, and generating a typesetting page corresponding to the original page according to the screenshot pictures.
According to yet another aspect of the present invention, there is provided a computer storage medium having at least one executable instruction stored therein, the executable instruction causing the processor to:
acquiring a plurality of picture elements obtained by analyzing an original page of an electronic book and position information of each picture element in the original page, and merging a plurality of picture elements adjacent in position into a picture group;
determining a circumscribed rectangular region corresponding to the picture grouping and a region frame line of the circumscribed rectangular region, and determining each picture element arranged along the region frame line included in the picture grouping as a frame picture element corresponding to the region frame line;
judging whether the picture grouping meets a frame checking condition or not according to the obtained length accumulation of each frame picture element along the direction of the region frame line and a comparison result between the length accumulation of each frame picture element and the length of the region frame line;
if yes, executing screenshot processing aiming at the picture group to obtain screenshot pictures corresponding to the picture group, and generating a typesetting page corresponding to the original page according to the screenshot pictures.
In the typesetting method, the electronic equipment and the storage medium based on the picture-type electronic book provided by the invention, a plurality of picture elements adjacent in position are combined into a picture group, an external rectangular region corresponding to the picture group and a region frame line thereof are determined, whether the picture group meets a frame verification condition is judged according to the length accumulation of the frame picture elements along the direction of the region frame line and the comparison result between the length accumulation of the frame picture elements and the length of the region frame line, if yes, screenshot processing is executed aiming at the picture group, and a typesetting page corresponding to an original page is generated according to the screenshot picture. Therefore, the method can automatically divide a plurality of picture elements with close intervals into a picture group, judge whether each picture element effectively fills the whole picture area according to the length verification result along the direction of the frame line of the area, verify whether each picture element in the picture group belongs to one picture according to the judgment result, and execute screenshot processing on each picture element in the picture group when the verification result is yes, so that the composition mode of the original picture is reserved, and the problem that the plurality of picture elements in the same picture are cut in the typesetting process is avoided.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flowchart illustrating a method for composing a photo-based electronic book according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for composing a photo-based electronic book according to another embodiment of the present invention;
fig. 3 shows a schematic structural diagram of an electronic device according to another embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Example one
Fig. 1 is a flowchart illustrating a method for typesetting based on a photo-like electronic book according to an embodiment of the present invention. As shown in fig. 1, the method comprises the steps of:
step S110: the method comprises the steps of obtaining a plurality of picture elements obtained after analyzing an original page of the electronic book and position information of each picture element in the original page, and combining a plurality of picture elements adjacent in position into a picture group.
The electronic book in this embodiment is a photo-like electronic book. The photo e-book refers to an e-book containing a plurality of pictures in the book content, and may be a cartoon e-book or a text e-book containing a plurality of illustrations, which is not limited in the present invention.
Specifically, after analyzing an original page of the electronic book, various page elements included in the page can be obtained, which specifically includes: text elements, picture elements, table elements, and the like. And the position information of various page elements in the original page can be obtained. Correspondingly, each picture element in the original page is extracted, and the position information of each picture element in the original page is determined, so that a plurality of picture elements adjacent in position are combined into a picture group. When the positions are judged to be adjacent, an interval threshold value can be set, and when the interval between two picture elements is smaller than the interval threshold value, the positions of the two picture elements are determined to be adjacent and should be combined into the same picture group.
Step S120: and determining a circumscribed rectangular region corresponding to the picture group and a region frame line of the circumscribed rectangular region, and determining each picture element contained in the picture group and arranged along the region frame line as a frame picture element corresponding to the region frame line.
The circumscribed rectangle region corresponding to the picture group is usually the region corresponding to the smallest circumscribed rectangle of the picture group. Accordingly, the region outline circumscribing the rectangular region refers to the side of the smallest circumscribed rectangle. Specifically, when determining a frame picture element, for at least one region frame line, a plurality of picture elements arranged along the region frame line are determined as frame picture elements corresponding to the region frame line. Wherein, arrange along this regional frame line and indicate: a picture border line of the picture element substantially coincides with the area border line.
Step S130: and judging whether the picture grouping meets the frame checking condition or not according to the obtained length accumulation of each frame picture element along the direction of the region frame line and the comparison result between the length accumulation of each frame picture element and the length of the region frame line.
Because one picture frame line of each frame picture element is approximately superposed with the corresponding area frame line, the sum of the lengths of each frame picture element along the area frame line direction is the sum of the lengths of the picture frame lines of each frame picture element approximately superposed with the area frame line. The length accumulation sum is compared with the length of the area frame line, and in the specific comparison, the length accumulation sum can be realized by a difference comparison method, a ratio comparison method and other various methods. When the difference value between the two is smaller or the ratio value is close to 1, the picture group is in accordance with the frame check condition in the direction of the frame line of the area.
In specific implementation, whether the frame check condition is met or not can be judged for at least one area frame line, and whether the frame check condition is met or not can be judged for four area frame lines at the same time.
Step S140: if so, executing screenshot processing aiming at the picture grouping to obtain screenshot pictures corresponding to the picture grouping, and generating a typesetting page corresponding to the original page according to the screenshot pictures.
When the frame check condition is met, the picture elements in the picture group belong to the same picture, so that the screenshot processing is executed aiming at the picture group in order to prevent the problem of composition disorder caused by the disordered sequence of the picture elements in the typesetting process, and the position relation of the picture elements contained in the screenshot picture is ensured to be the same as that of the original page.
Therefore, the method can automatically divide a plurality of picture elements with close intervals into a picture group, judge whether each picture element effectively fills the whole picture area according to the length verification result along the direction of the frame line of the area, verify whether each picture element in the picture group belongs to one picture according to the judgment result, and execute screenshot processing on each picture element in the picture group when the verification result is yes, so that the composition mode of the original picture is reserved, and the problem that the plurality of picture elements in the same picture are cut in the typesetting process is avoided.
Example two
Fig. 2 is a flowchart illustrating a method for typesetting based on a photo-like electronic book according to another embodiment of the present invention. As shown in fig. 2, the method comprises the steps of:
step S210: the method comprises the steps of obtaining a plurality of picture elements obtained after analyzing an original page of the electronic book and position information of each picture element in the original page, and combining a plurality of picture elements adjacent in position into a picture group.
The electronic book in this embodiment is a photo-like electronic book. The photo e-book refers to an e-book containing a plurality of pictures in the book content, and may be a cartoon e-book or a text e-book containing a plurality of illustrations, which is not limited in the present invention. Specifically, after analyzing an original page of the electronic book, various page elements included in the page can be obtained, which specifically includes: text elements, picture elements, table elements, and the like. And the position information of various page elements in the original page can be obtained. Correspondingly, each picture element in the original page is extracted, and the position information of each picture element in the original page is determined, so that a plurality of picture elements adjacent in position are combined into a picture group.
In specific implementation, whether the interval between two adjacent picture elements is smaller than a preset interval threshold value is judged, and if yes, the two adjacent picture elements are combined into one picture group. The interval between two picture elements mainly refers to the interval between picture frame lines of the picture elements. The extent to which a picture element is located is determined by the picture border line (i.e., the picture outline). If the picture frame lines of the two picture elements are overlapped, it is indicated that the interval between the two picture elements is smaller than the preset interval threshold.
It can be seen that this step mainly performs merging processing based on the position intervals between the respective picture elements. Since a plurality of picture elements in the same picture are often closely spaced, a plurality of picture elements that may belong to the same picture can be roughly combined into the same group according to the position interval.
Step S220: and determining a circumscribed rectangular region corresponding to the picture group and a region frame line of the circumscribed rectangular region, and determining each picture element contained in the picture group and arranged along the region frame line as a frame picture element corresponding to the region frame line.
Specifically, drawing a minimum circumscribed rectangle corresponding to the picture group to obtain a circumscribed rectangle region corresponding to the picture group; at least one of the four sides of the minimum bounding rectangle is determined as a region bounding line bounding the rectangular region. The image group comprises a plurality of image elements which jointly form an image area, and no matter what shape the image area belongs to, the minimum external rectangle corresponding to the image area can be drawn, so that the area where the minimum external rectangle is located is used as the external rectangle area corresponding to the image group. In addition, since the minimum bounding rectangle has four sides, the side in the minimum bounding rectangle is determined as the region frame line of the bounding rectangle region. It can be seen that the number of the area frame lines circumscribing the rectangular area is also four.
In addition, in order to check whether each picture element in the picture group belongs to one picture along the region frame line direction, it is necessary to determine the frame picture element corresponding to the region frame line. Specifically, each picture element included in the picture group and arranged along the area frame line is determined, so that each picture element arranged along the area frame line is used as a frame picture element corresponding to the area frame line. Wherein, arrange along this regional frame line and indicate: a picture border line of the picture element substantially coincides with the area border line. Correspondingly, when each picture element arranged along the area frame line included in the picture group is determined as a frame picture element corresponding to the area frame line, for each area frame line, the picture element matching the picture frame line with the area frame line is determined as the frame picture element corresponding to the area frame line. For example, for the left region frame line, it is determined whether the interval between the left picture frame line and the left region frame line of each picture element is smaller than a preset value, and if so, it is determined that the left picture frame line of the picture element matches the left region frame line.
Step S230: and judging whether the picture grouping meets the frame checking condition or not according to the obtained length accumulation of each frame picture element along the direction of the region frame line and the comparison result between the length accumulation of each frame picture element and the length of the region frame line.
Because one picture frame line of each frame picture element is approximately superposed with the corresponding area frame line, the sum of the lengths of each frame picture element along the area frame line direction is the sum of the lengths of the picture frame lines approximately superposed with the area frame line in each frame picture element.
For example, also taking the region frame line as the left region frame line as an example, suppose that there are three picture elements, picture element 1, picture element 2 and picture element 3, then the length L1 of the left picture frame line of picture element 1, the length L2 of the left picture frame line of picture element 2, and the length L3 of the left picture frame line of picture element 3 are obtained, respectively, and accordingly, the sum of the lengths of the respective border picture elements in the left region frame line direction is L1+ L2+ L3, assuming that the length of the left region frame line is s, comparing L with s, and if the difference between L and s is smaller than a preset frame difference threshold (or the ratio is larger than a preset frame ratio threshold), indicating that each frame picture element basically fills the whole area frame line along the left direction. The other directions of the area border lines, such as the right border line, the upper border line and the lower border line, are verified in the same way. In summary, the border check condition is intended to determine whether a border line of a certain area is filled with border picture elements in the direction of the border line. If there are obviously a lot of blank areas in the direction of the border line of a certain area and the border picture element is not filled, it indicates that there may be a blank or other interference of non-picture elements in the direction, that is: the area range of the picture grouping needs to be adjusted. Therefore, when the length accumulation sum is compared with the length of the area frame line, the length accumulation sum can be realized by a difference comparison method, a ratio comparison method and other various methods. When the difference value between the two is smaller or the ratio value is close to 1, the picture group is in accordance with the frame check condition in the direction of the frame line of the area.
During specific implementation, respectively aiming at each area frame line, calculating the length accumulation sum of the frame picture elements corresponding to the area frame line along the direction of the area frame line, and comparing the difference value between the length accumulation sum and the length of the area frame line with a preset difference threshold value to obtain a comparison result corresponding to the area frame line; and judging whether the picture groups meet the frame checking condition or not according to the comparison result corresponding to the at least one regional frame line. For example, a person skilled in the art can flexibly set the frame check condition of the picture grouping: in one implementation, when the difference values of the comparison results corresponding to the four area frame lines are all smaller than a preset frame difference value threshold (or the ratio is larger than a preset frame ratio threshold), determining that the whole picture group meets a frame check condition; in another implementation manner, as long as the difference of the comparison results corresponding to at least one of the area frame lines is smaller than the preset frame difference threshold (or the ratio is greater than the preset frame ratio threshold), it is determined that the entire picture group meets the frame check condition, and certainly, when the difference of the comparison results corresponding to the remaining area frame lines is not smaller than the preset frame difference threshold (or the ratio is not greater than the preset frame ratio threshold), the determination may be further performed in combination with other auxiliary check conditions.
Step S240: and when the picture group is judged to accord with the frame checking condition, further judging whether the picture group accords with the auxiliary checking condition.
Step S240 is an optional step for enhancing the verification, and may be omitted in other embodiments of the present invention.
Specifically, the frame check condition can ensure that each frame picture element arranged along the region frame line is fully distributed on the whole region frame line, thereby avoiding leaving white in the edge region. However, in the implementation of the present invention, the inventor has found that even if the picture elements of the respective borders arranged along the area border line are distributed over the whole area border line, there may be some special cases that may cause the area range of the picture grouping to be unreasonable. In order to avoid the special situation, auxiliary judgment is carried out through auxiliary verification conditions. The auxiliary verification condition can perform multi-dimensional verification from an area dimension and a text dimension, and the invention does not limit the specific form of the auxiliary verification.
In an alternative implementation, the auxiliary verify condition is an area-based verify condition. Correspondingly, after the picture grouping is judged to accord with the frame checking condition according to the comparison result corresponding to the at least one region frame line, whether the comparison result between the area accumulation sum of each picture element in the picture grouping and the total area of the region of the circumscribed rectangular region accords with the area checking condition is further judged; when the area verification condition is satisfied, the subsequent step S250 is performed. In this implementation manner, when the comparison results corresponding to the four area frame lines all conform to the frame check condition, it is described that the picture group has no blank area in the directions of the four area frame lines, that is: each border picture element can closely fill each area border line. At this time, in order to prevent the interference content such as characters in the middle area of the picture group, it is further determined whether the area check condition is satisfied. Specifically, the area of each picture element in the picture group is respectively obtained, the area of each picture element in the picture group is accumulated and summed to obtain the area accumulation sum of each picture element in the picture group, and if the difference between the area accumulation sum of each picture element in the picture group and the total area of the region of the external rectangular region is smaller than a preset area difference threshold (or the ratio between the area accumulation sum of each picture element in the picture group and the total area of the region of the external rectangular region is larger than a preset area ratio threshold), it is indicated that each picture element can be basically distributed in the whole picture group region, that is: interference contents such as whitespace or texts do not exist in the middle of the picture groups, so that the picture groups accord with area check conditions. In addition, when the picture groups do not accord with the area check condition, whether the inside of the circumscribed rectangular region contains a non-picture region can be further judged; if yes, after the non-picture region is removed, the following step S250 is executed. The non-picture region mainly refers to an interference region such as a text region. In general, when the frame check condition of a picture packet is set to the first implementation mentioned above, that is: when the difference values of the comparison results corresponding to the four area frame lines are all smaller than a preset frame difference value threshold (or the ratio value is larger than a preset frame ratio value threshold), the whole picture group is determined to accord with the frame verification condition, and auxiliary verification is further carried out by combining the area verification condition.
In yet another alternative implementation, the auxiliary verification condition is a text-based verification condition. Correspondingly, after the picture group is judged to accord with the frame checking condition according to the comparison result corresponding to at least one region frame line, whether the inside of the circumscribed rectangular region contains the text region is further judged; when the text region is not contained inside the circumscribed rectangular region, the subsequent step S250 is performed. In this implementation manner, when the comparison result corresponding to at least one region frame line meets the frame check condition and the comparison results corresponding to the remaining region frame lines do not meet the frame check condition, the operation of determining whether the text region is included in the circumscribed rectangular region may be further performed. For example, pictures of a chart class (e.g., a histogram, etc.) are aligned in at least one direction. Therefore, each picture element in the chart type picture can be at least covered by one area frame line. At this time, as long as the text region is not contained inside the picture group, it can be determined that each picture element in the picture group belongs to one picture. In addition, when the text region is contained inside the circumscribed rectangular region, the subsequent step S250 may be further performed after the text region is eliminated. Specifically, when the text area is removed, the text elements located in the circumscribed rectangular area can be automatically identified according to the type and position of each page element, so that the identified text elements are removed. Alternatively, the text area may be eliminated according to a received text box selection instruction triggered by a user, and the specific details are not limited in the present invention. In general, when the frame check condition of the picture packet is set to the second implementation manner mentioned above, that is: and if the difference value of the comparison results corresponding to at least one area frame line is smaller than a preset frame difference value threshold (or the ratio value is larger than a preset frame ratio value threshold), performing auxiliary verification by further combining the text verification condition when the whole picture group is determined to accord with the frame verification condition.
Of course, the invention does not limit the combination mode among the area verification condition, the text verification condition and various frame verification conditions, and the skilled person can make various flexible combinations.
Step S250: and when the auxiliary verification condition is met, executing screenshot processing on the picture groups to obtain screenshot pictures corresponding to the picture groups, and generating a typesetting page corresponding to the original page according to the screenshot pictures.
When the picture groups simultaneously meet the frame verification condition and the auxiliary verification condition, the picture elements in the picture groups belong to the same picture, so that the screenshot processing is executed aiming at the picture groups to prevent the problem of disordered composition caused by disordered sequence of the picture elements in the typesetting process, and the position relation of the picture elements contained in the screenshot picture is ensured to be the same as that of an original page.
Specifically, screenshot processing is executed for a picture area where the whole picture group is located, so that a content screenshot corresponding to the whole picture area is a screenshot picture which is taken as a complete picture element, and typesetting processing is performed according to the complete picture element and other page elements contained in the original page content, so that a typesetting page corresponding to the original page is obtained. The screenshot picture completely reserves all elements for forming the picture in a picture form, so that the problem that the composition mode is disturbed is avoided.
In this embodiment, the original page is a layout page, and the layout page is a streaming page. For example, the original page is a non-editable PDF page, and the layout page obtained after layout processing is a page that is convenient to edit, such as an EPUB document or a WORD document.
In summary, the method can automatically divide a plurality of picture elements with close intervals into a picture group, and judge whether each picture element effectively fills the whole picture region according to the length verification result along the direction of the frame line of the region, so as to verify whether each picture element in the picture group belongs to one picture according to the judgment result, and execute screenshot processing on each picture element in the picture group when the verification result is yes, thereby retaining the composition mode of the original picture and avoiding the problem that a plurality of picture elements in the same picture are split in the typesetting process. In a word, the method can reserve the composition mode of the picture, so that the finally obtained typesetting content is consistent with the original content of the electronic book, and the typesetting efficiency and accuracy are further improved. In addition, the method can accurately identify the range of the picture area, and remove page elements (such as text elements) which do not belong to the picture, thereby ensuring the accuracy of the picture obtained by the final screenshot.
EXAMPLE III
The embodiment of the application provides a non-volatile computer storage medium, wherein at least one executable instruction is stored in the computer storage medium, and the computer executable instruction can execute the typesetting method based on the picture electronic book in any method embodiment.
The executable instructions may be specifically configured to cause the processor to:
acquiring a plurality of picture elements obtained by analyzing an original page of an electronic book and position information of each picture element in the original page, and merging a plurality of picture elements adjacent in position into a picture group;
determining a circumscribed rectangular region corresponding to the picture grouping and a region frame line of the circumscribed rectangular region, and determining each picture element arranged along the region frame line included in the picture grouping as a frame picture element corresponding to the region frame line;
judging whether the picture grouping meets a frame checking condition or not according to the obtained length accumulation of each frame picture element along the direction of the region frame line and a comparison result between the length accumulation of each frame picture element and the length of the region frame line;
if yes, executing screenshot processing aiming at the picture group to obtain screenshot pictures corresponding to the picture group, and generating a typesetting page corresponding to the original page according to the screenshot pictures.
In an alternative implementation, the executable instructions cause the processor to:
drawing a minimum circumscribed rectangle corresponding to the picture group to obtain a circumscribed rectangle area corresponding to the picture group;
and determining at least one of the four sides of the minimum circumscribed rectangle as a region frame line of the circumscribed rectangle region.
In an alternative implementation, the executable instructions cause the processor to: respectively aiming at each area frame line, determining picture elements which are matched with the picture frame line and the area frame line as frame picture elements corresponding to the area frame line;
respectively aiming at each region frame line, calculating the length accumulation sum of the frame picture elements corresponding to the region frame line along the direction of the region frame line, and comparing the difference value between the length accumulation sum and the length of the region frame line with a preset difference value threshold value to obtain a comparison result corresponding to the region frame line;
and judging whether the picture group meets the frame checking condition or not according to the comparison result corresponding to at least one regional frame line.
In an alternative implementation manner, after determining that the picture packet meets the frame check condition according to the comparison result corresponding to at least one region frame line, the executable instructions further cause the processor to perform the following operations: judging whether the comparison result between the area accumulation sum of each picture element in the picture group and the total area of the circumscribed rectangular region meets the area check condition or not;
and when the area check condition is met, executing the step of executing screenshot processing aiming at the picture group.
In an optional implementation manner, the determining that the picture group meets the frame check condition according to the comparison result corresponding to the at least one region frame line includes: the comparison results corresponding to the four area frame lines all accord with frame checking conditions;
and when the area check condition is not met, the executable instructions further cause the processor to: judging whether the inside of the circumscribed rectangular region contains a non-picture region or not; if yes, after the non-picture area is removed, executing the step of executing screenshot processing aiming at the picture grouping.
In an alternative implementation manner, after determining that the picture packet meets the frame check condition according to the comparison result corresponding to at least one region frame line, the executable instructions further cause the processor to perform the following operations: :
judging whether the inside of the circumscribed rectangular region contains a text region;
when the inside of the circumscribed rectangular region does not contain a text region, the step of executing screenshot processing for the picture grouping is executed.
In an optional implementation manner, the determining that the picture group meets the frame check condition according to the comparison result corresponding to the at least one region frame line includes: the comparison result corresponding to at least one area frame line meets the frame check condition, and the comparison result corresponding to the rest area frame lines does not meet the frame check condition;
and when the circumscribed rectangular region contains a text region inside, the executable instructions further cause the processor to: and after the text area is eliminated, executing the step of executing screenshot processing aiming at the picture grouping.
In an alternative implementation, the executable instructions cause the processor to:
and judging whether the interval between two adjacent picture elements is smaller than a preset interval threshold value or not, and if so, combining the two adjacent picture elements into a picture group.
In an optional implementation manner, the original page is a layout page, and the layout page is a streaming page.
Example four
Fig. 3 is a schematic structural diagram of an electronic device according to another embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the electronic device.
As shown in fig. 3, the electronic device may include: a processor (processor)302, a communication Interface 304, a memory 306, and a communication bus 308.
Wherein: the processor 302, communication interface 304, and memory 306 communicate with each other via a communication bus 308. A communication interface 304 for communicating with network elements of other devices, such as clients or other servers. The processor 302 is configured to execute the program 310, and may specifically execute relevant steps in the above embodiment of the typesetting method based on the photo-like e-book.
In particular, program 310 may include program code comprising computer operating instructions.
The processor 302 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the present invention. The electronic device comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 306 for storing a program 310. Memory 306 may comprise high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 310 may specifically be configured to cause the processor 302 to perform the following operations:
acquiring a plurality of picture elements obtained by analyzing an original page of an electronic book and position information of each picture element in the original page, and merging a plurality of picture elements adjacent in position into a picture group;
determining a circumscribed rectangular region corresponding to the picture grouping and a region frame line of the circumscribed rectangular region, and determining each picture element arranged along the region frame line included in the picture grouping as a frame picture element corresponding to the region frame line;
judging whether the picture grouping meets a frame checking condition or not according to the obtained length accumulation of each frame picture element along the direction of the region frame line and a comparison result between the length accumulation of each frame picture element and the length of the region frame line;
if yes, executing screenshot processing aiming at the picture group to obtain screenshot pictures corresponding to the picture group, and generating a typesetting page corresponding to the original page according to the screenshot pictures.
In an alternative implementation, the executable instructions cause the processor to:
drawing a minimum circumscribed rectangle corresponding to the picture group to obtain a circumscribed rectangle area corresponding to the picture group;
and determining at least one of the four sides of the minimum circumscribed rectangle as a region frame line of the circumscribed rectangle region.
In an alternative implementation, the executable instructions cause the processor to: respectively aiming at each area frame line, determining picture elements which are matched with the picture frame line and the area frame line as frame picture elements corresponding to the area frame line;
respectively aiming at each region frame line, calculating the length accumulation sum of the frame picture elements corresponding to the region frame line along the direction of the region frame line, and comparing the difference value between the length accumulation sum and the length of the region frame line with a preset difference value threshold value to obtain a comparison result corresponding to the region frame line;
and judging whether the picture group meets the frame checking condition or not according to the comparison result corresponding to at least one regional frame line.
In an alternative implementation manner, after determining that the picture packet meets the frame check condition according to the comparison result corresponding to at least one region frame line, the executable instructions further cause the processor to perform the following operations: judging whether the comparison result between the area accumulation sum of each picture element in the picture group and the total area of the circumscribed rectangular region meets the area check condition or not;
and when the area check condition is met, executing the step of executing screenshot processing aiming at the picture group.
In an optional implementation manner, the determining that the picture group meets the frame check condition according to the comparison result corresponding to the at least one region frame line includes: the comparison results corresponding to the four area frame lines all accord with frame checking conditions;
and when the area check condition is not met, the executable instructions further cause the processor to: judging whether the inside of the circumscribed rectangular region contains a non-picture region or not; if yes, after the non-picture area is removed, executing the step of executing screenshot processing aiming at the picture grouping.
In an alternative implementation manner, after determining that the picture packet meets the frame check condition according to the comparison result corresponding to at least one region frame line, the executable instructions further cause the processor to perform the following operations: :
judging whether the inside of the circumscribed rectangular region contains a text region;
when the inside of the circumscribed rectangular region does not contain a text region, the step of executing screenshot processing for the picture grouping is executed.
In an optional implementation manner, the determining that the picture group meets the frame check condition according to the comparison result corresponding to the at least one region frame line includes: the comparison result corresponding to at least one area frame line meets the frame check condition, and the comparison result corresponding to the rest area frame lines does not meet the frame check condition;
and when the circumscribed rectangular region contains a text region inside, the executable instructions further cause the processor to: and after the text area is eliminated, executing the step of executing screenshot processing aiming at the picture grouping.
In an alternative implementation, the executable instructions cause the processor to:
and judging whether the interval between two adjacent picture elements is smaller than a preset interval threshold value or not, and if so, combining the two adjacent picture elements into a picture group.
In an optional implementation manner, the original page is a layout page, and the layout page is a streaming page.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention also discloses A1. a typesetting method based on the photo e-book, wherein the method comprises the following steps:
acquiring a plurality of picture elements obtained by analyzing an original page of an electronic book and position information of each picture element in the original page, and merging a plurality of picture elements adjacent in position into a picture group;
determining a circumscribed rectangular region corresponding to the picture grouping and a region frame line of the circumscribed rectangular region, and determining each picture element arranged along the region frame line included in the picture grouping as a frame picture element corresponding to the region frame line;
judging whether the picture grouping meets a frame checking condition or not according to the obtained length accumulation of each frame picture element along the direction of the region frame line and a comparison result between the length accumulation of each frame picture element and the length of the region frame line;
if yes, executing screenshot processing aiming at the picture group to obtain screenshot pictures corresponding to the picture group, and generating a typesetting page corresponding to the original page according to the screenshot pictures.
A2. The method of a1, wherein the determining a circumscribed rectangular region corresponding to the picture grouping and a region outline of the circumscribed rectangular region comprises:
drawing a minimum circumscribed rectangle corresponding to the picture group to obtain a circumscribed rectangle area corresponding to the picture group;
and determining at least one of the four sides of the minimum circumscribed rectangle as a region frame line of the circumscribed rectangle region.
A3. The method according to a1 or 2, wherein the determining, as the picture element of the border corresponding to the region border, each picture element included in the picture grouping and arranged along the region border comprises: respectively aiming at each area frame line, determining picture elements which are matched with the picture frame line and the area frame line as frame picture elements corresponding to the area frame line;
the judging whether the picture grouping meets the frame checking condition according to the obtained length accumulation of each frame picture element along the direction of the area frame line and the comparison result between the obtained length accumulation of each frame picture element and the length of the area frame line includes:
respectively aiming at each region frame line, calculating the length accumulation sum of the frame picture elements corresponding to the region frame line along the direction of the region frame line, and comparing the difference value between the length accumulation sum and the length of the region frame line with a preset difference value threshold value to obtain a comparison result corresponding to the region frame line;
and judging whether the picture group meets the frame checking condition or not according to the comparison result corresponding to at least one regional frame line.
A4. The method according to a3, wherein, after determining that the picture grouping meets the frame check condition according to the comparison result corresponding to at least one regional frame line, the method further comprises:
judging whether the comparison result between the area accumulation sum of each picture element in the picture group and the total area of the circumscribed rectangular region meets the area check condition or not;
and when the area check condition is met, executing the step of executing screenshot processing aiming at the picture group.
A5. The method according to a4, wherein the determining that the picture grouping meets the frame check condition according to the comparison result corresponding to at least one regional frame line includes: the comparison results corresponding to the four area frame lines all accord with frame checking conditions;
when the area check condition is not met, judging whether the inside of the circumscribed rectangular region contains a non-picture region; if yes, after the non-picture area is removed, executing the step of executing screenshot processing aiming at the picture grouping.
A6. The method according to a3, wherein, after determining that the picture grouping meets the frame check condition according to the comparison result corresponding to at least one regional frame line, the method further comprises:
judging whether the inside of the circumscribed rectangular region contains a text region;
when the inside of the circumscribed rectangular region does not contain a text region, the step of executing screenshot processing for the picture grouping is executed.
A7. The method according to a6, wherein the determining that the picture grouping meets the frame check condition according to the comparison result corresponding to at least one regional frame line includes: the comparison result corresponding to at least one area frame line meets the frame check condition, and the comparison result corresponding to the rest area frame lines does not meet the frame check condition;
and when the text area is contained in the circumscribed rectangular area, executing the step of executing screenshot processing on the picture grouping after the text area is removed.
A8. The method according to any one of a1-7, wherein the merging picture elements that are adjacent in position into a picture group includes:
and judging whether the interval between two adjacent picture elements is smaller than a preset interval threshold value or not, and if so, combining the two adjacent picture elements into a picture group.
A9. The method according to any one of A1-8, wherein the original page is a layout page, and the layout page is a streaming page.
B10. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to:
acquiring a plurality of picture elements obtained by analyzing an original page of an electronic book and position information of each picture element in the original page, and merging a plurality of picture elements adjacent in position into a picture group;
determining a circumscribed rectangular region corresponding to the picture grouping and a region frame line of the circumscribed rectangular region, and determining each picture element arranged along the region frame line included in the picture grouping as a frame picture element corresponding to the region frame line;
judging whether the picture grouping meets a frame checking condition or not according to the obtained length accumulation of each frame picture element along the direction of the region frame line and a comparison result between the length accumulation of each frame picture element and the length of the region frame line;
if yes, executing screenshot processing aiming at the picture group to obtain screenshot pictures corresponding to the picture group, and generating a typesetting page corresponding to the original page according to the screenshot pictures.
B11. The electronic device of B10, wherein the executable instructions cause the processor to:
drawing a minimum circumscribed rectangle corresponding to the picture group to obtain a circumscribed rectangle area corresponding to the picture group;
and determining at least one of the four sides of the minimum circumscribed rectangle as a region frame line of the circumscribed rectangle region.
B12. The electronic device of B10 or 11, wherein the executable instructions cause the processor to: respectively aiming at each area frame line, determining picture elements which are matched with the picture frame line and the area frame line as frame picture elements corresponding to the area frame line;
respectively aiming at each region frame line, calculating the length accumulation sum of the frame picture elements corresponding to the region frame line along the direction of the region frame line, and comparing the difference value between the length accumulation sum and the length of the region frame line with a preset difference value threshold value to obtain a comparison result corresponding to the region frame line;
and judging whether the picture group meets the frame checking condition or not according to the comparison result corresponding to at least one regional frame line.
B13. The electronic device of B12, wherein the executable instructions further cause the processor to, after determining that the picture grouping meets a bezel checking condition based on the comparison corresponding to at least one region bezel line: judging whether the comparison result between the area accumulation sum of each picture element in the picture group and the total area of the circumscribed rectangular region meets the area check condition or not;
and when the area check condition is met, executing the step of executing screenshot processing aiming at the picture group.
B14. The electronic device according to B13, wherein the determining that the picture grouping meets the border checking condition according to the comparison result corresponding to the at least one area border line includes: the comparison results corresponding to the four area frame lines all accord with frame checking conditions;
and when the area check condition is not met, the executable instructions further cause the processor to: judging whether the inside of the circumscribed rectangular region contains a non-picture region or not; if yes, after the non-picture area is removed, executing the step of executing screenshot processing aiming at the picture grouping.
B15. The electronic device of B12, wherein the executable instructions further cause the processor to, after determining that the picture grouping meets a bezel checking condition based on the comparison corresponding to at least one region bezel line: :
judging whether the inside of the circumscribed rectangular region contains a text region;
when the inside of the circumscribed rectangular region does not contain a text region, the step of executing screenshot processing for the picture grouping is executed.
B16. The electronic device according to B15, wherein the determining that the picture grouping meets the border checking condition according to the comparison result corresponding to the at least one area border line includes: the comparison result corresponding to at least one area frame line meets the frame check condition, and the comparison result corresponding to the rest area frame lines does not meet the frame check condition;
and when the circumscribed rectangular region contains a text region inside, the executable instructions further cause the processor to: and after the text area is eliminated, executing the step of executing screenshot processing aiming at the picture grouping.
B17. The electronic device of any of B10-16, wherein the executable instructions cause the processor to:
and judging whether the interval between two adjacent picture elements is smaller than a preset interval threshold value or not, and if so, combining the two adjacent picture elements into a picture group.
B18. The electronic device according to any one of B10-17, wherein the original page is a layout page, and the layout page is a streaming page.
C19. A computer storage medium having stored therein at least one executable instruction for causing a processor to perform a method as recited in any of a 1-9.

Claims (10)

1.一种基于图片类电子书的排版方法,其中,所述方法包括:1. A typesetting method based on a picture-based electronic book, wherein the method comprises: 获取针对电子书的原始页面进行解析后得到的多个图片元素以及各个图片元素在所述原始页面中的位置信息,将位置相邻的若干图片元素合并为图片分组;Obtaining a plurality of picture elements obtained by parsing the original page of the e-book and the position information of each picture element in the original page, and combining several picture elements with adjacent positions into picture groups; 确定与所述图片分组相对应的外接矩形区域以及所述外接矩形区域的区域边框线,将所述图片分组中包含的沿所述区域边框线排布的各个图片元素确定为与所述区域边框线相对应的边框图片元素;Determining a circumscribed rectangular area corresponding to the picture group and an area border line of the circumscribed rectangular area, and determining each picture element included in the picture group and arranged along the area border line as the area border The border picture element corresponding to the line; 根据获取到的各个边框图片元素沿所述区域边框线方向的长度累积和与所述区域边框线的长度之间的比较结果,判断所述图片分组是否符合边框校验条件;According to the obtained comparison result of the cumulative length of each frame picture element along the direction of the area frame line and the length of the area frame line, it is judged whether the picture grouping meets the frame check condition; 若是,针对所述图片分组执行截图处理,得到与所述图片分组相对应的截图图片,根据所述截图图片生成与所述原始页面相对应的排版页面。If so, perform screenshot processing on the picture group to obtain a screenshot picture corresponding to the picture group, and generate a layout page corresponding to the original page according to the screenshot picture. 2.根据权利要求1所述的方法,其中,所述确定与所述图片分组相对应的外接矩形区域以及所述外接矩形区域的区域边框线包括:2. The method according to claim 1, wherein the determining a circumscribed rectangular area corresponding to the picture group and an area border line of the circumscribed rectangular area comprises: 绘制与所述图片分组相对应的最小外接矩形,得到与所述图片分组相对应的外接矩形区域;Drawing a minimum circumscribed rectangle corresponding to the picture grouping to obtain a circumscribed rectangle area corresponding to the picture grouping; 将所述最小外接矩形的四条边中的至少一条确定为所述外接矩形区域的区域边框线。At least one of the four sides of the minimum circumscribed rectangle is determined as an area border line of the circumscribed rectangle area. 3.根据权利要求1或2所述的方法,其中,所述将所述图片分组中包含的沿所述区域边框线排布的各个图片元素确定为与所述区域边框线相对应的边框图片元素包括:分别针对每条区域边框线,将图片边框线与该条区域边框线匹配的图片元素确定为与该区域边框线相对应的边框图片元素;3. The method according to claim 1 or 2, wherein each picture element included in the picture group and arranged along the area border line is determined as a border picture corresponding to the area border line The elements include: for each region border line, respectively, determining the picture element whose picture border line matches the region border line as the border picture element corresponding to the region border line; 则所述根据获取到的各个边框图片元素沿所述区域边框线方向的长度累积和与所述区域边框线的长度之间的比较结果,判断所述图片分组是否符合边框校验条件包括:Then, according to the comparison result between the accumulated length of each frame picture element obtained along the direction of the regional border line and the length of the regional border line, judging whether the picture grouping meets the border verification conditions includes: 分别针对每条区域边框线,计算与该条区域边框线相对应的边框图片元素沿该条区域边框线方向的长度累积和,将所述长度累积和与该条区域边框线的长度之间的差值与预设差值阈值进行比较,得到与该条区域边框线相对应的比较结果;For each area border line, calculate the cumulative sum of the lengths of the border picture elements corresponding to the area border line along the direction of the area border line, and calculate the cumulative sum of the lengths and the length of the area border line. The difference is compared with the preset difference threshold, and a comparison result corresponding to the border line of the region is obtained; 根据与至少一条区域边框线相对应的比较结果,判断所述图片分组是否符合边框校验条件。According to the comparison result corresponding to at least one area border line, it is judged whether the picture group meets the border check condition. 4.根据权利要求3所述的方法,其中,当根据与至少一条区域边框线相对应的比较结果,判断出所述图片分组符合边框校验条件之后,进一步包括:4. The method according to claim 3, wherein, after judging that the picture group meets the frame check condition according to the comparison result corresponding to at least one area border line, the method further comprises: 判断所述图片分组中的各个图片元素的面积累积和与所述外接矩形区域的区域总面积之间的比较结果是否符合面积校验条件;Determine whether the comparison result between the cumulative sum of the area of each picture element in the picture group and the total area of the circumscribed rectangular area meets the area verification condition; 当符合面积校验条件时,执行所述针对所述图片分组执行截图处理的步骤。When the area verification condition is met, the step of performing the screenshot processing for the picture group is performed. 5.根据权利要求4所述的方法,其中,所述根据与至少一条区域边框线相对应的比较结果,判断出所述图片分组符合边框校验条件包括:与四条区域边框线相对应的比较结果都符合边框校验条件;5. The method according to claim 4, wherein, according to the comparison result corresponding to at least one area border line, judging that the picture group meets the border check condition comprises: a comparison corresponding to four area border lines The results all meet the frame verification conditions; 并且,当不符合面积校验条件时,判断所述外接矩形区域内部是否包含非图片区域;若是,剔除所述非图片区域后,执行所述针对所述图片分组执行截图处理的步骤。And, when the area verification condition is not met, it is judged whether the inside of the circumscribed rectangular area contains a non-picture area; if so, after removing the non-picture area, the step of performing the screenshot processing for the picture group is performed. 6.根据权利要求3所述的方法,其中,当根据与至少一条区域边框线相对应的比较结果,判断出所述图片分组符合边框校验条件之后,进一步包括:6. The method according to claim 3, wherein, after judging that the picture group meets the frame check condition according to the comparison result corresponding to at least one area border line, further comprising: 判断所述外接矩形区域内部是否包含文本区域;Determine whether the inside of the circumscribed rectangular area contains a text area; 当所述外接矩形区域内部未包含文本区域时,执行所述针对所述图片分组执行截图处理的步骤。When the inside of the circumscribed rectangular area does not contain a text area, the step of performing the screenshot processing for the picture group is performed. 7.根据权利要求6所述的方法,其中,所述根据与至少一条区域边框线相对应的比较结果,判断出所述图片分组符合边框校验条件包括:与至少一条区域边框线相对应的比较结果符合边框校验条件,且与其余区域边框线相对应的比较结果不符合边框校验条件;7 . The method according to claim 6 , wherein, according to the comparison result corresponding to at least one area border line, judging that the picture group meets the border check condition comprises: corresponding to at least one area border line. 8 . The comparison result complies with the frame verification conditions, and the comparison results corresponding to the border lines of the remaining areas do not meet the frame verification conditions; 并且,当所述外接矩形区域内部包含文本区域时,剔除所述文本区域后,执行所述针对所述图片分组执行截图处理的步骤。And, when the inside of the circumscribed rectangular area contains a text area, after removing the text area, the step of performing the screenshot processing for the picture group is performed. 8.根据权利要求1-7任一所述的方法,其中,所述将位置相邻的若干图片元素合并为图片分组包括:8. The method according to any one of claims 1-7, wherein the combining several picture elements in adjacent positions into a picture group comprises: 判断相邻的两个图片元素之间的间隔是否小于预设间隔阈值,若是,将所述相邻的两个图片元素合并至一个图片分组。Determine whether the interval between two adjacent picture elements is smaller than a preset interval threshold, and if so, combine the two adjacent picture elements into one picture group. 9.一种电子设备,包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通信总线完成相互间的通信;9. An electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; 所述存储器用于存放至少一可执行指令,所述可执行指令使所述处理器执行以下操作:The memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform the following operations: 获取针对电子书的原始页面进行解析后得到的多个图片元素以及各个图片元素在所述原始页面中的位置信息,将位置相邻的若干图片元素合并为图片分组;Obtaining a plurality of picture elements obtained by parsing the original page of the e-book and the position information of each picture element in the original page, and combining several picture elements with adjacent positions into picture groups; 确定与所述图片分组相对应的外接矩形区域以及所述外接矩形区域的区域边框线,将所述图片分组中包含的沿所述区域边框线排布的各个图片元素确定为与所述区域边框线相对应的边框图片元素;Determining a circumscribed rectangular area corresponding to the picture group and an area border line of the circumscribed rectangular area, and determining each picture element included in the picture group and arranged along the area border line as the area border The border picture element corresponding to the line; 根据获取到的各个边框图片元素沿所述区域边框线方向的长度累积和与所述区域边框线的长度之间的比较结果,判断所述图片分组是否符合边框校验条件;According to the obtained comparison result of the cumulative length of each frame picture element along the direction of the area frame line and the length of the area frame line, it is judged whether the picture grouping meets the frame check condition; 若是,针对所述图片分组执行截图处理,得到与所述图片分组相对应的截图图片,根据所述截图图片生成与所述原始页面相对应的排版页面。If so, perform screenshot processing on the picture group to obtain a screenshot picture corresponding to the picture group, and generate a layout page corresponding to the original page according to the screenshot picture. 10.一种计算机存储介质,所述存储介质中存储有至少一可执行指令,所述可执行指令使处理器执行如权利要求1-8任一所述的方法。10. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction causes a processor to execute the method according to any one of claims 1-8.
CN202110301334.2A 2021-03-22 2021-03-22 Typesetting method based on picture electronic book, electronic equipment and storage medium Active CN113011131B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110301334.2A CN113011131B (en) 2021-03-22 2021-03-22 Typesetting method based on picture electronic book, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110301334.2A CN113011131B (en) 2021-03-22 2021-03-22 Typesetting method based on picture electronic book, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113011131A true CN113011131A (en) 2021-06-22
CN113011131B CN113011131B (en) 2022-02-22

Family

ID=76404088

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110301334.2A Active CN113011131B (en) 2021-03-22 2021-03-22 Typesetting method based on picture electronic book, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113011131B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113096217A (en) * 2021-03-25 2021-07-09 北京达佳互联信息技术有限公司 Picture generation method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102306294A (en) * 2011-08-23 2012-01-04 深圳市万兴软件有限公司 Method and system for extracting image from portable document format (PDF) file page
CN103186510A (en) * 2011-12-30 2013-07-03 北大方正集团有限公司 Document format transforming method and device
CN112100978A (en) * 2020-09-16 2020-12-18 掌阅科技股份有限公司 Typesetting processing method, electronic device and storage medium based on electronic book
CN112100979A (en) * 2020-09-16 2020-12-18 掌阅科技股份有限公司 Typesetting processing method, electronic device and storage medium based on electronic book

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102306294A (en) * 2011-08-23 2012-01-04 深圳市万兴软件有限公司 Method and system for extracting image from portable document format (PDF) file page
CN103186510A (en) * 2011-12-30 2013-07-03 北大方正集团有限公司 Document format transforming method and device
CN112100978A (en) * 2020-09-16 2020-12-18 掌阅科技股份有限公司 Typesetting processing method, electronic device and storage medium based on electronic book
CN112100979A (en) * 2020-09-16 2020-12-18 掌阅科技股份有限公司 Typesetting processing method, electronic device and storage medium based on electronic book

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113096217A (en) * 2021-03-25 2021-07-09 北京达佳互联信息技术有限公司 Picture generation method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113011131B (en) 2022-02-22

Similar Documents

Publication Publication Date Title
CN109670500B (en) Text region acquisition method and device, storage medium and terminal equipment
CN110069767B (en) Typesetting method based on electronic book, electronic equipment and computer storage medium
EP0881591B1 (en) Ordering groups of text in an image
WO2019237549A1 (en) Verification code recognition method and apparatus, computer device, and storage medium
CN112100979B (en) Typesetting processing method based on electronic book, electronic device and storage medium
US20070081179A1 (en) Image processing device, image processing method, and computer program product
JPH0652354A (en) Skew correcting method, skew angle detecting method, document segmentation system and skew angle detector
US10423851B2 (en) Method, apparatus, and computer-readable medium for processing an image with horizontal and vertical text
JP7244223B2 (en) Identifying emphasized text in electronic documents
CN112417899A (en) Text translation method, device, computer equipment and storage medium
CN112699634A (en) Typesetting processing method of electronic book, electronic equipment and storage medium
CN112329548A (en) Document chapter segmentation method and device and storage medium
CN105404683A (en) Format file processing method and apparatus
CN117725886A (en) Layout file checking method and device
CN113887481A (en) An image processing method, device, electronic device and medium
US10121088B2 (en) System and method for straightening curved page content
CN113011131B (en) Typesetting method based on picture electronic book, electronic equipment and storage medium
CN110533020B (en) Character information identification method and device and storage medium
CN111160234A (en) Table recognition method, electronic device and computer storage medium
CN106934383A (en) The recognition methods of picture markup information, device and server in file
CN110941972B (en) Segmentation method and device for characters in PDF document and electronic equipment
CN112100978B (en) Typesetting processing method, electronic device and storage medium based on electronic book
CN109558876B (en) Character recognition processing method and device
CN112114786A (en) Editor implementation method, computing device and readable storage medium
CN111461205A (en) Image processing method, apparatus, electronic device, and computer-readable storage medium

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
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20210622

Assignee: Shaanxi Digital Information Technology Co.,Ltd.

Assignor: ZHANGYUE TECHNOLOGY Co.,Ltd.

Contract record no.: X2023990000904

Denomination of invention: Layout methods, electronic devices, and storage media for image based e-books

Granted publication date: 20220222

License type: Common License

Record date: 20231107

EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20210622

Assignee: Shaanxi Digital Information Technology Co.,Ltd.

Assignor: ZHANGYUE TECHNOLOGY Co.,Ltd.

Contract record no.: X2024990000578

Denomination of invention: Layout method, electronic devices, and storage media based on image-based e-books

Granted publication date: 20220222

License type: Common License

Record date: 20241118