An electronic book editing method, system, electronic device and storage medium

By analyzing screenshots of users' historical ebooks, the layout of the current ebook is automatically adjusted, solving the problem of personalized user needs and improving the reading experience.

CN120144024BActive Publication Date: 2026-01-09JIANGXI YUANJU NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510220756.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2026-01-09
Estimated Expiration
2045-02-27

AI Technical Summary

Technical Problem

Existing e-book typesetting technology cannot meet users' personalized needs, resulting in a poor reading experience, especially in achieving ideal typesetting effects on different devices and screen sizes.

Method used

By acquiring screenshots of users' historical ebooks, analyzing character regions and color information, matching target ebook screenshots, determining text and color layout information, and automatically adjusting the layout of the current ebook to conform to user habits.

Benefits of technology

It enables automatic e-book formatting to match users' reading habits across different devices and screen sizes, thus improving the reading experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144024B_ABST
    Figure CN120144024B_ABST
Patent Text Reader

Abstract

The application provides an electronic book editing method and system, electronic equipment and storage medium, which comprises the following steps: obtaining each historical electronic book screenshot of a user, wherein the historical electronic book screenshot at least contains characters arranged in a preset layout format; matching a target electronic book screenshot in the historical electronic book screenshot according to the size of a current electronic book screenshot and character information; positioning a character region in the target electronic book screenshot, and extracting at least two lines of characters in the target electronic book screenshot according to the character region; analyzing the characters to determine text layout information; determining color layout information according to the target electronic book screenshot; and laying out the current electronic book according to the text layout information and the color layout information to obtain a layout result. Specifically, the user can make the currently read electronic book present a state meeting the requirements without remembering the layout parameters meeting the reading habits of the user, so as to improve the reading experience of the user.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of electronic book editing, and particularly relates to an electronic book editing method and system, an electronic device and a storage medium. BACKGROUND

[0002] An electronic book is a book that exists in digital form and can be read and stored through electronic devices such as computers, mobile phones, e-readers, etc. Electronic books have many advantages, such as portability, searchability, environmental protection, and customizable reading experience. With the development of technology, electronic books have become the preferred reading method for more and more readers.

[0003] The importance of typesetting for electronic book reading is self-evident, which will directly affect the reading experience. Elegant design can attract readers, while poor typesetting can cause visual fatigue. There are some technologies to quickly typeset electronic books at present, aiming to improve the reading experience of users. However, the typesetting results generated quickly are not suitable for all users, and some users prefer to use special font sizes, line spacing, fonts, etc. However, due to the variety of electronic book reading devices and different screen sizes, in addition, the setting methods of typesetting in reading devices are different, that is, the quick typesetting may not meet the needs of users, and manual typesetting is time-consuming and laborious, and may not be able to adjust to the typesetting result that users want. SUMMARY

[0004] Therefore, the embodiments of the present application provide an electronic book editing method, system, electronic device and storage medium, which aims to quickly import the typesetting method that users like, and improve the reading experience of users.

[0005] The first aspect of the embodiments of the present application provides an electronic book editing method applied to a text reading scenario, the method comprising:

[0006] Obtaining each historical electronic book screenshot of a user, wherein the historical electronic book screenshot at least contains characters arranged in a preset typesetting format;

[0007] According to the size and character information of the current electronic book screenshot, matching a target electronic book screenshot in the historical electronic book screenshot;

[0008] Positioning the character region of the target electronic book screenshot, and extracting at least two lines of characters in the target electronic book screenshot according to the character region;

[0009] Analyzing the at least two lines of characters extracted in the target electronic book screenshot to determine the text typesetting information;

[0010] According to the target electronic book screenshot, determining the color typesetting information;

[0011] According to the text layout information and the color layout information, the current e-book is laid out to obtain a layout result, so as to complete the editing of the e-book.

[0012] Further, the step of matching the target e-book screenshot from the historical e-book screenshots according to the size of the current e-book screenshot and the character information comprises:

[0013] Obtaining the size of the current e-book screenshot and the character information, wherein the character information at least comprises a text type;

[0014] Judging whether there is a screenshot with the same size as the current e-book screenshot in the historical e-book screenshots;

[0015] If it is judged that there is a screenshot with the same size as the current e-book screenshot in the historical e-book screenshots, judging whether the text type in the screenshot with the same size as the current e-book screenshot is consistent with the text type in the historical e-book screenshots;

[0016] If it is judged that the text type in the screenshot with the same size as the current e-book screenshot is consistent with the text type in the historical e-book screenshots, the corresponding screenshot is determined as the target e-book screenshot.

[0017] Further, the step of positioning the character region of the target e-book screenshot and extracting at least two lines of characters in the target e-book screenshot according to the character region comprises:

[0018] Establishing a rectangular coordinate system of the target e-book screenshot and obtaining the pixel value of each pixel point in the screenshot;

[0019] According to the preset pixel value range and the pixel value difference of adjacent pixel points, the coordinate position of each first target pixel point representing the character is determined;

[0020] According to the coordinate position of each first target pixel point, the polar coordinate point in the horizontal axis direction and the vertical axis direction is determined;

[0021] According to the polar coordinate point, the character region is positioned, and at least two lines of characters in the character region are recognized and extracted.

[0022] Further, the at least two lines of characters extracted contain punctuation marks, and the punctuation marks at least include a period.

[0023] Further, the step of analyzing the at least two lines of characters extracted from the target e-book screenshot to determine the layout information comprises:

[0024] According to the at least two lines of characters in the target e-book screenshot, the character number of one line of characters and the interval distance between two lines of characters are determined;

[0025] According to the length of the character region in the target e-book screenshot, the number of characters in a line of characters, and the interval distance between two lines of characters, a pixel point region of a single character is determined;

[0026] A target pixel point region with a period is found in each pixel point region, and a second target pixel point corresponding to the period is obtained, and a font is determined according to the size of the target pixel point region and the distribution of the second target pixel point.

[0027] According to the size of the pixel point region of a single character, the number of characters in a line of characters, and the font, a font size is determined.

[0028] Further, the step of determining the font according to the size of the target pixel point region and the distribution of the second target pixel point includes:

[0029] The length and width of the target pixel point region are obtained, and the length-width ratio is calculated, and a corresponding first font is matched according to the length-width ratio.

[0030] The coordinate position of the second target pixel point is obtained, and the coordinate position of the center point of the period is determined according to the coordinate position of the second target pixel point.

[0031] The distance from the center point coordinate position to the preset boundary of the target pixel point region is calculated, and the distance ratio is calculated, and a second font is selected from the first font according to the distance ratio.

[0032] The number of all pixel points in the period region is determined according to the coordinate position of the second target pixel point, and the number ratio of the number of the second target pixel points representing the period to the number of all pixel points in the period region is calculated.

[0033] The third font is selected from the second font according to the number ratio, so as to determine the final font.

[0034] Further, the color layout information at least includes character color and background color.

[0035] The second aspect of the embodiment of the application provides an e-book editing system for realizing the e-book editing method provided by the first aspect of the embodiment of the application, and the system comprises:

[0036] An acquisition module is configured to acquire historical e-book screenshots of a user, wherein the historical e-book screenshots at least contain characters arranged in a preset layout format;

[0037] A matching module is configured to match a target e-book screenshot in the historical e-book screenshots according to the size of the current e-book screenshot and the character information.

[0038] A positioning module is configured to position a character region of the target e-book screenshot and extract at least two lines of characters in the target e-book screenshot according to the character region;

[0039] An analyzing module is configured to analyze the at least two lines of characters extracted from the target e-book screenshot and determine text layout information;

[0040] A determining module is configured to determine color layout information according to the target e-book screenshot;

[0041] A layout module is configured to perform layout on a current e-book according to the text layout information and the color layout information, to obtain a layout result, so as to complete editing of the e-book.

[0042] A third aspect of the embodiment of the present application provides a computer readable storage medium, comprising:

[0043] The readable storage medium stores one or more programs, which are executed by a processor to implement the e-book editing method according to the first aspect.

[0044] A fourth aspect of the embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein:

[0045] The memory is configured to store a computer program;

[0046] The processor is configured to execute the computer program stored in the memory to implement the e-book editing method according to the first aspect.

[0047] The e-book editing method, system, electronic device and storage medium provided in the embodiment of the present application, by obtaining each historical e-book screenshot of a user, the historical e-book screenshot at least containing characters arranged in a preset layout format; matching a target e-book screenshot in the historical e-book screenshot according to a size and character information of a current e-book screenshot; positioning a character region in the target e-book screenshot and extracting at least two lines of characters in the target e-book screenshot according to the character region; analyzing the at least two lines of characters extracted from the target e-book screenshot to determine text layout information; determining color layout information according to the target e-book screenshot; and performing layout on the current e-book according to the text layout information and the color layout information to obtain a layout result, specifically, the user can make the e-book being read at present to present a state meeting the requirements without remembering the layout parameters meeting the reading habits of the user, so as to improve the reading experience of the user. BRIEF DESCRIPTION OF DRAWINGS

[0048] Figure 1 An implementation flowchart of the e-book editing method provided for the embodiment one of the present application;

[0049] Figure 2 A structural block diagram of an electronic book editing method system provided for the second embodiment of the present application is shown in FIG. 3.

[0050] Figure 3 A structural block diagram of an electronic device provided for the third embodiment of the present application is shown in FIG. 4. DETAILED DESCRIPTION

[0051] In order to facilitate the understanding of the present application, the present application will be described in more detail below with reference to the relevant drawings. The drawings show several embodiments of the present application. However, the present application can be realized in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.

[0052] It should be noted that when an element is referred to as being "fixed to" another element, it can be directly on the other element or there can be a middle element. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or there can be a middle element. The terms "vertical", "horizontal", "left", "right", and similar expressions used herein are for illustrative purposes only.

[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0054] Embodiment One

[0055] The first embodiment of the present application provides an electronic book editing method, which is applied to the scenario of text reading, i.e. the electronic book reading interface does not contain illustrations, tables and other parts except for text. Please refer to FIG. 1, which is a schematic diagram of an electronic book reading interface. Figure 1 An implementation flowchart of an electronic book editing method is shown in FIG. 2, which specifically includes steps S01 to S06.

[0056] In step S01, the historical electronic book screenshots of a user are acquired, wherein the historical electronic book screenshots at least contain characters arranged in a preset layout format.

[0057] Specifically, the historical electronic book screenshots are screenshots of layout modes that the user likes, which can be screenshots on a computer, screenshots on a mobile phone, screenshots on an electronic book reader, etc. The characters in the screenshots are mainly composed of text and symbols. It should be noted that the text includes common reading text such as Chinese and English.

[0058] The user can save the electronic book screenshot without knowing or remembering the layout parameters, and when reading the electronic book on another terminal, the layout parameters obtained by analyzing the electronic book screenshot can be imported into the terminal, so as to finally ensure the reading experience of the user.

[0059] In step S02, the target electronic book screenshot is matched from the historical electronic book screenshots according to the size of the current electronic book screenshot and the character information.

[0060] It should be noted that the size of the current electronic book screenshot and the character information including at least the text type are obtained. It can be understood that the resolution can be understood from the size of the current electronic book screenshot, and the screenshots with consistent resolution or within a certain deviation range can better meet the user's needs. In addition, the text type refers to common reading texts such as Chinese and English. It can be understood that Chinese and English have obvious differences in font, and can be matched separately.

[0061] It is determined whether there is a screenshot with the same size as the current electronic book screenshot in the historical electronic book screenshots.

[0062] If it is determined that there is a screenshot with the same size as the current electronic book screenshot in the historical electronic book screenshots, it is determined whether the text type in the screenshot with the same size as the current electronic book screenshot is consistent with the text type in the historical electronic book screenshots.

[0063] If it is determined that the text type in the screenshot with the same size as the current electronic book screenshot is consistent with the text type in the historical electronic book screenshots, the corresponding screenshot is determined as the target electronic book screenshot. For example, the screenshot with the same size and the text type of Chinese is determined as the target electronic book screenshot.

[0064] In step S03, the character region of the target electronic book screenshot is located, and at least two rows of characters in the target electronic book screenshot are extracted according to the character region.

[0065] In the embodiment of the application, a rectangular coordinate system of the target electronic book screenshot is established, and the pixel value of each pixel point in the screenshot is obtained. Specifically, the rectangular coordinate system can be established with the lower left corner of the target electronic book screenshot as the origin, and each pixel point as a coordinate point.

[0066] According to the preset pixel value range and the pixel value difference of adjacent pixel points, the coordinate positions of the first target pixel points representing characters are determined. It can be understood that in general cases, it is white background and black text, and the pixel points with black pixel values can be marked as first target pixel points. In addition, if it is not in the form of white background and black text, the first target pixel points can also be determined by the pixel value difference of adjacent pixel points, that is, when the pixel value difference of adjacent pixel points is greater than a threshold value.

[0067] According to the coordinate position of each first target pixel point, polar coordinate points in the horizontal axis direction and the vertical axis direction are determined, wherein the polar coordinate points at least include coordinate points in the up, down, left and right four directions;

[0068] According to the polar coordinate points, the character region is located, and at least two lines of characters in the character region are recognized and extracted. Specifically, according to the polar coordinate points, a rectangular frame is drawn, and the area of the rectangular frame is the character region. Since the characters in the character region are arranged in a certain regularity, for example, the line spacing can be determined according to the periodic interval of the first target pixel point in the vertical axis direction, and at least two lines of characters are extracted.

[0069] It should be noted that the extracted at least two lines of characters include punctuation marks, and the punctuation marks are at least a period.

[0070] In step S04, the at least two lines of characters extracted from the target electronic book screenshot are analyzed to determine the text layout information.

[0071] Specifically, according to the at least two lines of characters in the target electronic book screenshot, the number of characters in a line and the interval distance between two lines of characters are determined. It can be understood that the outline of a character is determined according to the pixel value difference of adjacent pixel points. Taking the first target pixel point representing the character as an example, when the pixel difference between the first target pixel point and the pixel point outside is greater than a threshold value, and the pixel difference between the first target pixel point and the pixel point inside is close to 0, the first target pixel point can be regarded as a pixel point on the outline. By counting the coordinate positions of all the pixel points on the outline, the periodic interval of the pixel points representing the outline in the horizontal axis direction can be determined, and the number of characters in a line and the interval distance between two lines of characters can be obtained.

[0072] According to the length of the character region in the target electronic book screenshot, the number of characters in a line and the interval distance between two lines of characters, the pixel point region of a single character is determined. It should be noted that the pixel point region of a single character is not a rectangular region formed by the pixel points of a single character outline, but a blank target rectangular region when the character is to be input. The size of the blank target rectangular region is related to the font. After the character is input, the character is located at a predetermined position of the target rectangular region, for example, in the middle position of the target rectangular region when Chinese is input, or in the lower left corner position or the middle position of the target rectangular region when a period is input. It can be understood that different fonts have different period styles, which may be different relative positions or different outlines of the period. For example, when Chinese characters are mainly used, the recognition of the period can at least distinguish between Songti, Fanti, Black Body, Kaishu, and other fonts.

[0073] In each pixel point region, a target pixel point region with a period is searched, that is, a circular pixel point region is searched, and a second target pixel point corresponding to the period is obtained. According to the size of the target pixel point region and the distribution of the second target pixel point, a font is determined. Specifically, the length and width of the target pixel point region, that is, the length and width of the target rectangular region, are obtained. It should be noted that the length in the horizontal coordinate direction of the target rectangular region is regarded as the length, and the length in the vertical coordinate direction of the target rectangular region is regarded as the width, or the length in the horizontal coordinate direction of the target rectangular region is regarded as the width, and the length in the vertical coordinate direction of the target rectangular region is regarded as the length. The length-width ratio is calculated, and the corresponding first font is matched according to the length-width ratio. It can be understood that the size of the target rectangular region can reflect a part of the font type.

[0074] The coordinate position of the second target pixel point is obtained, and the coordinate position of the center point of the period is determined according to the coordinate position of the second target pixel point.

[0075] The distance from the center point coordinate position to the preset boundary of the target pixel point region is calculated. For example, the distance from the center point coordinate position to the left boundary of the target pixel point region and the distance from the center point coordinate position to the lower boundary of the target pixel point region are calculated respectively, and the distance ratio is calculated. According to the distance ratio, a second font is selected from the first font.

[0076] According to the coordinate position of the second target pixel point, the number of all pixel points in the period region, that is, the number of all pixel points in the circular region, is determined, and the number ratio of the number of the second target pixel point representing the period to the number of all pixel points in the period region is calculated. It can be understood that after analyzing the position of the period relative to the target pixel point region, the period may be thickened or thinned according to the different fonts. The change in the pixel points is finally reflected in the change in the number of pixel points. Therefore, according to the number ratio of the pixel points, the target font type is determined.

[0077] According to the number ratio, a third font is selected from the second font to determine the final font.

[0078] According to the size of the pixel point region of a single character, the number of characters in a line of characters, and the font, the font size is determined. When the size of the pixel point region of a single character, the number of characters in a line of characters, and the font are determined, the influence of the screenshot scaling on the font size can be excluded, and the real font size is determined.

[0079] In step S05, color layout information is determined according to the target electronic book screenshot.

[0080] The color of the character and the color of the background are extracted to determine the color layout information, specifically, the color can be determined according to the pixel value of the pixel point representing the character, and the pixel value of the remaining part is determined as the pixel value of the background color after the color of the character is determined.

[0081] In step S06, the current electronic book is laid out according to the text layout information and the color layout information to obtain a layout result, so as to complete the editing of the electronic book.

[0082] In conclusion, the electronic book editing method provided by the embodiment of the present application can obtain the historical electronic book screenshots of the user, and the historical electronic book screenshots at least contain characters arranged in a preset layout format; the target electronic book screenshot in the historical electronic book screenshots is matched according to the size and character information of the current electronic book screenshot; the character region in the target electronic book screenshot is located, and at least two rows of characters in the target electronic book screenshot are extracted according to the character region; the at least two rows of characters extracted from the target electronic book screenshot are analyzed to determine the text layout information; the color layout information is determined according to the target electronic book screenshot; and the current electronic book is laid out according to the text layout information and the color layout information to obtain a layout result, specifically, the user can make the currently read electronic book present a state meeting the requirements without remembering the layout parameters meeting the reading habits of the user, so as to improve the reading experience of the user.

[0083] Embodiment two

[0084] The embodiment two of the present application provides an electronic book editing system 200, please refer to Figure 2 , which is a structural block diagram of an electronic book editing method system, the electronic book editing system 200 comprises:

[0085] The acquisition module 21 is used for acquiring historical electronic book screenshots of the user, and the historical electronic book screenshots at least contain characters arranged in a preset layout format;

[0086] The matching module 22 is used for matching a target electronic book screenshot in the historical electronic book screenshots according to the size and character information of the current electronic book screenshot;

[0087] The positioning module 23 is used for locating the character region of the target electronic book screenshot, and extracting at least two rows of characters in the target electronic book screenshot according to the character region;

[0088] The analysis module 24 is used for analyzing the at least two rows of characters extracted from the target electronic book screenshot to determine the text layout information, and the at least two rows of characters contain punctuation marks, and the punctuation marks are at least a period;

[0089] The determining module 25 is configured to determine color layout information according to the target e-book screenshot, wherein the color layout information at least includes character color and background color.

[0090] The layout module 26 is configured to layout the current e-book according to the text layout information and the color layout information, to obtain a layout result, so as to complete the editing of the e-book.

[0091] Further, in some other embodiments of the present application, the matching module 22 includes:

[0092] The first obtaining unit is configured to obtain the size of the current e-book screenshot and character information, wherein the character information at least includes text type;

[0093] The first judging unit is configured to judge whether there is a screenshot with the same size as the current e-book screenshot in the historical e-book screenshots;

[0094] The second judging unit is configured to, if there is a screenshot with the same size as the current e-book screenshot in the historical e-book screenshots, judge whether the text type in the screenshot with the same size as the current e-book screenshot is consistent with the text type in the historical e-book screenshots;

[0095] The first determining unit is configured to, if the text type in the screenshot with the same size as the current e-book screenshot is consistent with the text type in the historical e-book screenshots, determine the corresponding screenshot as the target e-book screenshot.

[0096] Further, in some other embodiments of the present application, the positioning module 23 includes:

[0097] The second obtaining unit is configured to establish a rectangular coordinate system of the target e-book screenshot and obtain pixel values of each pixel point in the screenshot;

[0098] The second determining unit is configured to determine the coordinate positions of each first target pixel point representing a character according to a preset pixel value range and a pixel value difference of adjacent pixel points;

[0099] The third determining unit is configured to determine polar coordinate points in the horizontal axis direction and the vertical axis direction according to the coordinate positions of each first target pixel point;

[0100] The positioning unit is configured to position a character region according to the polar coordinate points, and recognize and extract at least two rows of characters in the character region.

[0101] Further, in some other embodiments of the present application, the analysis module 24 includes:

[0102] The fourth determining unit is configured to determine the number of characters in one line and the interval distance between two lines according to at least two lines of characters in the target e-book screenshot;

[0103] The fifth determining unit is configured to determine the pixel point area of a single character according to the length of the character region in the target e-book screenshot, the number of characters in one line and the interval distance between two lines.

[0104] The sixth determining unit is configured to find a target pixel point area with a period in each pixel point area and obtain a second target pixel point corresponding to the period, and determine the font according to the size of the target pixel point area and the distribution of the second target pixel point.

[0105] The seventh determining unit is configured to determine the font size according to the size of the pixel point area of a single character, the number of characters in one line and the font.

[0106] Further, in some other embodiments of the present application, the sixth determining unit comprises:

[0107] The first calculating sub-unit is configured to obtain the length and width of the target pixel point area, calculate the length-width ratio, and match a corresponding first font according to the length-width ratio.

[0108] The obtaining sub-unit is configured to obtain the coordinate position of the second target pixel point, and determine the coordinate position of the center point of the period according to the coordinate position of the second target pixel point.

[0109] The second calculating sub-unit is configured to calculate the distance from the coordinate position of the center point to the preset boundary of the target pixel point area, calculate the distance ratio, and select a second font from the first font according to the distance ratio.

[0110] The third calculating sub-unit is configured to determine the number of all pixel points in the period region according to the coordinate position of the second target pixel point, and calculate the number ratio of the number of the second target pixel point representing the period to the number of all pixel points in the period region.

[0111] The screening sub-unit is configured to select a third font from the second font according to the number ratio, so as to determine the final font.

[0112] Embodiment three

[0113] Embodiment three of the present application proposes an electronic device, please refer to Figure 3 , which is a structural block diagram of an electronic device, comprising a memory 20, a processor 10, and a computer program 30 stored in the memory and capable of running on the processor, wherein the processor 10 implements the e-book editing method as described above when executing the computer program 30.

[0114] The processor 10 may, in some embodiments, be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip, for running program codes stored in the memory 20 or processing data, such as executing the access restriction program, etc.

[0115] The memory 20 may, in some embodiments, be an internal storage unit of the electronic device, such as a hard disk of the electronic device. The memory 20 may, in other embodiments, also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the memory 20 may also include both the internal storage unit and the external storage device of the electronic device. The memory 20 may be used not only for storing application software and various data of the electronic device, but also for temporarily storing data that has been output or will be output.

[0116] The present application also provides a computer readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the electronic book editing method as described above.

[0117] Those skilled in the art can understand that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a list of executable instructions for implementing the logic functions, which can be specifically implemented in any computer readable medium for use by or in conjunction with an instruction execution system, device or apparatus, such as a computer-based system, a system including a processor or other system capable of fetching and executing instructions from an instruction execution system, device or apparatus. For the present specification, the "computer readable medium" can be any device capable of containing, storing, communicating, propagating or transmitting programs for use by or in conjunction with an instruction execution system, device or apparatus, or in conjunction with these instruction execution systems, devices or apparatus.

[0118] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via an optical scanner, then compiled, interpreted, or otherwise processed, and stored in a computer memory in a form that is then employable by a computer. Examples of computer-readable media that are further within the spirit of the present application are a computer program product, a computer readable storage medium, and a computer.

[0119] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the embodiments described above, various steps or methods can be implemented, for example, by software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and in another embodiment, any of the following techniques, which are well known in the art, can be used to implement the application: a hybrid of the above techniques, discrete logic circuit(s) having logic gates for implementing logic functions upon request pins of the discrete logic circuit(s), programmable logic array(s) (PLAs), field programmable logic array(s) (FPGAs), etc.

[0120] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the application. In the specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in one or more embodiments or examples.

[0121] The above embodiments only express several implementation manners of the application, which are described in a more specific and detailed manner, but cannot be understood as limiting the patent scope of the application. It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the application, which are all within the protection scope of the application. Therefore, the patent protection scope of the application should be subject to the appended claims.

Claims

1. An electronic book editing method characterized by comprising: The method applied to a Chinese reading scenario comprises: obtaining historical electronic book screenshots of a user, the historical electronic book screenshots containing at least characters arranged in a preset layout format; matching a target electronic book screenshot in the historical electronic book screenshots according to a size of a current electronic book screenshot and character information; positioning a character region of the target electronic book screenshot and extracting at least two lines of characters in the target electronic book screenshot according to the character region, wherein the at least two lines of characters contain punctuation marks, and the punctuation marks are at least a period; analyzing the at least two lines of characters in the target electronic book screenshot to determine text layout information; determining color layout information according to the target electronic book screenshot; performing layout on a current electronic book according to the text layout information and the color layout information to obtain a layout result, so as to complete editing of the electronic book; the step of analyzing the at least two lines of characters in the target electronic book screenshot to determine text layout information comprises: determining a character quantity of one line of characters and a spacing distance between two lines of characters according to the at least two lines of characters in the target electronic book screenshot; determining a pixel point region of a single character according to a length of the character region in the target electronic book screenshot, the character quantity of one line of characters and the spacing distance between two lines of characters; finding a target pixel point region with a period in each pixel point region and obtaining a second target pixel point corresponding to the period, and determining a font according to a size of the target pixel point region and a distribution of the second target pixel point; determining a font size according to the size of the pixel point region of the single character, the character quantity of one line of characters and the font; the step of determining the font according to the size of the target pixel point region and the distribution of the second target pixel point comprises: obtaining a length and a width of the target pixel point region, calculating a length-width ratio, and matching a corresponding first font according to the length-width ratio; obtaining a coordinate position of the second target pixel point and determining a center point coordinate position of the period according to the coordinate position of the second target pixel point; calculating a distance from the center point coordinate position to a preset boundary of the target pixel point region, calculating a distance ratio, and selecting a second font from the first font according to the distance ratio; determining a quantity of all pixel points in a period region according to the coordinate position of the second target pixel point, and calculating a quantity ratio of a quantity of the second target pixel point representing the period to the quantity of all pixel points in the period region; selecting a third font from the second font according to the quantity ratio to determine a final font; the step of matching the target electronic book screenshot in the historical electronic book screenshots according to the size of the current electronic book screenshot and the character information comprises: obtaining the size of the current electronic book screenshot and character information, the character information including at least a text type; determining whether there is a screenshot consistent with the size of the current electronic book screenshot in the historical electronic book screenshots; If it is determined that the screenshot with the same size as the current screenshot exists in the historical screenshots, it is determined whether the text type in the screenshot with the same size as the current screenshot is consistent with the text type in the historical screenshots. If it is determined that the text type in the screenshot with the same size as the current screenshot is consistent with the text type in the historical screenshots, the corresponding screenshot is determined as the target screenshot.

2. The electronic book editing method of claim 1, wherein, The step of locating the character region of the target screenshot and extracting at least two lines of characters in the target screenshot according to the character region comprises: establishing a rectangular coordinate system of the target screenshot and obtaining pixel values of each pixel point in the screenshot; determining coordinate positions of each first target pixel point representing a character according to a preset pixel value range and a pixel value difference of adjacent pixel points; determining polar coordinate points in the horizontal axis direction and the vertical axis direction according to the coordinate positions of each first target pixel point; locating the character region, recognizing and extracting at least two lines of characters in the character region according to the polar coordinate points.

3. The electronic book editing method of claim 2, wherein, The color layout information at least includes character color and background color.

4. An electronic book editing system characterized by comprising: The system for implementing the electronic book editing method according to any one of claims 1-3 comprises: an acquisition module configured to acquire historical screenshots of the user, wherein the historical screenshots at least contain characters arranged in a preset layout format; a matching module configured to match a target screenshot in the historical screenshots according to the size and character information of the current screenshot; a locating module configured to locate a character region of the target screenshot and extract at least two lines of characters in the target screenshot according to the character region; an analysis module configured to analyze the at least two lines of characters extracted from the target screenshot to determine text layout information; a determination module configured to determine color layout information according to the target screenshot; a layout module configured to layout the current electronic book according to the text layout information and the color layout information to obtain a layout result, thereby completing the editing of the electronic book.

5. A computer readable storage medium, characterized in that, comprises: The readable storage medium stores one or more programs, which are executed by the processor to implement the electronic book editing method according to any one of claims 1-3.

6. An electronic device, comprising: The electronic device comprises a memory and a processor, wherein: The memory is configured to store a computer program; The processor is configured to execute the computer program stored in the memory to implement the electronic book editing method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Method and device for generating composing template

    CN104915332A

  • Generative picture translation method and system, electronic equipment and storage medium

    CN117953109A