CN111339738A - Method and device for displaying file comprising multicolor picture and computer equipment - Google Patents

Method and device for displaying file comprising multicolor picture and computer equipment Download PDF

Info

Publication number
CN111339738A
CN111339738A CN202010125466.XA CN202010125466A CN111339738A CN 111339738 A CN111339738 A CN 111339738A CN 202010125466 A CN202010125466 A CN 202010125466A CN 111339738 A CN111339738 A CN 111339738A
Authority
CN
China
Prior art keywords
picture
multicolor
color
blocks
designated
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
CN202010125466.XA
Other languages
Chinese (zh)
Other versions
CN111339738B (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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202010125466.XA priority Critical patent/CN111339738B/en
Publication of CN111339738A publication Critical patent/CN111339738A/en
Application granted granted Critical
Publication of CN111339738B publication Critical patent/CN111339738B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses a method, a device, a computer device and a storage medium for displaying a file comprising a multicolor picture, wherein the method comprises the following steps: acquiring a specified file; acquiring the first multicolor picture; selecting a second multicolor picture, and calculating the similarity degree value of the first multicolor picture and the second multicolor picture; if the similarity degree value is not greater than the similarity degree threshold value, performing picture segmentation processing on the first multicolor picture; generating n single-color sub-pictures; deleting the designated link in the designated file, and filling a vacancy left after deletion in a mode of overlapping the n monochromatic sub-pictures, wherein the n monochromatic sub-pictures are set to be displayed simultaneously; and displaying the specified file. Therefore, the defect that the traditional technology can not display multicolor pictures in files only capable of displaying monochromatic pictures is overcome.

Description

Method and device for displaying file comprising multicolor picture and computer equipment
Technical Field
The present application relates to the field of computers, and in particular, to a method and an apparatus for displaying a document including a multicolor picture, a computer device, and a storage medium.
Background
Due to some special requirements and designs (e.g., to save computational resources), some files are configured to display only monochrome pictures, and some development process files are configured to display only monochrome pictures (e.g., word stock pictures). Taking a word stock picture as an example, a word stock (ttf, woff, eto, etc.) is an electronic word font collection library of foreign language fonts, Chinese fonts and related characters, and is widely used in computers, networks and related electronic products. When a common character can not satisfy the actual page effect display, the common character is usually realized in the form of a picture, but the use of the picture often causes greater traffic consumption and non-editability (particularly inconvenient when the theme is switched). At the moment, a word stock file (word associated picture, still using words during development and automatically rendering as pictures during display) form is a good choice. However, the word stock file can only make a single character color, that is, only one color can be set for one character picture. The conventional art cannot meet the need to present a multicolor picture in a file set to display only a monochrome picture.
Disclosure of Invention
The present application mainly aims to provide a method and an apparatus for displaying a document including a multicolor picture, a computer device, and a storage medium, and aims to overcome the defect that the conventional technology cannot display a multicolor picture in a document only capable of displaying a monochromatic picture.
In order to achieve the above object, the present application provides a method for displaying a document including a multicolor picture, comprising the steps of:
acquiring a designated file, wherein the designated file comprises a designated link, the designated link is linked to a first multicolor picture, and the designated file can only display a monochromatic picture;
acquiring the first multicolor picture through the designated link;
selecting a second multicolor picture from a preset standard multicolor picture library according to a preset picture screening method, wherein the second multicolor picture is associated with a designated multicolor display scheme, and the designated multicolor display scheme refers to a scheme of overlapping and simultaneously displaying a plurality of pre-stored designated single-color pictures;
calculating the similarity degree values of the first multicolor picture and the second multicolor picture, and judging whether the similarity degree values are larger than a preset similarity degree threshold value or not;
if the similarity degree value is not greater than a preset similarity degree threshold value, performing picture segmentation processing on the first multicolor picture to obtain the shapes of n single-color blocks and the positions of the single-color blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2;
generating n single-color sub-pictures according to a preset sub-picture generation method, wherein the sizes of all the single-color sub-pictures are the same as the size of the first multicolor picture, the color of the kth single-color sub-picture is the same as the color of the kth single-color block, the shape and the position of a coloring area of the kth single-color sub-picture are the same as the shape and the position of the kth single-color block, and k is an integer greater than 0 and less than or equal to n;
deleting the designated link in the designated file, and filling a vacancy left after deletion in a mode of overlapping the n monochromatic sub-pictures, wherein the n monochromatic sub-pictures are set to be displayed simultaneously;
and displaying the specified file.
Further, the step of selecting a second multicolor picture from a preset standard multicolor picture library according to a preset picture screening method includes:
acquiring the types of all colors of the first multicolor picture, and judging whether a first intermediate picture exists in a preset standard multicolor picture library, wherein the types of all colors of the first intermediate picture are the same as the types of all colors of the first multicolor picture;
if a first intermediate picture does not exist in a preset standard multicolor picture library, judging whether a second intermediate picture exists in the standard multicolor picture library, wherein the types of colors displayed by all colors of the second intermediate picture after being superposed through specified colors are the same as the types of all colors of the first multicolor picture;
and if a second intermediate picture exists in the standard multicolor picture library, acquiring the second intermediate picture, performing superposition processing on all coloring areas in the second intermediate picture by adopting specified colors, and recording the superposed second intermediate picture as a second multicolor picture.
Further, the first multicolor picture and the second multicolor picture are both rectangular pictures, and the step of calculating the similarity value of the first multicolor picture and the second multicolor picture comprises:
acquiring a plurality of first boundary lines between different color regions in the first multicolor picture and acquiring a plurality of second boundary lines between different color regions in the second multicolor picture;
acquiring a first total length of the first interface lines and acquiring a second total length of the second interface lines;
according to the formula: and calculating the similarity value of the first multicolor picture and the second multicolor picture according to the similarity value of 1/| the first total length-the second total length |.
Further, the step of calculating a similarity value of the first polychrome picture and the second polychrome picture comprises:
acquiring areas R1, R2, and R m occupied by various colors in the first multicolor picture, and acquiring areas H1, H2, and H in the second multicolor picture, wherein the first multicolor picture and the second multicolor picture are formed by m colors;
acquiring a total area R0 of the first multicolor picture, acquiring a total area H0 of the second multicolor picture, and generating a matrix [ min (R1/R0, H1/H0), min (R2/R0, H2/H0),.. the same, min (Rm/R0, Hm/H0) ] and a matrix [1/max (R1/R0, H1/H0) ], 1/max (R2/R0, H2/H0),. the same, 1/max (Rm/R0, Hm/H0) ];
according to the formula:
similarity degree value | | [ min (R1/R0, H1/H0), min (R2/R0, H2/H0),.. so, min (Rm/R0, Hm/H0)][1/max(R1/R0,H1/H0),1/max(R2/R0,H2/H0),...,1/max(Rm/R0,Hm/H0)]TAnd | l, calculating to obtain the similarity degree value of the first multicolor picture and the second multicolor picture.
Further, after the step of calculating the similarity value between the first multicolor picture and the second multicolor picture and determining whether the similarity value is greater than a preset similarity threshold, the method includes:
if the similarity degree value is larger than a preset similarity degree threshold value, acquiring the designated multi-color display scheme, wherein the designated multi-color display scheme refers to a scheme of overlapping and simultaneously displaying a plurality of pre-stored designated single-color pictures;
deleting the designated link in the designated file, and filling a vacancy left after deletion in a mode of overlapping the designated single-color pictures, wherein the designated single-color pictures are set to be displayed simultaneously;
and displaying the specified file.
Further, the step of performing picture segmentation processing on the first multicolor picture to obtain the shapes of n single-color blocks and the positions of the single-color blocks in the first multicolor picture, where n is an integer greater than or equal to 2, includes:
performing a first grid splitting process on the first polychrome picture, thereby splitting the first polychrome picture into a plurality of first squares, and dividing the plurality of first squares into first single-color squares and first polychrome squares;
performing second grid segmentation processing on the first multi-color square blocks to obtain a plurality of second square blocks, wherein the area of the second square blocks is smaller than that of the first square blocks, dividing the plurality of second square blocks into second single-color square blocks and second multi-color square blocks, and setting the second multi-color square blocks to be transparent;
and combining adjacent homochromatic squares to obtain n monochromatic blocks, and acquiring the shapes of the n monochromatic blocks and the positions of the monochromatic blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2.
Further, the first multicolor picture is a chinese character picture, and the step of performing picture segmentation processing on the first multicolor picture to obtain the shapes of n single-color blocks and the positions of the single-color blocks in the first multicolor picture, where n is an integer greater than or equal to 2, includes:
segmenting the first multicolor picture by adopting a preset stroke segmentation method to obtain a plurality of stroke blocks, wherein the shapes of the stroke blocks at least comprise one of horizontal, vertical, left-falling, dot and compromise;
judging whether the plurality of stroke blocks are all monochrome or not;
if the stroke blocks are all monochrome, combining the adjacent stroke blocks with the same color to obtain n monochrome blocks, and acquiring the shapes of the n monochrome blocks and the positions of the monochrome blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2.
The present application provides a display device for documents including multicoloured pictures, comprising:
a designated file acquisition unit, configured to acquire a designated file, where the designated file includes a designated link, the designated link is linked to a first multicolor picture, and the designated file can only display a monochrome picture;
the first multicolor picture acquisition unit is used for acquiring the first multicolor picture through the designated link;
a second multicolor picture obtaining unit, configured to select a second multicolor picture from a preset standard multicolor picture library according to a preset picture screening method, where the second multicolor picture is associated with a specified multicolor display scheme, and the specified multicolor display scheme is a scheme in which a plurality of pre-stored specified monochromatic pictures are superimposed and displayed simultaneously;
the similarity degree value calculating unit is used for calculating the similarity degree values of the first multicolor picture and the second multicolor picture and judging whether the similarity degree values are larger than a preset similarity degree threshold value or not;
the segmentation processing unit is used for carrying out picture segmentation processing on the first multicolor picture if the similarity degree value is not greater than a preset similarity degree threshold value, so as to obtain the shapes of n single-color blocks and the positions of the single-color blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2;
a monochrome sub-picture generating unit, configured to generate n monochrome sub-pictures according to a preset sub-picture generating method, where the size of all the monochrome sub-pictures is the same as the size of the first multi-color picture, the color of the kth monochrome sub-picture is the same as the color of the kth monochrome block, the shape and position of the coloring region of the kth monochrome sub-picture are the same as the shape and position of the kth monochrome block, and k is an integer greater than 0 and less than or equal to n;
the monochrome sub-picture padding unit is used for deleting the designated link in the designated file and padding a vacancy left after deletion in a mode of overlapping the n monochrome sub-pictures, wherein the n monochrome sub-pictures are set to be displayed simultaneously;
and the file display unit is used for displaying the specified file.
The present application provides a computer device comprising a memory storing a computer program and a processor implementing the steps of any of the above methods when the processor executes the computer program.
The present application provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of any of the above.
The method and the device for displaying the file comprising the multicolor picture, the computer equipment and the storage medium obtain the specified file; acquiring the first multicolor picture; selecting a second multicolor picture from a preset standard multicolor picture library, and calculating the similarity degree value of the first multicolor picture and the second multicolor picture; if the similarity degree value is not greater than a preset similarity degree threshold value, performing picture segmentation processing on the first multi-color picture; generating n single-color sub-pictures, wherein the size of all the single-color sub-pictures is the same as that of the first multi-color picture, the color of the kth single-color sub-picture is the same as that of the kth single-color block, and the shape and the position of a coloring area of the kth single-color sub-picture are the same as those of the kth single-color block; deleting the designated link in the designated file, and filling a vacancy left after deletion in a mode of overlapping the n monochromatic sub-pictures, wherein the n monochromatic sub-pictures are set to be displayed simultaneously; and displaying the specified file. Therefore, the defect that the traditional technology can not display multicolor pictures in files only capable of displaying monochromatic pictures is overcome.
Drawings
FIG. 1 is a schematic flow chart illustrating a method for displaying a document including a multicolor picture according to an embodiment of the present application;
FIG. 2 is a block diagram of a schematic structure of a presentation device for a document including a multi-color picture according to an embodiment of the present application;
fig. 3 is a block diagram illustrating a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, an embodiment of the present application provides a method for displaying a document including a multicolor picture, including the following steps:
s1, acquiring a designated file, wherein the designated file comprises a designated link, the designated link is linked to the first multicolor picture, and the designated file can only display a single-color picture;
s2, acquiring the first multicolor picture through the designated link;
s3, selecting a second multicolor picture from a preset standard multicolor picture library according to a preset picture screening method, wherein the second multicolor picture is associated with a designated multicolor display scheme, and the designated multicolor display scheme refers to a scheme of overlapping and simultaneously displaying a plurality of pre-stored designated single-color pictures;
s4, calculating the similarity degree value of the first multicolor picture and the second multicolor picture, and judging whether the similarity degree value is larger than a preset similarity degree threshold value;
s5, if the similarity value is not larger than a preset similarity threshold value, performing picture segmentation processing on the first multicolor picture to obtain the shapes of n single-color blocks and the positions of the single-color blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2;
s6, generating n single-color sub-pictures according to a preset sub-picture generation method, wherein the size of all single-color sub-pictures is the same as that of the first multicolor picture, the color of the kth single-color sub-picture is the same as that of the kth single-color block, the shape and the position of a coloring area of the kth single-color sub-picture are the same as those of the kth single-color block, and k is an integer greater than 0 and less than or equal to n;
s7, deleting the designated link in the designated file, and filling a vacancy left after deletion in a mode of overlapping the n monochromatic sub-pictures, wherein the n monochromatic sub-pictures are set to be displayed simultaneously;
and S8, displaying the specified file.
As described in the above step S1, a specific file is obtained, wherein the specific file includes a specific link, the specific link is linked to the first multicolor picture, and the specific file can only display a monochrome picture. Since the given document can only display a monochrome picture, the conventional method cannot display the first multicolor picture, and the present application aims to solve such a technical problem. The monochrome picture refers to a picture formed by one color, and a transparent area is arranged outside an area covered by the color. The multicolor picture refers to a picture composed of a plurality of colors.
As described in the above step S2, the first multicolor picture is acquired through the designated link. Since the designated document cannot show the multicolor pictures, the first multicolor picture is linked to the designated document in a designated linking manner. The first multicolor picture is a picture to be displayed, so that the display effect finally realized by the application can be the same as that of the first multicolor picture.
As described in the above step S3, according to the preset picture screening method, a second multicolor picture is selected from the preset standard multicolor picture library, wherein the second multicolor picture is associated with a designated multicolor display scheme, and the designated multicolor display scheme refers to a scheme of overlapping and simultaneously displaying a plurality of pre-stored designated single-color pictures. The standard multicolor pictures are pre-stored in the standard multicolor picture library and respectively correspond to different color display schemes, and if the first multicolor picture is the same as or similar to the second multicolor picture, the corresponding color display scheme is directly adopted to display the file. The preset picture screening method includes, for example: acquiring the types of all colors of the first multicolor picture, and judging whether a first intermediate picture exists in a preset standard multicolor picture library, wherein the types of all colors of the first intermediate picture are the same as the types of all colors of the first multicolor picture; if a first intermediate picture does not exist in a preset standard multicolor picture library, judging whether a second intermediate picture exists in the standard multicolor picture library, wherein the types of colors displayed by all colors of the second intermediate picture after being superposed through specified colors are the same as the types of all colors of the first multicolor picture; and if a second intermediate picture exists in the standard multicolor picture library, acquiring the second intermediate picture and recording as a second multicolor picture.
As described in step S4, the similarity value between the first multicolor picture and the second multicolor picture is calculated, and whether the similarity value is greater than a preset similarity threshold is determined. The similarity value is used to measure whether the first multicoloured picture and the second multicoloured picture are identical. The way of calculating the similarity value of the first multi-color picture and the second multi-color picture is, for example: acquiring a plurality of first boundary lines between different color regions in the first multicolor picture and acquiring a plurality of second boundary lines between different color regions in the second multicolor picture; acquiring a first total length of the first interface lines and acquiring a second total length of the second interface lines; according to the formula: and calculating the similarity value of the first multicolor picture and the second multicolor picture according to the similarity value of 1/| the first total length-the second total length |.
As described in step S5, if the similarity value is not greater than the preset similarity threshold, performing picture segmentation on the first multicolor picture to obtain the shapes of n single-color blocks and the positions of the single-color blocks in the first multicolor picture, where n is an integer greater than or equal to 2. If the similarity value is not greater than the preset similarity threshold, it indicates that no existing color display scheme exists, and therefore, an appropriate color display scheme needs to be generated immediately. The mode of performing picture segmentation processing on the first multi-color picture is, for example: performing a first grid splitting process on the first polychrome picture, thereby splitting the first polychrome picture into a plurality of first squares, and dividing the plurality of first squares into first single-color squares and first polychrome squares; performing second grid segmentation processing on the first multi-color square blocks to obtain a plurality of second square blocks, wherein the area of the second square blocks is smaller than that of the first square blocks, dividing the plurality of second square blocks into second single-color square blocks and second multi-color square blocks, and setting the second multi-color square blocks to be transparent; and combining adjacent homochromatic squares to obtain n monochromatic blocks, and acquiring the shapes of the n monochromatic blocks and the positions of the monochromatic blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2.
As described in step S6 above, according to the preset sub-picture generation method, n single-color sub-pictures are generated, where all the single-color sub-pictures have the same size as the first multi-color picture, the color of the kth single-color sub-picture is the same as the color of the kth single-color block, the shape and position of the coloring region of the kth single-color sub-picture are the same as the shape and position of the kth single-color block, and k is an integer greater than 0 and less than or equal to n. Although the designated file cannot show multicolor pictures, the designated file can show a plurality of single-color pictures, and the single-color pictures are displayed in an overlapping mode, so that the multicolor display is realized in terms of visual effect. Hereby, n monochromatic sub-pictures are generated, wherein all monochromatic sub-pictures have the same size as the first polychrome picture, the color of the kth monochromatic sub-picture is the same as the color of the kth monochromatic block, and the shape and position of the colored area of the kth monochromatic sub-picture is the same as the shape and position of the kth monochromatic block.
As described in the above step S7, the designated link is deleted from the designated file, and the empty space left after deletion is filled up by superimposing the n monochrome sub-pictures, where the n monochrome sub-pictures are set to be displayed simultaneously. And deleting the appointed link and filling a vacant position left after deletion in a mode of overlapping the n monochromatic sub-pictures because the proper n monochromatic sub-pictures are obtained, so that when the appointed file is displayed, the n monochromatic sub-pictures are displayed simultaneously, and the multi-color display is realized.
As described in the above step S8, the specified file is presented. And deleting the designated link and filling up the vacant positions left after deletion by overlapping the n single-color sub-pictures to obtain the designated file, wherein the display effect is the same as the display effect of the first multi-color picture, so that the multi-color display is completed on the basis of not changing the file architecture.
In one embodiment, the step S3 of selecting the second multi-color picture from the predetermined standard multi-color picture library according to the predetermined picture screening method includes:
s301, acquiring the types of all colors of the first multicolor picture, and judging whether a first intermediate picture exists in a preset standard multicolor picture library, wherein the types of all colors of the first intermediate picture are the same as the types of all colors of the first multicolor picture;
s302, if a first intermediate picture does not exist in a preset standard multicolor picture library, judging whether a second intermediate picture exists in the standard multicolor picture library, wherein the types of colors displayed by all colors of the second intermediate picture after being superposed through specified colors are the same as the types of all colors of the first multicolor picture;
and S303, if a second intermediate picture exists in the standard multicolor picture library, acquiring the second intermediate picture, performing superposition processing on all coloring areas in the second intermediate picture by adopting specified colors, and recording the superposed second intermediate picture as a second multicolor picture.
As described above, selection of a second multi-color picture from a pre-set library of standard multi-color pictures is achieved. The second multicolor picture is associated with a designated multicolor display scheme, which refers to a scheme of overlapping and simultaneously displaying a plurality of pre-stored single-color pictures, so that if it can be determined that the second multicolor picture is similar to or the same as the first multicolor picture, the designated multicolor display scheme is adopted. In order to find out the second multicolor picture which is the most similar, the method comprises the steps of obtaining all color types of the first multicolor picture, and judging whether a first intermediate picture exists in a preset standard multicolor picture library, wherein all color types of the first intermediate picture are the same as all color types of the first multicolor picture; if the first intermediate picture does not exist in the preset standard multicolor picture library, judging whether a second intermediate picture exists in the standard multicolor picture library, wherein the types of the colors displayed by the superposition of all the colors of the second intermediate picture through the same color are the same as the types of all the colors of the first multicolor picture; and if a second intermediate picture exists in the standard multicolor picture library, acquiring the second intermediate picture, performing superposition processing on all coloring areas in the second intermediate picture by adopting specified colors, and marking the superposed second intermediate picture as a second multicolor picture so as to enable the preliminarily screened second multicolor picture to be similar to the first multicolor picture as much as possible.
In one embodiment, the first multicolor picture and the second multicolor picture are both rectangular pictures, and the step S4 of calculating the similarity value of the first multicolor picture and the second multicolor picture comprises:
s401, acquiring a plurality of first boundary lines among different color regions in the first multicolor picture, and acquiring a plurality of second boundary lines among different color regions in the second multicolor picture;
s402, acquiring a first total length of the first boundary lines and a second total length of the second boundary lines;
s403, according to the formula: and calculating the similarity value of the first multicolor picture and the second multicolor picture according to the similarity value of 1/| the first total length-the second total length |.
As described above, calculating a similarity value of the first polychrome picture and the second polychrome picture is achieved. The total length of the boundary line is used as a calculation basis of the similarity degree value. Specifically, a first total length of the first boundary lines and a second total length of the second boundary lines are obtained, and according to a formula: and calculating the similarity value of the first multicolor picture and the second multicolor picture according to the similarity value of 1/| the first total length-the second total length |. Generally, only the total lengths of the boundary lines of similar pictures are substantially the same. If the first total length and the second total length are approximately equal, the similarity degree value is approximately infinite, which indicates that the first multicolor picture and the second multicolor picture are similar.
In one embodiment, the step S4 of calculating the similarity value of the first multicolor picture and the second multicolor picture comprises:
s411, acquiring occupied areas R1, R2,. and Rm of various colors in the first multicolor picture, and acquiring occupied areas H1, H2,. and Hm of various colors in the second multicolor picture, wherein the first multicolor picture and the second multicolor picture are formed by m colors;
s412, acquiring a total area R0 of the first multicolor picture, acquiring a total area H0 of the second multicolor picture, and generating a matrix [ min (R1/R0, H1/H0), min (R2/R0, H2/H0),...,. min (Rm/R0, Hm/H0) ] and a matrix [1/max (R1/R0, H1/H0) ], 1/max (R2/R0, H2/H0),. 1/max (Rm/R0, Hm/H0) ];
s413, according to a formula:
similarity degree value | | [ min (R1/R0, H1/H0), min (R2/R0, H2/H0),.. so, min (Rm/R0, Hm/H0)][1/max(R1/R0,H1/H0),1/max(R2/R0,H2/H0),...,1/max(Rm/R0,Hm/H0)]TAnd | l, calculating to obtain the similarity degree value of the first multicolor picture and the second multicolor picture.
As described above, calculating a similarity value of the first polychrome picture and the second polychrome picture is achieved. The application is based on the formula: similarity degree value ═ l | [ min (R1/R0, H1/H0), min (R2/R0, H2/H0),...,min(Rm/R0,Hm/H0)][1/max(R1/R0,H1/H0),1/max(R2/R0,H2/H0),...,1/max(Rm/R0,Hm/H0)]TAnd | l, calculating to obtain the similarity degree value of the first multicolor picture and the second multicolor picture. Wherein the maximum value of the similarity value is 1, and the closer the similarity value is to 1, the more similar the first multicolor picture and the second multicolor picture are.
In one embodiment, after the step S4 of calculating the similarity value between the first multicolor picture and the second multicolor picture, and determining whether the similarity value is greater than a preset similarity threshold, the method includes:
s41, if the similarity value is larger than a preset similarity threshold value, acquiring the designated multi-color display scheme, wherein the designated multi-color display scheme is a scheme of overlapping and simultaneously displaying a plurality of pre-stored designated single-color pictures;
s42, deleting the designated link in the designated file, and filling the vacancy left after deletion in a mode of overlapping the designated monochromatic pictures, wherein the designated monochromatic pictures are set to be displayed simultaneously;
and S43, displaying the specified file.
As described above, the effects of displaying the specified file and achieving multi-color display are achieved. If the similarity degree value is larger than a preset similarity degree threshold value, it is indicated that the color display effect to be achieved by the first multicolor picture is a ready-made scheme, and therefore, a designated multicolor display scheme is adopted. According to the method, the appointed link is deleted in the appointed file, and the vacancy left after deletion is filled in a mode of overlapping the appointed single-color pictures, wherein the appointed single-color pictures are set to be displayed at the same time; and displaying the specified file so as to achieve the same multi-color display effect as the display of the first multi-color picture.
In one embodiment, the step S5 of performing a picture slicing process on the first polychrome picture to obtain the shapes of n monochrome blocks and the positions of the monochrome blocks in the first polychrome picture, where n is an integer greater than or equal to 2, includes:
s501, performing first grid segmentation processing on the first multicolor picture, thereby segmenting the first multicolor picture into a plurality of first square blocks, and dividing the plurality of first square blocks into a first single-color square block and a first multicolor square block;
s502, carrying out second grid segmentation processing on the first multi-color square block to obtain a plurality of second square blocks, wherein the area of the second square blocks is smaller than that of the first square blocks, dividing the plurality of second square blocks into a second single-color square block and a second multi-color square block, and setting the second multi-color square block to be transparent;
s503, combining the adjacent homochromatic blocks to obtain n monochromatic blocks, and acquiring the shapes of the n monochromatic blocks and the positions of the monochromatic blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2.
As described above, a picture slicing process of the first polychrome picture is implemented, resulting in the shapes of the n monochrome blocks and the positions of the monochrome blocks in the first polychrome picture. The grid segmentation processing refers to that the picture is gridded and then is cut according to the network lines of the grid, so that squares with the same size as the grid are obtained. The first grid is cut to select the first multi-colored square, the second grid is cut to further select the second multi-colored square. Since the second multi-color block is selected twice, the size of the second multi-color block is small and can be ignored in visual effect, so that the second multi-color block is set to be transparent and does not affect the macroscopic multi-color display effect (or the effect can be ignored). And then combining adjacent homochromatic blocks to obtain n monochromatic blocks, and acquiring the shapes of the n monochromatic blocks and the positions of the monochromatic blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2, so as to divide the first multicolor picture into a plurality of monochromatic blocks. Further, the area of the second square is smaller than that of the first square, and preferably the area of the second square is smaller than 1% of that of the first square, so that the influence of the second multicolor square on pattern display after being set to be transparent is reduced.
In one embodiment, the step S5 of performing picture segmentation on the first polychrome picture to obtain the shapes of n single-color blocks and the positions of the single-color blocks in the first polychrome picture, where n is an integer greater than or equal to 2, includes:
s511, a preset stroke segmentation method is adopted to segment the first multicolor picture, so that a plurality of stroke blocks are obtained, wherein the shape of each stroke block at least comprises one of horizontal, vertical, left-falling, dot and compromise;
s512, judging whether the plurality of stroke blocks are all monochrome;
s513, if the plurality of stroke blocks are all monochrome, merging the adjacent stroke blocks with the same color to obtain n monochrome blocks, and acquiring the shapes of the n monochrome blocks and the positions of the monochrome blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2.
As described above, a picture slicing process of the first polychrome picture is implemented, resulting in the shapes of the n monochrome blocks and the positions of the monochrome blocks in the first polychrome picture. Wherein the first multi-color picture is a Chinese character picture. For the Chinese character picture, it is composed of five basic strokes of horizontal, vertical, left-falling, dot and turning, so that these five basic strokes are generally presented in a single color. And segmenting the first multicolor picture by adopting a preset stroke segmentation method to obtain a plurality of stroke blocks, wherein the shapes of the stroke blocks at least comprise one of horizontal, vertical, left-falling, dot and compromise. In order to prevent the multi-color strokes from occurring, judging whether the stroke blocks are all single-color; if the stroke blocks are all monochrome, combining the adjacent stroke blocks with the same color to obtain n monochrome blocks, and acquiring the shapes of the n monochrome blocks and the positions of the monochrome blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2. Therefore, the Chinese character picture is quickly divided into the single-color blocks.
According to the display method of the file comprising the multicolor picture, the designated file is obtained; acquiring the first multicolor picture; selecting a second multicolor picture from a preset standard multicolor picture library, and calculating the similarity degree value of the first multicolor picture and the second multicolor picture; if the similarity degree value is not greater than a preset similarity degree threshold value, performing picture segmentation processing on the first multi-color picture; generating n single-color sub-pictures, wherein the size of all the single-color sub-pictures is the same as that of the first multi-color picture, the color of the kth single-color sub-picture is the same as that of the kth single-color block, and the shape and the position of a coloring area of the kth single-color sub-picture are the same as those of the kth single-color block; deleting the designated link in the designated file, and filling a vacancy left after deletion in a mode of overlapping the n monochromatic sub-pictures, wherein the n monochromatic sub-pictures are set to be displayed simultaneously; and displaying the specified file. Therefore, the defect that the traditional technology can not display multicolor pictures in files only capable of displaying monochromatic pictures is overcome.
Referring to fig. 2, an embodiment of the present application provides a display device for a document including a multicolor picture, including:
a designated file acquisition unit 10 configured to acquire a designated file, wherein the designated file includes a designated link, the designated link is linked to the first multicolor picture, and the designated file can only display a monochrome picture;
a first multicolor picture acquisition unit 20, configured to acquire the first multicolor picture through the designated link;
a second multicolor picture obtaining unit 30, configured to select a second multicolor picture from a preset standard multicolor picture library according to a preset picture screening method, where the second multicolor picture is associated with a specified multicolor display scheme, and the specified multicolor display scheme refers to a scheme in which a plurality of pre-stored specified monochromatic pictures are superimposed and displayed simultaneously;
a similarity degree value calculating unit 40, configured to calculate a similarity degree value of the first multi-color picture and the second multi-color picture, and determine whether the similarity degree value is greater than a preset similarity degree threshold;
a segmentation processing unit 50, configured to perform picture segmentation processing on the first multicolor picture if the similarity degree value is not greater than a preset similarity degree threshold, so as to obtain shapes of n monochromatic blocks and positions of the monochromatic blocks in the first multicolor picture, where n is an integer greater than or equal to 2;
a monochrome sub-picture generating unit 60, configured to generate n monochrome sub-pictures according to a preset sub-picture generating method, where the size of all the monochrome sub-pictures is the same as the size of the first multi-color picture, the color of the kth monochrome sub-picture is the same as the color of the kth monochrome block, the shape and position of the color region of the kth monochrome sub-picture are the same as the shape and position of the kth monochrome block, and k is an integer greater than 0 and less than or equal to n;
a monochrome sub-picture padding unit 70, configured to delete the designated link in the designated file, and pad a vacancy left after deletion by superimposing the n monochrome sub-pictures, where the n monochrome sub-pictures are set to be displayed at the same time;
a file display unit 80, configured to display the specified file.
The operations performed by the units are respectively corresponding to the steps of the method for displaying a file including a multicolor picture in the foregoing embodiment one by one, and are not described herein again.
In one embodiment, the second multi-color picture acquisition unit 30 comprises:
a first intermediate picture determining subunit, configured to obtain types of all colors of the first multicolor picture, and determine whether a first intermediate picture exists in a preset standard multicolor picture library, where the types of all colors of the first intermediate picture are the same as the types of all colors of the first multicolor picture;
a second intermediate picture judging subunit, configured to judge whether a second intermediate picture exists in a preset standard multicolor picture library if a first intermediate picture does not exist in the standard multicolor picture library, where a color type of all colors of the second intermediate picture after being superimposed by a specified color is the same as a color type of all colors of the first multicolor picture;
and the second multicolor picture marking subunit is used for acquiring a second intermediate picture if the second intermediate picture exists in the standard multicolor picture library, performing superposition processing on all coloring areas in the second intermediate picture by adopting specified colors, and marking the superposed second intermediate picture as a second multicolor picture.
The operations respectively performed by the units or the sub-units correspond to the steps of the method for displaying a file including a multicolor picture in the foregoing embodiment one by one, and are not described herein again.
In one embodiment, the first multicolor picture and the second multicolor picture are both rectangular pictures, and the similarity degree value calculating unit 40 includes:
a boundary line acquiring subunit, configured to acquire a plurality of first boundary lines between different color regions in the first multicolor picture, and acquire a plurality of second boundary lines between different color regions in the second multicolor picture;
a total length acquiring subunit, configured to acquire a first total length of the first interface lines and a second total length of the second interface lines;
a similarity degree value operator unit for calculating, according to the formula: and calculating the similarity value of the first multicolor picture and the second multicolor picture according to the similarity value of 1/| the first total length-the second total length |.
The operations respectively performed by the units or the sub-units correspond to the steps of the method for displaying a file including a multicolor picture in the foregoing embodiment one by one, and are not described herein again.
In one embodiment, the similarity degree value calculating unit 40 includes:
an area obtaining subunit, configured to obtain areas R1, R2,. and Rm occupied by each color in the first multicolor picture, and obtain areas H1, H2,. and Hm occupied by each color in the second multicolor picture, where the first multicolor picture and the second multicolor picture are both formed by m colors;
a matrix generation subunit, configured to obtain a total area R0 of the first multi-color picture, obtain a total area H0 of the second multi-color picture, and generate a matrix [ min (R1/R0, H1/H0), min (R2/R0, H2/H0),.. farad.,. min (Rm/R0, Hm/H0) ] and a matrix [1/max (R1/R0, H1/H0) ], 1/max (R2/R0, H2/H0),. farad.,. 1/max (Rm/R0, Hm/H0) ];
a similarity calculation subunit for, according to the formula:
similarity degree value | | [ min (R1/R0, H1/H0), min (R2/R0, H2/H0),.. so, min (Rm/R0, Hm/H0)][1/max(R1/R0,H1/H0),1/max(R2/R0,H2/H0),...,1/max(Rm/R0,Hm/H0)]TAnd | l, calculating to obtain the similarity degree value of the first multicolor picture and the second multicolor picture.
The operations respectively performed by the units or the sub-units correspond to the steps of the method for displaying a file including a multicolor picture in the foregoing embodiment one by one, and are not described herein again.
In one embodiment, the apparatus comprises:
a multi-color display scheme obtaining unit, configured to obtain the designated multi-color display scheme if the similarity degree value is greater than a preset similarity degree threshold value, where the designated multi-color display scheme is a scheme in which a plurality of pre-stored designated monochrome pictures are superimposed and displayed simultaneously;
the superposition filling unit is used for deleting the designated link in the designated file and filling a vacancy left after deletion in a mode of superposing the designated single-color pictures, wherein the designated single-color pictures are set to be displayed simultaneously;
and the display unit is used for displaying the specified file.
The operations respectively performed by the units or the sub-units correspond to the steps of the method for displaying a file including a multicolor picture in the foregoing embodiment one by one, and are not described herein again.
In one embodiment, the slicing processing unit 50 includes:
a first grid-slicing subunit configured to perform a first grid-slicing process on the first polychrome picture, thereby slicing the first polychrome picture into a plurality of first squares, and dividing the plurality of first squares into a first monochrome square and a first polychrome square;
a second grid-slicing unit for performing a second grid-slicing process on the first multi-color square block to obtain a plurality of second square blocks, wherein the area of the second square blocks is smaller than that of the first square blocks, dividing the plurality of second square blocks into a second single-color square block and a second multi-color square block, and setting the second multi-color square block to be transparent;
and the merging subunit is used for merging the adjacent homochromatic squares to obtain n monochromatic blocks, and acquiring the shapes of the n monochromatic blocks and the positions of the monochromatic blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2.
The operations respectively performed by the units or the sub-units correspond to the steps of the method for displaying a file including a multicolor picture in the foregoing embodiment one by one, and are not described herein again.
In one embodiment, the first multicolor picture is a chinese character picture, and the segmentation processing unit 50 includes:
a segmentation processing subunit, configured to perform segmentation processing on the first multicolor picture by using a preset stroke segmentation method, so as to obtain a plurality of stroke blocks, where the shape of each stroke block at least includes one of horizontal, vertical, left-falling, dot, and compromise;
a monochrome judging subunit, configured to judge whether the plurality of stroke blocks are monochrome;
and the monochromatic block acquisition subunit is used for merging the adjacent stroke blocks with the same color if the plurality of stroke blocks are monochromatic, so as to obtain n monochromatic blocks, and acquiring the shapes of the n monochromatic blocks and the positions of the monochromatic blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2.
The operations respectively performed by the units or the sub-units correspond to the steps of the method for displaying a file including a multicolor picture in the foregoing embodiment one by one, and are not described herein again.
The display device for the file comprising the multicolor picture obtains the specified file; acquiring the first multicolor picture; selecting a second multicolor picture from a preset standard multicolor picture library, and calculating the similarity degree value of the first multicolor picture and the second multicolor picture; if the similarity degree value is not greater than a preset similarity degree threshold value, performing picture segmentation processing on the first multi-color picture; generating n single-color sub-pictures, wherein the size of all the single-color sub-pictures is the same as that of the first multi-color picture, the color of the kth single-color sub-picture is the same as that of the kth single-color block, and the shape and the position of a coloring area of the kth single-color sub-picture are the same as those of the kth single-color block; deleting the designated link in the designated file, and filling a vacancy left after deletion in a mode of overlapping the n monochromatic sub-pictures, wherein the n monochromatic sub-pictures are set to be displayed simultaneously; and displaying the specified file. Therefore, the defect that the traditional technology can not display multicolor pictures in files only capable of displaying monochromatic pictures is overcome.
Referring to fig. 3, an embodiment of the present invention further provides a computer device, where the computer device may be a server, and an internal structure of the computer device may be as shown in the figure. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for storing data for the presentation method of the file comprising the multicoloured picture. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a presentation method for a document comprising a multicoloured picture.
The processor executes the method for displaying the file including the multicolor picture, wherein the steps included in the method correspond to the steps of executing the method for displaying the file including the multicolor picture in the foregoing embodiment one by one, and are not described herein again.
It will be understood by those skilled in the art that the structures shown in the drawings are only block diagrams of some of the structures associated with the embodiments of the present application and do not constitute a limitation on the computer apparatus to which the embodiments of the present application may be applied.
The computer equipment acquires the specified file; acquiring the first multicolor picture; selecting a second multicolor picture from a preset standard multicolor picture library, and calculating the similarity degree value of the first multicolor picture and the second multicolor picture; if the similarity degree value is not greater than a preset similarity degree threshold value, performing picture segmentation processing on the first multi-color picture; generating n single-color sub-pictures, wherein the size of all the single-color sub-pictures is the same as that of the first multi-color picture, the color of the kth single-color sub-picture is the same as that of the kth single-color block, and the shape and the position of a coloring area of the kth single-color sub-picture are the same as those of the kth single-color block; deleting the designated link in the designated file, and filling a vacancy left after deletion in a mode of overlapping the n monochromatic sub-pictures, wherein the n monochromatic sub-pictures are set to be displayed simultaneously; and displaying the specified file. Therefore, the defect that the traditional technology can not display multicolor pictures in files only capable of displaying monochromatic pictures is overcome.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for displaying a file including a multi-color picture is implemented, where steps included in the method correspond to steps of executing the method for displaying a file including a multi-color picture in the foregoing embodiment one to one, and are not described herein again.
The computer-readable storage medium of the present application, acquiring a specified file; acquiring the first multicolor picture; selecting a second multicolor picture from a preset standard multicolor picture library, and calculating the similarity degree value of the first multicolor picture and the second multicolor picture; if the similarity degree value is not greater than a preset similarity degree threshold value, performing picture segmentation processing on the first multi-color picture; generating n single-color sub-pictures, wherein the size of all the single-color sub-pictures is the same as that of the first multi-color picture, the color of the kth single-color sub-picture is the same as that of the kth single-color block, and the shape and the position of a coloring area of the kth single-color sub-picture are the same as those of the kth single-color block; deleting the designated link in the designated file, and filling a vacancy left after deletion in a mode of overlapping the n monochromatic sub-pictures, wherein the n monochromatic sub-pictures are set to be displayed simultaneously; and displaying the specified file. Therefore, the defect that the traditional technology can not display multicolor pictures in files only capable of displaying monochromatic pictures is overcome.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double-rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (10)

1. A method of displaying a document including a multicolored picture, comprising:
acquiring a designated file, wherein the designated file comprises a designated link, the designated link is linked to a first multicolor picture, and the designated file can only display a monochromatic picture;
acquiring the first multicolor picture through the designated link;
selecting a second multicolor picture from a preset standard multicolor picture library according to a preset picture screening method, wherein the second multicolor picture is associated with a designated multicolor display scheme, and the designated multicolor display scheme refers to a scheme of overlapping and simultaneously displaying a plurality of pre-stored designated single-color pictures;
calculating the similarity degree values of the first multicolor picture and the second multicolor picture, and judging whether the similarity degree values are larger than a preset similarity degree threshold value or not;
if the similarity degree value is not greater than a preset similarity degree threshold value, performing picture segmentation processing on the first multicolor picture to obtain the shapes of n single-color blocks and the positions of the single-color blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2;
generating n single-color sub-pictures according to a preset sub-picture generation method, wherein the sizes of all the single-color sub-pictures are the same as the size of the first multicolor picture, the color of the kth single-color sub-picture is the same as the color of the kth single-color block, the shape and the position of a coloring area of the kth single-color sub-picture are the same as the shape and the position of the kth single-color block, and k is an integer greater than 0 and less than or equal to n;
deleting the designated link in the designated file, and filling a vacancy left after deletion in a mode of overlapping the n monochromatic sub-pictures, wherein the n monochromatic sub-pictures are set to be displayed simultaneously;
and displaying the specified file.
2. The method for displaying a document including a multicolor picture according to claim 1, wherein the step of selecting a second multicolor picture from a predetermined standard multicolor picture library according to a predetermined picture screening method comprises:
acquiring the types of all colors of the first multicolor picture, and judging whether a first intermediate picture exists in a preset standard multicolor picture library, wherein the types of all colors of the first intermediate picture are the same as the types of all colors of the first multicolor picture;
if a first intermediate picture does not exist in a preset standard multicolor picture library, judging whether a second intermediate picture exists in the standard multicolor picture library, wherein the types of colors displayed by all colors of the second intermediate picture after being superposed through specified colors are the same as the types of all colors of the first multicolor picture;
and if a second intermediate picture exists in the standard multicolor picture library, acquiring the second intermediate picture, performing superposition processing on all coloring areas in the second intermediate picture by adopting specified colors, and recording the superposed second intermediate picture as a second multicolor picture.
3. The method of claim 1, wherein said first polychrome picture and said second polychrome picture are both rectangular pictures, and wherein said step of calculating a similarity value between said first polychrome picture and said second polychrome picture comprises:
acquiring a plurality of first boundary lines between different color regions in the first multicolor picture and acquiring a plurality of second boundary lines between different color regions in the second multicolor picture;
acquiring a first total length of the first interface lines and acquiring a second total length of the second interface lines;
according to the formula: and calculating the similarity value of the first multicolor picture and the second multicolor picture according to the similarity value of 1/| the first total length-the second total length |.
4. The method of claim 1, wherein said step of calculating a similarity value between said first polychrome picture and said second polychrome picture comprises:
acquiring areas R1, R2, and R m occupied by various colors in the first multicolor picture, and acquiring areas H1, H2, and H in the second multicolor picture, wherein the first multicolor picture and the second multicolor picture are formed by m colors;
acquiring a total area R0 of the first multicolor picture, acquiring a total area H0 of the second multicolor picture, and generating a matrix [ min (R1/R0, H1/H0), min (R2/R0, H2/H0),.. the same, min (Rm/R0, Hm/H0) ] and a matrix [1/max (R1/R0, H1/H0) ], 1/max (R2/R0, H2/H0),. the same, 1/max (Rm/R0, Hm/H0) ];
according to the formula:
similarity degree value | | [ min (R1/R0, H1/H0), min (R2/R0, H2/H0),.. so, min (Rm/R0, Hm/H0)][1/max(R1/R0,H1/H0),1/max(R2/R0,H2/H0),...,1/max(Rm/R0,Hm/H0)]TAnd | l, calculating to obtain the similarity degree value of the first multicolor picture and the second multicolor picture.
5. The method for displaying a document including a multicolor picture according to claim 1, wherein the step of calculating the similarity value between the first multicolor picture and the second multicolor picture and determining whether the similarity value is greater than a preset similarity threshold value comprises:
if the similarity degree value is larger than a preset similarity degree threshold value, acquiring the designated multi-color display scheme, wherein the designated multi-color display scheme refers to a scheme of overlapping and simultaneously displaying a plurality of pre-stored designated single-color pictures;
deleting the designated link in the designated file, and filling a vacancy left after deletion in a mode of overlapping the designated single-color pictures, wherein the designated single-color pictures are set to be displayed simultaneously;
and displaying the specified file.
6. A method for displaying a file containing a polychrome picture as claimed in claim 1, wherein said step of performing a picture slicing process on said first polychrome picture so as to obtain the shape of n single-color blocks and the position of said single-color blocks in said first polychrome picture, wherein n is an integer greater than or equal to 2, comprises:
performing a first grid splitting process on the first polychrome picture, thereby splitting the first polychrome picture into a plurality of first squares, and dividing the plurality of first squares into first single-color squares and first polychrome squares;
performing second grid segmentation processing on the first multi-color square blocks to obtain a plurality of second square blocks, wherein the area of the second square blocks is smaller than that of the first square blocks, dividing the plurality of second square blocks into second single-color square blocks and second multi-color square blocks, and setting the second multi-color square blocks to be transparent;
and combining adjacent homochromatic squares to obtain n monochromatic blocks, and acquiring the shapes of the n monochromatic blocks and the positions of the monochromatic blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2.
7. The method for displaying a file containing a multicolor picture according to claim 1, wherein said first multicolor picture is a chinese character picture, and said step of performing picture slicing process on said first multicolor picture to obtain the shapes of n single-color blocks and the positions of said single-color blocks in said first multicolor picture, wherein n is an integer greater than or equal to 2, comprises:
segmenting the first multicolor picture by adopting a preset stroke segmentation method to obtain a plurality of stroke blocks, wherein the shapes of the stroke blocks at least comprise one of horizontal, vertical, left-falling, dot and compromise;
judging whether the plurality of stroke blocks are all monochrome or not;
if the stroke blocks are all monochrome, combining the adjacent stroke blocks with the same color to obtain n monochrome blocks, and acquiring the shapes of the n monochrome blocks and the positions of the monochrome blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2.
8. A device for displaying documents including multicolored pictures, comprising:
a designated file acquisition unit, configured to acquire a designated file, where the designated file includes a designated link, the designated link is linked to a first multicolor picture, and the designated file can only display a monochrome picture;
the first multicolor picture acquisition unit is used for acquiring the first multicolor picture through the designated link;
a second multicolor picture obtaining unit, configured to select a second multicolor picture from a preset standard multicolor picture library according to a preset picture screening method, where the second multicolor picture is associated with a specified multicolor display scheme, and the specified multicolor display scheme is a scheme in which a plurality of pre-stored specified monochromatic pictures are superimposed and displayed simultaneously;
the similarity degree value calculating unit is used for calculating the similarity degree values of the first multicolor picture and the second multicolor picture and judging whether the similarity degree values are larger than a preset similarity degree threshold value or not;
the segmentation processing unit is used for carrying out picture segmentation processing on the first multicolor picture if the similarity degree value is not greater than a preset similarity degree threshold value, so as to obtain the shapes of n single-color blocks and the positions of the single-color blocks in the first multicolor picture, wherein n is an integer greater than or equal to 2;
a monochrome sub-picture generating unit, configured to generate n monochrome sub-pictures according to a preset sub-picture generating method, where the size of all the monochrome sub-pictures is the same as the size of the first multi-color picture, the color of the kth monochrome sub-picture is the same as the color of the kth monochrome block, the shape and position of the coloring region of the kth monochrome sub-picture are the same as the shape and position of the kth monochrome block, and k is an integer greater than 0 and less than or equal to n;
the monochrome sub-picture padding unit is used for deleting the designated link in the designated file and padding a vacancy left after deletion in a mode of overlapping the n monochrome sub-pictures, wherein the n monochrome sub-pictures are set to be displayed simultaneously;
and the file display unit is used for displaying the specified file.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202010125466.XA 2020-02-27 2020-02-27 Method and device for displaying files comprising multicolor pictures and computer equipment Active CN111339738B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010125466.XA CN111339738B (en) 2020-02-27 2020-02-27 Method and device for displaying files comprising multicolor pictures and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010125466.XA CN111339738B (en) 2020-02-27 2020-02-27 Method and device for displaying files comprising multicolor pictures and computer equipment

Publications (2)

Publication Number Publication Date
CN111339738A true CN111339738A (en) 2020-06-26
CN111339738B CN111339738B (en) 2024-05-28

Family

ID=71183767

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010125466.XA Active CN111339738B (en) 2020-02-27 2020-02-27 Method and device for displaying files comprising multicolor pictures and computer equipment

Country Status (1)

Country Link
CN (1) CN111339738B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546656A (en) * 2012-07-11 2014-01-29 佳能株式会社 Image processing apparatus, image processing method
CN106033547A (en) * 2015-03-12 2016-10-19 阿里巴巴集团控股有限公司 Color matching evaluation method and device, and dress collocation recommendation method and device
CN109121437A (en) * 2015-12-18 2019-01-01 雅培实验室 For assessing the method and system of histological stain
CN110334702A (en) * 2019-05-30 2019-10-15 深圳壹账通智能科技有限公司 Data transmission method, device and computer equipment based on configuration platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546656A (en) * 2012-07-11 2014-01-29 佳能株式会社 Image processing apparatus, image processing method
CN106033547A (en) * 2015-03-12 2016-10-19 阿里巴巴集团控股有限公司 Color matching evaluation method and device, and dress collocation recommendation method and device
CN109121437A (en) * 2015-12-18 2019-01-01 雅培实验室 For assessing the method and system of histological stain
CN110334702A (en) * 2019-05-30 2019-10-15 深圳壹账通智能科技有限公司 Data transmission method, device and computer equipment based on configuration platform

Also Published As

Publication number Publication date
CN111339738B (en) 2024-05-28

Similar Documents

Publication Publication Date Title
CN106055295B (en) Image processing method, picture method for drafting and device
KR20150091132A (en) Page rendering method and apparatus
JPH0756909A (en) Method and apparatus for supply of substitute computer font
CN106991711A (en) Person's handwriting edit methods and system
CN107943924A (en) Method for automatically generating webpage theme, storage medium and electronic equipment
CN110309447B (en) Electronic bookmark generation method, electronic equipment and computer storage medium
EP1385125B1 (en) Apparatus and method for image processing capable of accelerating image overlay process
CN115237522A (en) Page self-adaptive display method and device
EP0782098B1 (en) Method and system for digital color printing
CN107179920A (en) Network engine starts method and device
CN101677351B (en) Image processing apparatus, image forming apparatus and image processing method
US20210312680A1 (en) Element rendering method and appartus, computer readable storage medium, and computer device
CN111339738B (en) Method and device for displaying files comprising multicolor pictures and computer equipment
US6496198B1 (en) Color editing system
CN113553127B (en) Reading content processing method and device, computer equipment and storage medium
CN111652787A (en) Processing method and device for adding watermark characters into picture and computer equipment
JP2001092952A (en) Method for combining device independent bit maps by preventing artifact
US6356267B1 (en) Method of creating two dimensional shapes drawing system
EP1990775A1 (en) Renderer for presenting an image frame by help of a set of displaying commands
AU745947B2 (en) Color advisor
JP4735212B2 (en) Image processing device
CN116578798B (en) Page contrast automatic calibration optimization method
JPS62204956A (en) Document processing system
CN117009685A (en) Page rendering method and device, electronic equipment and storage medium
CN112037303A (en) Card background color generation method, device, equipment and medium for theme display card

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