Standard file imaging processing method and device and storage medium
By imaged the standard files, identifying and adjusting the display properties of the target objects and background areas in the image, the problem of poor display of standard files in PDF or non-edited text formats is solved, and the display output effect and user experience are improved.
Patent Information
- Application Number
- CN202411519973.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-03-14
AI Technical Summary
After converting standard files to PDF format files or non-edited text files, the display effect is poor and it is difficult to meet the user's usage needs.
By converting the standard file into an image and identifying the target object in the image, determining the first area where the target object is located and its associated area and its associated area and its associated area, adjusting the display attributes of the second area and its associated area to make it different from the display attributes of the first area and its associated area.
By blurring the background area, highlighting the display effect of the target object in the standard file, improving the display output effect of the standard file, and improving the user experience.
Smart Images

Figure CN119625124A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to an image processing technology for standard documents, and in particular to an image processing method and device, and a storage medium for standard documents. Background Art
[0002] At present, the processing of standard documents is generally carried out by converting them into PDF format files or non-editable text files to ensure the uniformity and completeness of standard documents. However, after standard documents are converted into PDF format files or non-editable text files, there may be situations where the display effect is poor, which makes it difficult to meet the user's usage needs. Summary of the invention
[0003] The present application provides a method and device for image processing of a standard document, and a storage medium, which can at least solve the aforementioned technical problems.
[0004] According to a first aspect of an embodiment of the present application, a method for image processing of a standard document is provided, comprising:
[0005] Converting a standard file to be processed into an image, or receiving a standard file converted into an image;
[0006] Identify the target object in the image and determine the background area where the target area is located;
[0007] Determine a first area where the target object is located and its associated area, and determine a second area where the background area is located and its associated area; the first area and its associated area do not overlap with the second area and its associated area;
[0008] Adjusting display attributes of the second area and its associated areas to make them different from display attributes of the first area and its associated areas;
[0009] Output the adjusted image.
[0010] As an implementation manner, the determining the first area where the target object is located and its associated areas includes:
[0011] Determining scene display information of the target object;
[0012] Acquiring focus information of the image based on the scene display information;
[0013] Pixel attribute information is determined based on the focus information, and a first area where the target object is located and its associated area are determined according to the correlation of the pixel attribute information.
[0014] As an implementation manner, the determining the second area where the background area is located and its associated area includes:
[0015] A third area is determined for the target object according to the focus information, the third area is larger than the first area and its associated area and does not include other target objects, and an area other than the first area and its associated area in the third area is determined as a background area and its associated area.
[0016] As an implementation manner, adjusting the display attributes of the second area and its associated areas includes:
[0017] determining a blur radius for the second area and its associated areas;
[0018] The pixels of the second area and its associated areas are rendered based on the blur radius so that the pixel brightness of the second area and its associated areas maintains a first ratio with the pixel brightness of the first area and its associated areas, and the pixel contrast of the second area and its associated areas maintains a second ratio with the pixel contrast of the first area and its associated areas.
[0019] As an implementation manner, the determining the scene display information of the image to be processed includes:
[0020] The scene display information of the target object is determined based on the position distribution information of the shooting unit and the focal length information of the shooting unit acquired from the image.
[0021] According to a second aspect of an embodiment of the present application, there is provided an image processing device for a standard document, comprising:
[0022] An image processing unit, used for converting a standard file to be processed into an image, or receiving a standard file converted into an image;
[0023] A recognition unit, which recognizes a target object in the image and determines a background area where the target area is located;
[0024] A determination unit, used to determine a first area and its associated area where the target object is located, and determine a second area and its associated area where the background area is located; the first area and its associated area do not overlap with the second area and its associated area;
[0025] an adjusting unit, configured to adjust display attributes of the second area and its associated areas to make them different from display attributes of the first area and its associated areas;
[0026] The output unit is used to output the adjusted image.
[0027] As an implementation manner, the determining unit is further configured to:
[0028] Determining scene display information of the target object;
[0029] Acquiring focus information of the image based on the scene display information;
[0030] Pixel attribute information is determined based on the focus information, and a first area where the target object is located and its associated area are determined according to the correlation of the pixel attribute information.
[0031] As an implementation manner, the determining unit is further configured to:
[0032] A third area is determined for the target object according to the focus information, the third area is larger than the first area and its associated area and does not include other target objects, and an area other than the first area and its associated area in the third area is determined as a background area and its associated area.
[0033] As an implementation manner, the adjustment unit is further used for:
[0034] determining a blur radius for the second area and its associated areas;
[0035] The pixels of the second area and its associated areas are rendered based on the blur radius so that the pixel brightness of the second area and its associated areas maintains a first ratio with the pixel brightness of the first area and its associated areas, and the pixel contrast of the second area and its associated areas maintains a second ratio with the pixel contrast of the first area and its associated areas.
[0036] As an implementation manner, the determining unit is further configured to:
[0037] The scene display information of the target object is determined based on the position distribution information of the shooting unit and the focal length information of the shooting unit acquired from the image.
[0038] According to a third aspect of an embodiment of the present application, a non-temporary computer-readable storage medium is provided. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the steps of the standard file imaging processing method.
[0039] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0040] In an embodiment of the present application, by identifying the target object in the image of the standard file, and determining the first area where the target object is located and its associated areas, and determining the second area where the background area is located and its associated areas, the second area where the background area is located can be blurred, and by adjusting the display effect of the second area where the background area is located, the display effect of the target object in the standard file is highlighted, thereby improving the display output effect of the standard file and improving the user experience.
[0041] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0043] Figure 1 A schematic diagram of a flow chart of a method for image processing of a standard document shown in an embodiment of the present application;
[0044] Figure 2 A schematic diagram of the structure of a standard document image processing device shown in an embodiment of the present application;
[0045] Figure 3 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0047] Figure 1 The flowchart of a method for processing an image of a standard document shown in the embodiment of the present application is as follows: Figure 1 As shown, the image processing method of the standard file in the embodiment of the present application may include the following processing steps:
[0048] Step 101: convert a standard file to be processed into an image, or receive a standard file converted into an image.
[0049] In the embodiments of the present application, the image to be processed generally refers to an image of a standard file captured by an electronic device. The target object may be text, charts, toolbars, etc. in the standard file, which is not limited in some embodiments of the present application.
[0050] In the embodiments of the present application, the main purpose is to provide a standard management shell component to form a standard full-technical element component interface for standard digital intelligent services, further realizing machine automatic access and interoperability of all standard elements; in order to address the dynamic update problem of standard content and key elements, an information model that conforms to standard interaction is established, the standard content is discretized into the smallest semantic information unit, and the semantic information is further edited and processed, the standard content is converted and mapped into multi-granularity dynamic content, a standard management shell dynamic configuration strategy is established, and a dynamic fusion mechanism between standard data and interface models is formed.
[0051] Step 102: Identify the target object in the image and determine the background area where the target area is located.
[0052] In an embodiment of the present application, text, charts, toolbars, etc. in an image formed by a standard file are identified to determine a processing area. The embodiment of the present application is mainly aimed at when a standard file is uploaded to a server or the like in an image or non-editable format, some specific areas or key areas are likely to be unclear or unclear. For example, a highlighted area in Word is likely to disappear when converted to PDF format, resulting in unclear display content of the area, or, due to abnormal display of the highlight, unclear content corresponding to the area, etc. The embodiment of the present application recognizes the target object to achieve clear display of the entire standard file.
[0053] Step 103, determining a first area where the target object is located and its associated area, and determining a second area where the background area is located and its associated area; the first area and its associated area do not overlap with the second area and its associated area.
[0054] In the embodiment of the present application, determining the first area where the target object is located and its associated area includes: determining the scene display information of the target object; acquiring the focus information of the image based on the scene display information; determining the pixel attribute information based on the focus information, and determining the first area where the target object is located and its associated area according to the correlation of the pixel attribute information. Determining the second area where the background area is located and its associated area includes: determining a third area for the target object according to the focus information, the third area is larger than the first area and its associated area, and does not contain other target objects, and determining the area in the third area other than the first area and its associated area as the background area and its associated area.
[0055] In the embodiment of the present application, the focus information indicates the focus plane when the camera takes an image, especially when taking pictures of documents, inaccurate focus may cause the document to be blurred, have a double image, etc. The embodiment of the present application is aimed at display defects that may be caused during the process of forming an image of a document, which need to be handled separately.
[0056] Determining the scene display information of the image to be processed specifically includes: acquiring position distribution information of a shooting unit and focal length information of the shooting unit based on the image, and determining the scene display information of the target object.
[0057] Step 104: adjust the display attributes of the second area and its associated areas to make them different from the display attributes of the first area and its associated areas.
[0058] Specifically, adjusting the display properties of the second area and its associated areas includes: determining a blur radius for the second area and its associated areas; rendering pixels of the second area and its associated areas based on the blur radius, so that the pixel brightness of the second area and its associated areas maintains a first ratio with the pixel brightness of the first area and its associated areas, and so that the pixel contrast of the second area and its associated areas maintains a second ratio with the pixel contrast of the first area and its associated areas. Specifically, the first ratio may be 1:1 to 1:2, and the second ratio may be 4:5 to 1:2.
[0059] Step 105: output the adjusted image.
[0060] Figure 2 The schematic diagram of the structure of the image processing device for standard files shown in the embodiment of the present application is as follows: Figure 2 As shown, the image processing device of the standard document of the embodiment of the present application includes:
[0061] An image processing unit 20, used to convert a standard file to be processed into an image, or receive a standard file converted into an image;
[0062] The recognition unit 21 recognizes the target object in the image and determines the background area where the target area is located;
[0063] A determination unit 22, configured to determine a first region and its associated region where the target object is located, and determine a second region and its associated region where the background region is located; the first region and its associated region do not overlap with the second region and its associated region;
[0064] An adjusting unit 23, configured to adjust the display attributes of the second area and its associated areas to make them different from the display attributes of the first area and its associated areas;
[0065] The output unit 24 is used to output the adjusted image.
[0066] As an implementation manner, the determining unit 22 is further configured to:
[0067] Determining scene display information of the target object;
[0068] Acquiring focus information of the image based on the scene display information;
[0069] Pixel attribute information is determined based on the focus information, and a first area where the target object is located and its associated area are determined according to the correlation of the pixel attribute information.
[0070] As an implementation manner, the determining unit 22 is further configured to:
[0071] A third area is determined for the target object according to the focus information, the third area is larger than the first area and its associated area and does not include other target objects, and an area other than the first area and its associated area in the third area is determined as a background area and its associated area.
[0072] As an implementation manner, the adjustment unit 23 is further configured to:
[0073] determining a blur radius for the second area and its associated areas;
[0074] The pixels of the second area and its associated areas are rendered based on the blur radius so that the pixel brightness of the second area and its associated areas maintains a first ratio with the pixel brightness of the first area and its associated areas, and the pixel contrast of the second area and its associated areas maintains a second ratio with the pixel contrast of the first area and its associated areas.
[0075] As an implementation manner, the determining unit 22 is further configured to:
[0076] The scene display information of the target object is determined based on the position distribution information of the shooting unit and the focal length information of the shooting unit acquired from the image.
[0077] In an exemplary embodiment, the above-mentioned processing units and the like may be implemented by one or more central processing units (CPU), graphics processing units (GPU), baseband processors (BP), application specific integrated circuits (ASIC), digital signal processors (DSP), programmable logic devices (PLD), complex programmable logic devices (CPLD), field programmable gate arrays (FPGA), general-purpose processors, controllers, microcontrollers (MCU), microprocessors, or other electronic components.
[0078] In the embodiments of the present application, Figure 2 The specific manner in which each unit in the illustrated standard document imaging processing device performs operations has been described in detail in the embodiment of the method, and will not be elaborated on here.
[0079] Figure 3 800 is a block diagram of an electronic device according to an exemplary embodiment. The electronic device 800 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0080] like Figure 3 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0081] Multiple components in the electronic device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0082] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as the image processing method of the standard file. For example, in some embodiments, the image processing method of the standard file may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the image processing method of the standard file described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured as the image processing method of the standard file by any other appropriate means (e.g., by means of firmware).
[0083] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0084] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0085] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0086] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0087] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0088] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0089] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0090] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0091] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for processing standard documents into images, characterized in that: The method comprises: Converting a standard file to be processed into an image, or receiving a standard file converted into an image; Identify the target object in the image and determine the background area where the target area is located; Determine a first area where the target object is located and its associated area, and determine a second area where the background area is located and its associated area; the first area and its associated area do not overlap with the second area and its associated area; Adjusting display attributes of the second area and its associated areas to make them different from display attributes of the first area and its associated areas; Output the adjusted image.
2. The method according to claim 1, characterized in that: The determining the first area where the target object is located and its associated areas includes: Determining scene display information of the target object; Acquiring focus information of the image based on the scene display information; Pixel attribute information is determined based on the focus information, and a first area where the target object is located and its associated area are determined according to the correlation of the pixel attribute information.
3. The method according to claim 2, characterized in that The determining of the second area where the background area is located and its associated area includes: A third area is determined for the target object according to the focus information, the third area is larger than the first area and its associated area and does not include other target objects, and an area other than the first area and its associated area in the third area is determined as a background area and its associated area.
4. The method according to claim 3, characterized in that The adjusting the display attributes of the second area and its associated areas includes: determining a blur radius for the second area and its associated areas; The pixels of the second area and its associated areas are rendered based on the blur radius so that the pixel brightness of the second area and its associated areas maintains a first ratio with the pixel brightness of the first area and its associated areas, and the pixel contrast of the second area and its associated areas maintains a second ratio with the pixel contrast of the first area and its associated areas.
5. The method according to claim 2, characterized in that: The determining of the scene display information of the image to be processed includes: The scene display information of the target object is determined based on the position distribution information of the shooting unit and the focal length information of the shooting unit acquired from the image.
6. A standard document image processing device, characterized in that: The device comprises: An image processing unit, used for converting a standard file to be processed into an image, or receiving a standard file converted into an image; A recognition unit, which recognizes a target object in the image and determines a background area where the target area is located; A determination unit, used to determine a first area and its associated area where the target object is located, and determine a second area and its associated area where the background area is located; the first area and its associated area do not overlap with the second area and its associated area; an adjusting unit, configured to adjust display attributes of the second area and its associated areas to make them different from display attributes of the first area and its associated areas; The output unit is used to output the adjusted image.
7. The device according to claim 6, characterized in that The determining unit is further configured to: Determining scene display information of the target object; Acquiring focus information of the image based on the scene display information; Pixel attribute information is determined based on the focus information, and a first area where the target object is located and its associated area are determined according to the correlation of the pixel attribute information.
8. The device according to claim 7, characterized in that The determining unit is further configured to: A third area is determined for the target object according to the focus information, the third area is larger than the first area and its associated area and does not include other target objects, and an area other than the first area and its associated area in the third area is determined as a background area and its associated area.
9. The device according to claim 8, characterized in that The adjustment unit is further used for: determining a blur radius for the second area and its associated areas; The pixels of the second area and its associated areas are rendered based on the blur radius so that the pixel brightness of the second area and its associated areas maintains a first ratio with the pixel brightness of the first area and its associated areas, and the pixel contrast of the second area and its associated areas maintains a second ratio with the pixel contrast of the first area and its associated areas.
10. The device according to claim 7, characterized in that The determining unit is further configured to: The scene display information of the target object is determined based on the position distribution information of the shooting unit and the focal length information of the shooting unit acquired from the image.
11. A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the steps of the image processing method of a standard document as claimed in any one of claims 1 to 5.