CN111104935B - Image acquisition method, image display method, device and equipment - Google Patents
Image acquisition method, image display method, device and equipment Download PDFInfo
- Publication number
- CN111104935B CN111104935B CN201911087253.6A CN201911087253A CN111104935B CN 111104935 B CN111104935 B CN 111104935B CN 201911087253 A CN201911087253 A CN 201911087253A CN 111104935 B CN111104935 B CN 111104935B
- Authority
- CN
- China
- Prior art keywords
- image
- layer sub
- color
- background layer
- sub
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 105
- 239000003086 colorant Substances 0.000 claims abstract description 65
- 230000000873 masking effect Effects 0.000 claims abstract description 31
- 238000012545 processing Methods 0.000 claims abstract description 21
- 238000004590 computer program Methods 0.000 claims description 26
- 230000008569 process Effects 0.000 claims description 8
- 230000000694 effects Effects 0.000 abstract description 10
- 238000012800 visualization Methods 0.000 abstract description 8
- 238000010586 diagram Methods 0.000 description 13
- 238000013461 design Methods 0.000 description 4
- 238000001228 spectrum Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 235000000177 Indigofera tinctoria Nutrition 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000007621 cluster analysis Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000001815 facial effect Effects 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 229940097275 indigo Drugs 0.000 description 1
- COHYTHOBJLSHDF-UHFFFAOYSA-N indigo powder Natural products N1C2=CC=CC=C2C(=O)C1=C1C(=O)C2=CC=CC=C2N1 COHYTHOBJLSHDF-UHFFFAOYSA-N 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003062 neural network model Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012549 training Methods 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/22—Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/40—Filling a planar surface by adding surface attributes, e.g. colour or texture
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/50—Image enhancement or restoration using two or more images, e.g. averaging or subtraction
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Image Processing (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The application discloses an image acquisition method, which comprises the steps of obtaining a first background layer sub-image; if the number of the colors of the first background layer sub-image is multiple and the ratio of the number of the pixel points of at least one color to the number of all the pixel points of the first background layer sub-image meets a preset ratio condition, processing the first background layer sub-image by using a masking layer sub-image to obtain a second background layer sub-image; and overlapping content layer information on the second background layer sub-image to generate a target image. The method can obtain the target image which not only considers the definition of the pixel points of the background layer sub-image, but also considers the definition of the pixel points of the content layer information, and can remarkably improve the definition and visualization effect of information display in the target image.
Description
Technical Field
The present application relates to the field of internet, and in particular, to an image acquisition method, an image acquisition device, an electronic apparatus, and a computer storage medium. The application also relates to an image display method, an image display device, electronic equipment and a computer storage medium.
Background
With the development of the internet technology, a user can conveniently order various services such as taking out, reserving hotel rooms, purchasing commodities and the like on a client, such as a mobile phone and a tablet personal computer, and great convenience is brought to the life of the user.
Currently, in a client, stores providing different services generally provide a membership card for identifying a user for better providing the user with the services. The user identity can be rapidly identified through each store of the membership card, so that targeted personalized services are provided for the user, for example, the user is provided with favorable services such as commodity reduction and full discount, special commodity, shopping and credit delivery and the like.
At present, when a client acquires and displays a store membership card, because a card surface image of the membership card generally consists of a card surface background image and user rights and interests information uploaded by a store merchant, when the client acquires the card surface image of the membership card, the user rights and interests information is usually directly superposed on the card surface background image to acquire the card surface image of the membership card. However, due to the difference of design styles and color combinations of the card surface background images uploaded by different store merchants, after the user interest information is superimposed on the card surface background image, the definition of pixel points of the user interest information in the finally obtained card surface image is not good enough, and further the visualization effect of the card surface image is poor. In order to increase the definition of pixel points of user interest information in a card surface image, when a client acquires and displays a membership card, a masking layer is simply and directly superposed on a card surface background image uploaded by a store merchant, and the user interest information is superposed on the masking layer, so that the card surface image of the membership card is acquired. Therefore, no matter which method is adopted by the client to obtain the card surface image of the membership card, the information in the obtained card surface image is not clear enough, and the visualization effect is poor.
The above is an example of the client acquiring and displaying the store membership card, and illustrates the problem of displaying the store membership card. In a similar scene, for example, when a certain image is displayed, a similar problem may be encountered, that is, the background layer sub-image in one image may cause poor display definition of the content layer information in the image due to design style, color combination and other factors.
Disclosure of Invention
The embodiment of the application provides an image acquisition method, which aims to solve the problem that in the prior art, the display definition of content layer information in an image is poor.
The embodiment of the application provides an image acquisition method, which comprises the following steps:
obtaining a first background layer sub-image;
if the number of the colors of the first background layer sub-image is multiple and the ratio of the number of the pixel points of at least one color to the number of all the pixel points of the first background layer sub-image meets a preset ratio condition, processing the first background layer sub-image by using a masking layer sub-image to obtain a second background layer sub-image;
and overlapping content layer information on the second background layer sub-image to generate a target image.
Optionally, the method further includes:
acquiring the number of pixel points of at least one color of the first background layer sub-image;
if the ratio of the number of the pixel points of the at least one color to the number of all the pixel points of the first background layer sub-image is not larger than the pixel point number ratio threshold, it is determined that the number of the color of the first background layer sub-image is multiple, and the ratio of the number of the pixel points of the at least one color to the number of all the pixel points of the first background layer sub-image satisfies a preset ratio condition.
Optionally, the obtaining of the number of pixel points of at least one color of the first background layer sub-image includes:
acquiring pixel point information of the first background layer sub-image;
and acquiring the number of pixel points of at least one color of the first background layer sub-image according to the pixel point information of the first background layer sub-image.
Optionally, the obtaining, according to the pixel information of the first background layer sub-image, the number of pixels of at least one color of the first background layer sub-image includes:
and according to the pixel point information of the first background layer sub-image, performing pixel point color analysis on the pixel points of the first background layer sub-image to obtain the number of pixel points of at least one color of the first background layer sub-image.
Optionally, the analyzing, according to the pixel information of the first background layer sub-image, the color of the pixel of the first background layer sub-image to obtain the number of pixels of at least one color of the first background layer sub-image includes:
acquiring a predetermined kind of color as a representative color;
clustering the pixel points of the first background layer sub-image according to the representative colors of the preset types according to the pixel point information of the first background layer sub-image;
acquiring the quantity of pixel points classified into each representative color;
and acquiring the number of pixel points of at least one color of the first background layer subimage according to the number of the pixel points classified into each representative color.
Optionally, the method further includes:
acquiring the color number of the first background layer sub-image;
if the color number of the first background layer sub-image is larger than the color number threshold, the color number of the first background layer sub-image is judged to be multiple, and the ratio of the number of the pixel points of at least one color to the number of all the pixel points of the first background layer sub-image meets a preset ratio condition.
Optionally, the processing the first background layer sub-image by using the mask sub-image to obtain a second background layer sub-image includes:
acquiring a Mongolian layer sub-image with the transparency not greater than a transparency threshold;
and overlapping the masking layer sub-image on the first background layer sub-image to obtain the second background layer sub-image.
Optionally, the obtaining of the masked sub-image with the transparency not greater than the transparency threshold includes:
selecting the color with the largest number of pixel points in the first background layer sub-image as a first color;
acquiring a second color which is superposed on the first color and can reduce the display definition of the first color;
and acquiring an image with the background color being the second color and the transparency being not greater than the transparency threshold value as the Mongolian sub-image.
Optionally, the obtaining of the masked sub-image with the transparency not greater than the transparency threshold includes:
and acquiring an image with a background color being a preset color and a transparency being not greater than a transparency threshold value as the Mongolian sub-image.
The embodiment of the present application further provides an image display method, including:
obtaining a target image, wherein the target image comprises a background layer sub-image, a mask layer sub-image which is superposed on the background layer sub-image and has transparency not greater than a transparency threshold, and content layer information superposed on the mask layer sub-image, the number of colors of the background layer sub-image is multiple, and the ratio of the number of pixels of at least one color to the number of all pixels of the background layer sub-image meets a preset ratio condition;
and displaying the target image.
An embodiment of the present application further provides an image capturing apparatus, including:
the first background layer sub-image acquisition unit is used for acquiring a first background layer sub-image;
a second background layer sub-image obtaining unit, configured to process the first background layer sub-image by using a masking layer sub-image to obtain a second background layer sub-image if the number of the colors of the first background layer sub-image is multiple and a ratio of the number of pixels of at least one color to the number of all pixels of the first background layer sub-image meets a preset ratio condition;
and the target image generating unit is used for superposing the content layer information on the second background layer sub-image to generate a target image.
An embodiment of the present application further provides an image display apparatus, including:
the target image obtaining unit is used for obtaining a target image, the target image comprises a background layer sub-image, a mask sub-image which is superposed on the background layer sub-image and has the transparency not larger than a transparency threshold value, and content layer information superposed on the mask sub-image, the number of the colors of the background layer sub-image is multiple, and the ratio of the number of pixels of at least one color to the number of all pixels of the background layer sub-image meets a preset ratio condition;
and the display unit is used for displaying the target image.
An embodiment of the present application further provides an electronic device, including:
a processor;
a memory for storing a computer program of an image acquisition method, the apparatus performing the following steps after being powered on and running the computer program of the image acquisition method by the processor:
obtaining a first background layer sub-image;
if the number of the colors of the first background layer sub-image is multiple and the ratio of the number of the pixel points of at least one color to the number of all the pixel points of the first background layer sub-image meets a preset ratio condition, processing the first background layer sub-image by using a masking layer sub-image to obtain a second background layer sub-image;
and overlapping content layer information on the second background layer sub-image to generate a target image.
An embodiment of the present application further provides another electronic device, including:
a processor;
a memory for storing a computer program of an image presentation method, the apparatus performing the following steps after being powered on and running the computer program of the image presentation method by the processor:
obtaining a target image, wherein the target image comprises a background layer sub-image, a mask layer sub-image which is superposed on the background layer sub-image and has transparency not greater than a transparency threshold, and content layer information superposed on the mask layer sub-image, the number of colors of the background layer sub-image is multiple, and the ratio of the number of pixels of at least one color to the number of all pixels of the background layer sub-image meets a preset ratio condition;
and displaying the target image.
The embodiment of the application also provides a computer storage medium, which stores a computer program, and the computer program is run by a processor to execute the image acquisition method.
The embodiment of the application also provides another computer storage medium, which stores a computer program, and the computer program is run by a processor to execute the image display method.
Compared with the prior art, the method has the following advantages:
the embodiment of the application provides an image acquisition method, which comprises the following steps: obtaining a first background layer sub-image; if the number of the colors of the first background layer sub-image is multiple and the ratio of the number of the pixel points of at least one color to the number of all the pixel points of the first background layer sub-image meets a preset ratio condition, processing the first background layer sub-image by using a masking layer sub-image to obtain a second background layer sub-image; and overlapping content layer information on the second background layer sub-image to generate a target image. When the method provided by the embodiment of the application is used for obtaining a target image, a first background layer sub-image used as a background sub-image of the target image is obtained first, and whether the number of colors of the first background layer sub-image is multiple or not and whether the ratio of the number of pixel points of at least one color of the first background layer sub-image to the number of all pixel points of the first background layer sub-image meets a preset ratio condition or not are automatically judged, if the number of colors of the first background layer sub-image is multiple and the ratio of the number of pixel points of at least one color to the number of all pixel points of the first background layer sub-image meets the preset ratio condition, the first background layer sub-image is processed by using a mask layer sub-image, so that a second background layer sub-image is obtained, and content layer information corresponding to the target image is superposed on the second background layer sub-image, the target image which not only considers the definition of the pixel points of the first background layer sub-image, but also considers the definition of the pixel points of the content layer information is obtained, and the definition and the visualization effect of information display in the target image can be remarkably improved.
The embodiment of the application provides an image display method, which comprises the following steps: obtaining a target image, wherein the target image comprises a background layer sub-image, a mask layer sub-image which is superposed on the background layer sub-image and has transparency not greater than a transparency threshold, and content layer information superposed on the mask layer sub-image, the number of colors of the background layer sub-image is multiple, and the ratio of the number of pixels of at least one color to the number of all pixels of the background layer sub-image meets a preset ratio condition; and displaying the target image. According to the method, when the target image is displayed on the client side, such as the image of a store membership card, the definition of the pixel points of the background layer sub-image and the definition of the pixel points of the content layer information are both considered, and the definition and visualization effect of information display in the target image can be remarkably improved.
Drawings
Fig. 1 is a schematic view of an application scenario of an image acquisition method according to a first embodiment of the present application.
Fig. 2 is a flowchart of an image acquisition method according to a first embodiment of the present application.
Fig. 3-a is a schematic diagram of a first background layer sub-image provided in the first embodiment of the present application.
Fig. 3-B is a schematic diagram of content layer information superimposed on a background layer sub-image provided in the first embodiment of the present application.
Fig. 3-C is a schematic diagram of a target image provided by the first embodiment of the present application.
Fig. 4 is a flowchart of an image displaying method according to a second embodiment of the present application.
Fig. 5 is a schematic diagram of an image capturing apparatus according to a third embodiment of the present application.
Fig. 6 is a schematic diagram of an image display apparatus according to a fourth embodiment of the present application.
Fig. 7 is a schematic diagram of an electronic device according to a fifth embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
First, in order to make those skilled in the art better understand the solution of the present application, a detailed description is given below of a specific application scenario of an embodiment of the present application based on an image acquisition method provided in the first embodiment of the present application. Fig. 1 is a schematic view of an application scenario of an image acquisition method according to a first embodiment of the present application.
In a specific implementation process, the image obtaining method implemented by the application generally includes that when the client 101 needs to display a store membership card, in order to improve a visualization effect of a card surface image of the store membership card to be displayed, the client 101 sends a request message for obtaining a target image to the server 102, that is, sends a request message for obtaining the card surface image of the store membership card; after the server 102 obtains the request message, a first background layer sub-image is obtained; then, judging whether the number of the colors of the first background layer sub-image is multiple and whether the ratio of the number of the pixels of at least one color to the number of all the pixels of the first background layer sub-image meets a preset ratio condition, if the number of the colors of the first background layer sub-image is multiple and the ratio of the number of the pixels of at least one color to the number of all the pixels of the first background layer sub-image meets the preset ratio condition, the server 102 uses the mask sub-image to process the first background layer sub-image to obtain a second background layer sub-image; then, the server 102 superimposes the content layer information on the second background layer sub-image to generate a target image; after generating the target image, the server 102 provides the target image to the client 101; after the client 101 obtains the target image, the target image is displayed.
The client 101 may be a mobile terminal device, such as a mobile phone, a tablet computer, or the like, and certainly may also be a terminal device set in an store, such as an intelligent ordering terminal. The server 102 generally refers to a server capable of processing a service request of a client. The server may be a local server or a remote server. The store may be a physical store in the real world or a virtual store in the network, and the store is generally capable of providing a product ordering service to the user. Such as XX restaurants, YY western restaurants, ZZ barber shops, etc. The target image may be a card surface image of a membership card provided to the user by a service store in the client application program, or may be other card surface images to be displayed, such as a dish image, an advertisement image, and the like.
It should be noted that, in specific implementation, the image obtaining method according to the first embodiment of the present application may be separately applied to a client or a server, for example, when the client 101 obtains a trigger operation of a display target image, the client responds to the trigger operation and directly obtains a first background layer sub-image from a connected storage device; then, judging whether the number of the colors of the first background layer sub-image is multiple and whether the ratio of the number of the pixels of at least one color to the number of all the pixels of the first background layer sub-image meets a preset ratio condition, if the number of the colors of the first background layer sub-image is multiple and the ratio of the number of the pixels of at least one color to the number of all the pixels of the first background layer sub-image meets the preset ratio condition, processing the first background layer sub-image by using a mask sub-image by the client 101 to obtain a second background layer sub-image; then, the client 101 superimposes the content layer information on the second background layer sub-image to generate a target image without acquiring the target image from the server;
of course, the image obtaining method provided in the first embodiment of the present application may also be applied between a server and a server, for example, the server 102 responds to a request message sent by another server for obtaining a target image, and then the server 102 responds to the request message, by obtaining a first background layer sub-image, and determining whether the number of colors of the first background layer sub-image is multiple, and whether a ratio of the number of pixels of at least one color to the number of all pixels of the first background layer sub-image satisfies a preset ratio condition, if the number of colors of the first background layer sub-image is multiple, and a ratio of the number of pixels of at least one color to the number of all pixels of the first background layer sub-image satisfies a preset ratio condition, the server 102 processes the first background layer sub-image by using a mask layer sub-image, and obtaining a second background layer sub-image, superposing content layer information on the second background layer sub-image to generate a target image, and providing the target image to other service terminals. Of course, after the server 102 acquires the image of the background image uploaded by the user and used for serving as the membership card, in order to improve the visual effect of the card surface image of the membership card, the server 102 directly regards the background image as the first background layer sub-image in the present application after acquiring the background image uploaded by the user, and determines whether the number of colors in the background image is multiple and whether the ratio of the number of pixels of at least one color to the number of all pixels of the first background layer sub-image meets a preset ratio condition, if the number of colors in the background image is multiple and the ratio of the number of pixels of at least one color to the number of all pixels of the first background layer sub-image meets the preset ratio condition, the server 102 directly processes the first background layer sub-image by using the mask layer sub-image, obtaining a second background layer sub-image, and overlapping content layer information on the second background layer sub-image to generate a target image, and then storing the corresponding relation between the target image and the user membership card by the server; when the server 102 needs to provide the card surface image of the membership card to other equipment, the server 102 directly provides the target image to other equipment through the corresponding relation.
It should be noted that the above application scenario is only one specific embodiment of the image acquisition method provided in the present application, and the purpose of the application scenario embodiment is to facilitate understanding of the image acquisition method provided in the present application, and is not to limit the image acquisition method provided in the present application.
Fig. 2 is a flowchart of an image acquisition method according to a first embodiment of the present application, which is described in detail below with reference to fig. 2.
In step S201, a first background layer sub-image is obtained.
Before describing the present step, first, a target image finally acquired by the image acquisition method according to the present embodiment will be described. The target image finally acquired in this embodiment is generally an image composed of a background layer, content layer information, and a mask layer, where whether the mask layer needs to be set in the target image is dynamically determined by whether the ratio of the number of colors in the background layer and the number of pixels of at least one color to the number of all pixels in the background layer satisfies a preset ratio condition, rather than simply and directly setting the mask layer between the background layer and the content layer. In this embodiment, the content layer information refers to rights information provided to the user, such as information about full reduction, coupon information, and the like. In addition, the target image finally acquired in this embodiment may be a card surface image of a membership card provided to the user by a service store in the client application, or may also be an image such as a website homepage image and an advertisement image displayed in a page of the application.
The first background layer sub-image is an image of a sub-image in a background layer used as a target image, and can be obtained by uploading by a store merchant when the first background layer sub-image needs to be obtained, or can be obtained by selecting from background images provided by a client or a server by default by the store merchant.
As shown in fig. 3-a, which is a schematic diagram of a first background layer sub-image provided in the first embodiment of the present application. As can be seen from fig. 3-a, when the card face image of the member card of the "XX museum" needs to be acquired, the background image uploaded by the merchant of the "XX museum" may be first obtained, and then, the background image uploaded by the merchant is used as the first background layer sub-image in the image acquisition method according to this embodiment to perform subsequent related processing.
It should be noted that, in fig. 3-a, a schematic diagram of a background image uploaded by a merchant is simply illustrated, in a specific implementation, the background image uploaded by the merchant is generally an image formed by elements which are formed by combining a plurality of colors, have a specific design style, and can embody a store characteristic of the store merchant, for example, information such as LOGO, characteristic information, and the like of the store merchant may exist in the background image, where the characteristic information may be information such as "century old word number", a LOGO building of the store, a signboard dish of the store, or a service, and is not described herein again.
In this embodiment, the obtaining of the first background layer sub-image generally refers to obtaining a background image uploaded by a store merchant and used as a sub-image in a background layer of a target image, and may be, of course, obtained by the store merchant from a background image provided by a client or a server by default.
After step S201, step S202 is executed, if the number of the colors of the first background layer sub-image is multiple, and the ratio of the number of the pixels of at least one color to the number of all the pixels of the first background layer sub-image meets a preset ratio condition, the first background layer sub-image is processed by using a masking layer sub-image to obtain a second background layer sub-image.
After obtaining the background image of the target image, that is, the first background layer sub-image in this embodiment, the first background layer sub-image may be processed to determine whether the first background layer sub-image may affect the display definition of the content layer information in the target image.
In step S201, content layer information is simply introduced, and in specific implementation, when content layer information of a target image needs to be acquired, a merchant usually selects corresponding interest information in a related menu page provided by a client application program; and then, the client or the server presents the rights and interests information selected by the merchant in a content layer of the target image after corresponding typesetting design.
For example, when content layer information in a card surface image of a membership card in the "XX gymnasium" needs to be presented, if the content layer information is right information included in a 7-day week card set by a merchant in a client application program, and the right information includes information such as card opening gift certificate information, top-full-length discount information, special commodities, and special dishes, the client or the server uses the right information corresponding to the 7-day week card as the content layer information in the card surface image when programming the card surface image of the 7-day week card.
As shown in fig. 3-B, which is a schematic diagram of the content layer information superimposed on the background layer sub-image according to the first embodiment of the present application. In specific implementation, the display position, font size, font color and style of the content layer information set by the merchant on the card surface image of the store member card are usually set by the application program, but cannot be set by the merchant, so that if the color in the background image is the same as the color in the content layer information or the color combination in the background image is more, after the content layer information is superimposed on the background image, the display definition of the content layer information may be insufficient, and the content layer information cannot be viewed intuitively by the user.
For example, if the color in the content layer information is yellow and the color in the background image is also yellow or a color close to yellow, the content layer information may not be normally viewed at all by the user when displayed on the background image. For another example, when there are a plurality of color combinations, such as ten color combinations, in the background image, even if the content layer information is displayed on the background image, since the color of the background image is too rich, the user is highly likely to be attracted by the color in the background image without paying too much attention to the content layer information.
In view of the above problems, in this embodiment, after obtaining a background image of a target image, that is, a first background layer sub-image in this embodiment, first of all, analysis processing is performed on the first background layer sub-image, and it is determined whether the number of colors of the first background layer sub-image is multiple, and whether a ratio of the number of pixels of at least one color to the number of all pixels of the first background layer sub-image meets a preset ratio condition, if the number of colors of the first background layer sub-image is multiple, and a ratio of the number of pixels of at least one color to the number of all pixels of the first background layer sub-image meets a preset ratio condition, the first background layer sub-image is processed using a mask layer sub-image, and a second background layer sub-image capable of well presenting content layer information is obtained.
The method for judging whether the number of the colors of the first background layer sub-image is multiple or not and whether the ratio of the number of the pixel points of at least one color to the number of all the pixel points of the first background layer sub-image meets a preset ratio condition or not comprises the following steps: acquiring the number of pixel points of at least one color of the first background layer sub-image; if the ratio of the number of the pixel points of the at least one color to the number of all the pixel points of the first background layer sub-image is not larger than the pixel point number ratio threshold, it is determined that the number of the color of the first background layer sub-image is multiple, and the ratio of the number of the pixel points of the at least one color to the number of all the pixel points of the first background layer sub-image satisfies a preset ratio condition.
In this embodiment, one method for determining whether the number of colors of the first background layer sub-image is multiple is as follows: firstly, acquiring the number of pixel points of at least one color of a first background layer sub-image; and then, judging whether the ratio of the obtained pixel quantity of the at least one color to all the pixel quantities of the first background layer sub-image is not greater than a preset pixel quantity ratio threshold, if not, judging that the color quantity of the first background layer sub-image is multiple, and the ratio of the pixel quantity of the at least one color to all the pixel quantities of the first background layer sub-image meets a preset ratio condition. That is, assume that the preset ratio condition is: the ratio of the number of the pixel points of at least one color of the first background layer sub-image to the number of all the pixel points of the first background layer sub-image is not more than a preset pixel point number ratio threshold, and the preset pixel point number ratio threshold is 75%. Then, when the ratio of the number of the pixel points of a certain color in the background image to the number of all the pixel points in the background image is not greater than 75%, it can be considered that the background image has a combination of multiple colors, and therefore it can be considered that the background image affects the display definition of the content layer information.
For example, for the background image shown in fig. 3-a, when the ratio of the number of white pixels in the background image to the number of all pixels in the background image is not greater than 75%, it can be determined that the image has a plurality of color combinations, and the color combinations affect the display definition of the content layer information.
It should be noted that, in the present embodiment, the preset ratio condition is set as: the ratio of the number of pixels in at least one color of the first background layer sub-image to the number of all pixels in the first background layer sub-image is not greater than a preset threshold value, and the threshold value is 75%, and in specific implementation, the preset ratio condition can be set to other conditions according to actual needs, such as setting: the ratio of the number of pixels of at least one color of the first background layer sub-image to the number of pixels of other colors of the first background layer sub-image is not greater than a preset pixel number ratio threshold, wherein the other colors are colors other than the at least one color in the first background layer sub-image; alternatively, the pixel count ratio threshold may be set to other values, such as 76% and 80%, and is not limited herein.
Wherein, the obtaining of the number of the pixel points of at least one color of the first background layer sub-image includes: acquiring pixel point information of the first background layer sub-image; and acquiring the number of pixel points of at least one color of the first background layer sub-image according to the pixel point information of the first background layer sub-image.
In this embodiment, a method for obtaining the number of pixel points of at least one color of a first background layer sub-image is provided, which specifically includes: acquiring pixel point information of a first background layer sub-image; and then, analyzing and processing the pixel point information to obtain the number of pixel points of at least one color of the first background layer sub-image.
The method for obtaining the pixel point information of the first background layer sub-image may be obtained through a function getImageData () in a canvas element label canvas of HTML5, and of course, may also be obtained through other pixel point information obtaining functions, which are not described herein again.
After the pixel point information of the first background layer sub-image is obtained, the number of the pixel points of at least one color of the first background layer sub-image can be obtained by performing analysis processing on the pixel point information, such as traversal analysis, cluster analysis, and the like, which will be described in detail below.
In this embodiment, the obtaining, according to the pixel point information of the first background layer sub-image, the number of pixel points of at least one color of the first background layer sub-image includes: and according to the pixel point information of the first background layer sub-image, performing pixel point color analysis on the pixel points of the first background layer sub-image to obtain the number of pixel points of at least one color of the first background layer sub-image.
Wherein, the analyzing the pixel color of the pixel of the first background layer sub-image according to the pixel information of the first background layer sub-image, and obtaining the number of the pixels of at least one color of the first background layer sub-image includes: acquiring a predetermined kind of color as a representative color; and according to the pixel point information of the first background layer subimage, clustering the pixel points of the first background layer subimage according to the representative colors of the preset types, acquiring the number of the pixel points classified into each representative color, and acquiring the number of the pixel points of at least one color of the first background layer subimage according to the number of the pixel points classified into each representative color.
For example, a predetermined kind of color is selected in advance as a representative color, such as "red", "orange", "yellow", "green", "blue", "indigo", "violet", "black", "white", "gray" as a representative color; then, according to the pixel point information of the first background layer sub-image, acquiring the RGB numerical value of the color of each pixel point in the first background layer sub-image, acquiring the distance between the RGB numerical value of each pixel point and the RGB numerical value of the representative color through clustering analysis, and clustering the pixel points of the first background layer sub-image according to the predetermined type of the representative color according to the acquired distance; and then, acquiring the quantity of the pixel points classified into each representative color, and acquiring the quantity of the pixel points of at least one color of the first background layer sub-image according to the pixel point data classified into each representative color. Of course, only a method for obtaining the number of pixel points of at least one color of the first background layer sub-image is described here, and in specific implementation, the number of pixel points of each color in the first background layer sub-image may also be obtained by other methods, for example, by using a neural network model obtained by training, which is not described here again.
In addition, the embodiment further provides a method for determining whether the number of the colors of the first background layer sub-image is multiple, specifically: acquiring the color number of the first background layer sub-image; if the color number of the first background layer sub-image is larger than the color number threshold, the color number of the first background layer sub-image is judged to be multiple, and the ratio of the number of the pixel points of at least one color to the number of all the pixel points of the first background layer sub-image meets a preset ratio condition.
That is, after the number of pixel colors of the first background layer sub-image is acquired, it is determined whether the number of pixel colors of the first background layer sub-image is plural directly by comparing the number of pixel colors with a preset color number threshold. For example, if the number of colors in the first background layer sub-image is 5 or more colors, it is considered that the number of color combinations in the first background layer sub-image is large, which has a problem of affecting the display resolution of the content layer information, and therefore, it is necessary to process the first background layer sub-image using the mask sub-image. In addition, in this embodiment, the threshold number of colors is 5, and in a specific implementation, the threshold number of colors may be set to 3, 6 or other values, which is not limited herein.
In the above description, how to determine whether the number of the colors of the first background layer sub-image is multiple and whether the ratio of the number of the pixels of at least one color to the number of all the pixels of the first background layer sub-image meets the preset ratio condition is described in detail, if the number of the colors of the first background layer sub-image is multiple and the ratio of the number of the pixels of at least one color to the number of all the pixels of the first background layer sub-image meets the preset ratio condition through the determination, the first background layer sub-image is processed by using the mask layer sub-image to obtain the second background layer sub-image, so that the content layer information can have a good presentation effect.
The processing the first background layer sub-image by using the masking layer sub-image to obtain a second background layer sub-image includes: acquiring a Mongolian layer sub-image with the transparency not greater than a transparency threshold; and overlapping the masking layer sub-image on the first background layer sub-image to obtain the second background layer sub-image.
That is, the clarity of the pixel points in the first background layer sub-image is reduced by acquiring a mask sub-image with the transparency not greater than the transparency threshold and superimposing the mask sub-image on the first background layer sub-image, so as to obtain a second background layer sub-image corresponding to the first background layer sub-image. After the second background layer sub-image is obtained, because the definition of the pixel points in the first background layer sub-image is reduced through the mask layer sub-image, the display definition of the content layer information is not influenced after the content layer information is superposed on the second background layer sub-image; meanwhile, because the transparency of the mask layer sub-image is not greater than the transparency threshold, the display definition of the content in the first background layer sub-image is not affected.
In this embodiment, the transparency threshold is set to 80%, and in a specific implementation, the transparency threshold may also be set to other values, such as 75%, 90%, and the like, which is not particularly limited herein.
In this embodiment, a method of obtaining a masked sub-image with a transparency not greater than a transparency threshold is provided: selecting the color with the largest number of pixel points in the first background layer sub-image as a first color; acquiring a second color which is superposed on the first color and can reduce the display definition of the first color; and acquiring an image with the background color being the second color and the transparency being not greater than the transparency threshold value as the Mongolian sub-image.
That is, the pixel color with the largest number of pixel points in the first background layer sub-image is selected as the first color, wherein how to obtain the number of pixel points of a certain color in the first background layer sub-image has been described in detail in the above description, and is not described here again; then, a color capable of reducing the display definition of the first color is selected as a second color, and the second color is used as a background color of the masking layer sub-image, for example, the second color may be an opposite or opposite color to the first color.
In this embodiment, the method of selecting the color opposite or opposite to the first color is to use the color opposite to the first color on a color circle as the second color, wherein the color circle refers to a circularly arranged color Spectrum (Spectrum) and the colors are arranged according to the sequence of the Spectrum appearing in nature. The Warm Color (Warm Color) is located within the semicircle containing the colors red and yellow, the cool Color is contained within the semicircle containing the colors green and purple, and the opposite colors appear at positions opposite to each other, since the detailed description of the hue circle is prior art and will not be described herein. Of course, in specific implementation, the second color corresponding to the first color may also be directly obtained from the preset corresponding relationship between the first color and the second color as the background color of the mask sub-image, and details are not repeated here.
After the second color is obtained, the masking layer sub-image with the background color being the second color and the transparency being not greater than the transparency threshold can be obtained, and the obtained background layer sub-image is used for reducing the definition of the pixel points in the first background layer sub-image.
In the foregoing description, a method for acquiring a mask sub-image is provided, and in implementation, the method may acquire the mask sub-image with transparency not greater than a transparency threshold, and may also directly acquire, as the mask sub-image, an image with a background color being a preset color and with transparency not greater than the transparency threshold. The method includes the steps that a background color of a mask sub-image is set in advance directly in a client or a server, and when the mask sub-image needs to be obtained, an image with the background color being a preset color and the transparency being not larger than a transparency threshold is directly obtained to serve as the mask sub-image.
After step S202, step S203 is executed to superimpose content layer information on the second background layer sub-image to generate a target image.
In step S202, when the number of colors of the first background layer sub-image is multiple, and the ratio of the number of pixels of at least one color to the number of all pixels of the first background layer sub-image satisfies a preset ratio condition, a second background layer sub-image corresponding to the first background layer sub-image and reducing the sharpness of the pixels in the first background layer sub-image is obtained by automatically obtaining a mask layer sub-image corresponding to the first background layer sub-image, and processing the first background layer sub-image using the mask layer sub-image; after the second background layer sub-image is obtained, the content layer information is superposed on the second background layer sub-image, and the target image can be generated.
As shown in fig. 3-C, which is a schematic diagram of a target image according to the first embodiment of the present application, as can be seen from fig. 3-C, the definition of pixel points in a first background layer sub-image uploaded by a store merchant is relatively reduced, for example, the definition of the information "XX museum" in the first background layer sub-image is significantly reduced, but the display definition of the information in the first background layer sub-image is not affected; meanwhile, content layer information superposed and presented on a second background layer sub-image formed by superposing a mask sub-image can be better displayed without being influenced by the content in the first background layer sub-image, namely, the display definition of rights and interests information provided for a user is obviously improved on the card surface image of the 'XX facial hall' acquired by the image acquisition method, and meanwhile, the content in the background layer sub-image can be well displayed.
As can be seen from the above description, the target image obtained by the image obtaining method provided in the embodiment of the present application includes a background layer sub-image, a mask layer sub-image superimposed on the background layer sub-image and having a transparency not greater than a transparency threshold, and content layer information on the mask layer sub-image, where the number of colors of the background layer sub-image is multiple, and a ratio of the number of pixels in at least one color to the number of all pixels in the first background layer sub-image satisfies a preset ratio condition. In addition, after the target image is acquired by using the image acquisition method provided by the embodiment of the application, when the target image needs to be displayed, the acquired target image can be directly displayed on a user interface for a user to view. For example, after the card surface image of the member card of the XX gymnasium is acquired by using the image acquisition method provided by the embodiment of the application, when the user orders the member card and views the member card by using a mobile phone, the client can directly display the card surface image corresponding to the member card on a mobile phone interface so that the user can visually view the rights and interests information of the user, and better experience can be brought to the user.
In summary, the image obtaining method provided in the embodiment of the present application includes: obtaining a first background layer sub-image; if the number of the colors of the first background layer sub-image is multiple and the ratio of the number of the pixel points of at least one color to the number of all the pixel points of the first background layer sub-image meets a preset ratio condition, processing the first background layer sub-image by using a masking layer sub-image to obtain a second background layer sub-image; and overlapping content layer information on the second background layer sub-image to generate a target image. When the method provided by the embodiment of the application is used for obtaining a target image, a first background layer sub-image used as a background sub-image of the target image is obtained first, and whether the number of colors of the first background layer sub-image is multiple or not and whether the ratio of the number of pixel points of at least one color of the first background layer sub-image to the number of all pixel points of the first background layer sub-image meets a preset ratio condition or not are automatically judged, if the number of colors of the first background layer sub-image is multiple and the ratio of the number of pixel points of at least one color to the number of all pixel points of the first background layer sub-image meets the preset ratio condition, the first background layer sub-image is processed by using a masking layer sub-image, so that a second background layer sub-image is obtained, and content layer information corresponding to the target image is superposed on the second background layer sub-image, the target image which not only considers the definition of the pixel points of the first background layer sub-image, but also considers the definition of the pixel points of the content layer information is obtained, and the definition and the visualization effect of information display in the target image can be remarkably improved.
In correspondence with the image acquiring method provided by the first embodiment, the second embodiment of the present application further provides an image displaying method, please refer to fig. 4, which is a flowchart of the image displaying method provided by the second embodiment of the present application.
Fig. 4 is a flowchart of an image displaying method according to a second embodiment of the present application, which is described below with reference to fig. 4.
Step S401, obtaining a target image, where the target image includes a background layer sub-image, a mask layer sub-image superimposed on the background layer sub-image and having a transparency not greater than a transparency threshold, and content layer information superimposed on the mask layer sub-image, the number of colors of the background layer sub-image is multiple, and a ratio of the number of pixels of at least one color to the number of all pixels of the background layer sub-image satisfies a preset ratio condition.
And step S402, displaying the target image.
In the method of this embodiment, when a client displays a store membership card, a card surface image corresponding to the store membership card is acquired, where the card surface image includes a background layer sub-image, a mask layer sub-image superimposed on the background layer sub-image and having a transparency not greater than a transparency threshold, and content layer information superimposed on the mask layer sub-image, the number of colors of the background layer sub-image is multiple, and a ratio of the number of pixels of at least one color to the number of pixels of the background layer sub-image satisfies a preset ratio condition; and displaying the acquired card face image corresponding to the store membership card, thereby realizing the effects of improving the visualization effect of the displayed card face image of the store membership card and improving the user experience.
In correspondence with the image capturing method provided by the first embodiment, the third embodiment of the present application further provides an image capturing apparatus, please refer to fig. 5, which is a schematic diagram of an image capturing apparatus provided by the third embodiment of the present application. An image capturing apparatus provided in a third embodiment of the present application includes:
a first background layer sub-image obtaining unit 501, configured to obtain a first background layer sub-image.
A second background layer sub-image obtaining unit 502, configured to process the first background layer sub-image by using a masking layer sub-image to obtain a second background layer sub-image if the number of the colors of the first background layer sub-image is multiple and a ratio of the number of pixels of at least one color to the number of all pixels of the first background layer sub-image meets a preset ratio condition.
A target image generating unit 503, configured to generate a target image by superimposing the content layer information on the second background layer sub-image.
Optionally, the second background layer sub-image obtaining unit is specifically configured to: acquiring the number of pixel points of at least one color of the first background layer sub-image; if the ratio of the number of the pixel points of the at least one color to the number of all the pixel points of the first background layer sub-image is not larger than the pixel point number ratio threshold, it is determined that the number of the color of the first background layer sub-image is multiple, and the ratio of the number of the pixel points of the at least one color to the number of all the pixel points of the first background layer sub-image satisfies a preset ratio condition.
Optionally, the obtaining of the number of pixel points of at least one color of the first background layer sub-image includes: acquiring pixel point information of the first background layer sub-image; and acquiring the number of pixel points of at least one color of the first background layer sub-image according to the pixel point information of the first background layer sub-image.
Optionally, the obtaining, according to the pixel information of the first background layer sub-image, the number of pixels of at least one color of the first background layer sub-image includes: analyzing the pixel color of the pixel points of the first background layer sub-image according to the pixel point information of the first background layer sub-image to obtain the number of the pixel points of at least one color of the first background layer sub-image,
optionally, the analyzing the pixel color of the pixel point of the first background layer sub-image according to the pixel point information of the first background layer sub-image to obtain the number of the pixel points of at least one color of the first background layer sub-image includes: acquiring a predetermined kind of color as a representative color; clustering the pixel points of the first background layer sub-image to a preset type of representative color according to the pixel point information of the first background layer sub-image; and counting the number of pixel points corresponding to different representative colors to obtain the number of pixel points of at least one color of the first background layer subimage.
Optionally, the method further includes: acquiring the color number of the first background layer sub-image; if the color number of the first background layer sub-image is larger than the color number threshold, the color number of the first background layer sub-image is judged to be multiple, and the ratio of the number of the pixel points of at least one color to the number of all the pixel points of the first background layer sub-image meets a preset ratio condition.
Optionally, the processing the first background layer sub-image by using the mask sub-image to obtain a second background layer sub-image includes: acquiring a Mongolian layer sub-image with the transparency not greater than a transparency threshold; and overlapping the masking layer sub-image on the first background layer sub-image to obtain the second background layer sub-image.
Optionally, the obtaining of the masked sub-image with the transparency not greater than the transparency threshold includes: selecting the color with the largest number of pixel points in the first background layer sub-image as a first color; acquiring a second color which is superposed on the first color and can reduce the display definition of the first color; and acquiring an image with the background color being the second color and the transparency being not greater than the transparency threshold value as the Mongolian sub-image.
Optionally, the obtaining of the masked sub-image with the transparency not greater than the transparency threshold includes: and acquiring an image with a background color being a preset color and a transparency being not greater than a transparency threshold value as the Mongolian sub-image.
In a fourth embodiment of the present application, an image displaying apparatus corresponding to the image displaying method provided by the second embodiment is provided, please refer to fig. 6, which is a schematic diagram of the image displaying apparatus provided by the fourth embodiment of the present application. An image display apparatus provided in a fourth embodiment of the present application includes:
the target image obtaining unit 601 is configured to obtain a target image, where the target image includes a background layer sub-image, a mask layer sub-image that is superimposed on the background layer sub-image and has a transparency not greater than a transparency threshold, and content layer information that is superimposed on the mask layer sub-image, the number of colors of the background layer sub-image is multiple, and a ratio of the number of pixels of at least one color to the number of all pixels of the background layer sub-image satisfies a preset ratio condition.
A display unit 602, configured to display the target image.
Corresponding to the image obtaining method provided in the first embodiment of the present application, a fifth embodiment of the present application further provides an electronic device, please refer to fig. 7, which is a schematic diagram of an electronic device provided in the fifth embodiment of the present application. A fifth embodiment of the present application provides an electronic device including:
a processor 701;
a memory 702 for storing a computer program of an image acquisition method, the apparatus performing the following steps after being powered on and running the computer program of the image acquisition method by the processor:
obtaining a first background layer sub-image;
if the number of the colors of the first background layer sub-image is multiple and the ratio of the number of the pixel points of at least one color to the number of all the pixel points of the first background layer sub-image meets a preset ratio condition, processing the first background layer sub-image by using a masking layer sub-image to obtain a second background layer sub-image;
and overlapping content layer information on the second background layer sub-image to generate a target image.
Corresponding to the image displaying method provided by the second embodiment of the present application, the sixth embodiment of the present application further provides another electronic device, the structure of which is substantially similar to that of fig. 7, and particularly, with reference to fig. 7, because the embodiment of the electronic device is substantially similar to that of the method embodiment, the description is relatively simple, and for relevant points, reference may be made to partial description of the method embodiment, and the embodiments of the electronic device described below are only schematic. An electronic device provided in a sixth embodiment of the present application includes:
a processor;
a memory for storing a computer program of an image presentation method, the apparatus performing the following steps after being powered on and running the computer program of the image presentation method by the processor:
obtaining a target image, wherein the target image comprises a background layer sub-image, a mask layer sub-image which is superposed on the background layer sub-image and has transparency not greater than a transparency threshold, and content layer information superposed on the mask layer sub-image, the number of colors of the background layer sub-image is multiple, and the ratio of the number of pixels of at least one color to the number of all pixels of the background layer sub-image meets a preset ratio condition;
and displaying the target image.
In correspondence with the image capturing method provided by the first embodiment, the seventh embodiment of the present application further provides a computer storage medium, since the computer storage medium embodiment is substantially similar to the method embodiment, the description is relatively simple, and for relevant points, reference may be made to part of the description of the method embodiment, and the computer storage medium embodiment described below is only illustrative.
A seventh embodiment of the present application provides a computer storage medium, which stores a computer program, wherein the computer program is executed by a processor, and executes the image acquisition method described in the first embodiment.
In correspondence with the image displaying method provided by the first embodiment, the eighth embodiment of the present application further provides a computer storage medium, since the computer storage medium embodiment is substantially similar to the method embodiment, the description is relatively simple, and for relevant points, reference may be made to part of the description of the method embodiment, and the computer storage medium embodiment described below is only illustrative.
An eighth embodiment of the present application provides a computer storage medium, which stores a computer program, where the computer program is executed by a processor to execute the image displaying method described in the first embodiment.
Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application, and those skilled in the art can make variations and modifications without departing from the spirit and scope of the present application, therefore, the scope of the present application should be determined by the claims that follow.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Claims (14)
1. An image acquisition method, comprising:
obtaining a first background layer sub-image, wherein the first background layer sub-image comprises name information of a service store;
if the number of the colors of the first background layer sub-image is multiple and the ratio of the number of the pixel points of at least one color to the number of all the pixel points of the first background layer sub-image meets a preset ratio condition, processing the first background layer sub-image by using a masking layer sub-image to obtain a second background layer sub-image;
superimposing content layer information on the second background layer sub-image to generate a target image, wherein the target image is a card surface image of a membership card provided for a user by a service store in a client application program, and the content layer information comprises: rights and interests information selected by the service store;
wherein the processing the first background layer sub-image by using the mask sub-image to obtain a second background layer sub-image comprises: selecting the color with the largest number of pixel points in the first background layer sub-image as a first color; acquiring a second color which is superposed on the first color and can reduce the display definition of the first color; acquiring an image with the background color being the second color and the transparency being not greater than a transparency threshold as a mask sub-image of the mask sub-image value; and overlapping the masking layer sub-image on the first background layer sub-image to obtain the second background layer sub-image.
2. The image acquisition method according to claim 1, further comprising:
acquiring the number of pixel points of at least one color of the first background layer sub-image;
if the ratio of the number of the pixel points of the at least one color to the number of all the pixel points of the first background layer sub-image is not larger than the pixel point number ratio threshold, it is determined that the number of the color of the first background layer sub-image is multiple, and the ratio of the number of the pixel points of the at least one color to the number of all the pixel points of the first background layer sub-image satisfies a preset ratio condition.
3. The image obtaining method according to claim 2, wherein the obtaining of the number of pixel points of at least one color of the first background layer sub-image comprises:
acquiring pixel point information of the first background layer sub-image;
and acquiring the number of pixel points of at least one color of the first background layer sub-image according to the pixel point information of the first background layer sub-image.
4. The image obtaining method according to claim 3, wherein the obtaining the number of pixels of at least one color of the first background layer sub-image according to the pixel information of the first background layer sub-image comprises:
and according to the pixel point information of the first background layer sub-image, performing pixel point color analysis on the pixel points of the first background layer sub-image to obtain the number of pixel points of at least one color of the first background layer sub-image.
5. The image obtaining method according to claim 4, wherein the performing, according to the pixel point information of the first background layer sub-image, pixel point color analysis on the pixel points of the first background layer sub-image to obtain the number of pixel points of at least one color of the first background layer sub-image includes:
acquiring a predetermined kind of color as a representative color;
clustering the pixel points of the first background layer sub-image according to the representative colors of the preset types according to the pixel point information of the first background layer sub-image;
acquiring the quantity of pixel points classified into each representative color;
and acquiring the number of pixel points of at least one color of the first background layer subimage according to the number of the pixel points classified into each representative color.
6. The image acquisition method according to claim 1, further comprising:
acquiring the color number of the first background layer sub-image;
if the color number of the first background layer sub-image is larger than the color number threshold, the color number of the first background layer sub-image is judged to be multiple, and the ratio of the number of the pixel points of at least one color to the number of all the pixel points of the first background layer sub-image meets a preset ratio condition.
7. The image acquisition method according to claim 1, wherein said acquiring a masked sub-image having a transparency not greater than a transparency threshold comprises:
and acquiring an image with a background color being a preset color and a transparency being not greater than a transparency threshold value as the Mongolian sub-image.
8. An image presentation method, comprising:
obtaining a target image, wherein the target image comprises a background layer sub-image, a mask layer sub-image which is superposed on the background layer sub-image and has transparency not greater than a transparency threshold, and content layer information superposed on the mask layer sub-image, the number of colors of the background layer sub-image is multiple, and the ratio of the number of pixels of at least one color to the number of all pixels of the background layer sub-image meets a preset ratio condition;
displaying the target image, wherein the target image is a card surface image of a membership card provided for a user by a service store in a client application program;
the background layer sub-image comprises name information of a service store; the content layer information includes: rights and interests information selected by the service store;
the transparency of the masking layer sub-image is not larger than a transparency threshold, the background color of the masking layer sub-image is a second color which is superimposed on the first color and can reduce the display definition of the first color, and the first color is a color with the largest number of pixel points in the background layer sub-image.
9. An image acquisition apparatus, characterized by comprising:
the system comprises a first background layer sub-image acquisition unit, a first background layer sub-image acquisition unit and a second background layer sub-image acquisition unit, wherein the first background layer sub-image acquisition unit is used for acquiring a first background layer sub-image, and the first background layer sub-image comprises name information of a service store;
a second background layer sub-image obtaining unit, configured to process the first background layer sub-image by using a masking layer sub-image to obtain a second background layer sub-image if the number of the colors of the first background layer sub-image is multiple and a ratio of the number of pixels of at least one color to the number of all pixels of the first background layer sub-image meets a preset ratio condition;
a target image generation unit, configured to generate a target image by superimposing content layer information on the second background layer sub-image;
the target image is a card face image of a membership card provided by a service store to a user in a client application program, and the content layer information comprises: rights and interests information selected by the service store;
wherein the processing the first background layer sub-image by using the mask sub-image to obtain a second background layer sub-image comprises: selecting the color with the largest number of pixel points in the first background layer sub-image as a first color; acquiring a second color which is superposed on the first color and can reduce the display definition of the first color; acquiring an image with the background color being the second color and the transparency being not greater than a transparency threshold as a mask sub-image of the mask sub-image value; and overlapping the masking layer sub-image on the first background layer sub-image to obtain the second background layer sub-image.
10. An image display apparatus, comprising:
the target image obtaining unit is used for obtaining a target image, the target image comprises a background layer sub-image, a mask sub-image which is superposed on the background layer sub-image and has the transparency not larger than a transparency threshold value, and content layer information superposed on the mask sub-image, the number of the colors of the background layer sub-image is multiple, and the ratio of the number of pixels of at least one color to the number of all pixels of the background layer sub-image meets a preset ratio condition;
the display unit is used for displaying the target image; the target image is a card face image of a membership card provided for the user by a service store in the client application program; the background layer sub-image comprises name information of a service store; the content layer information includes: rights and interests information selected by the service store;
the transparency of the masking layer sub-image is not larger than a transparency threshold, the background color of the masking layer sub-image is a second color which is superimposed on the first color and can reduce the display definition of the first color, and the first color is a color with the largest number of pixel points in the background layer sub-image.
11. An electronic device, comprising:
a processor;
a memory for storing a computer program of an image acquisition method, the apparatus performing the following steps after being powered on and running the computer program of the image acquisition method by the processor:
obtaining a first background layer sub-image, wherein the first background layer sub-image comprises name information of a service store;
if the number of the colors of the first background layer sub-image is multiple and the ratio of the number of the pixel points of at least one color to the number of all the pixel points of the first background layer sub-image meets a preset ratio condition, processing the first background layer sub-image by using a masking layer sub-image to obtain a second background layer sub-image;
overlaying content layer information on the second background layer sub-image to generate a target image;
the target image is a card face image of a membership card provided by a service store to a user in a client application program, and the content layer information comprises: rights and interests information selected by the service store; the processing the first background layer sub-image by using the masking layer sub-image to obtain a second background layer sub-image includes: selecting the color with the largest number of pixel points in the first background layer sub-image as a first color; acquiring a second color which is superposed on the first color and can reduce the display definition of the first color; acquiring an image with the background color being the second color and the transparency being not greater than a transparency threshold as a mask sub-image of the mask sub-image value; and overlapping the masking layer sub-image on the first background layer sub-image to obtain the second background layer sub-image.
12. An electronic device, comprising:
a processor;
a memory for storing a computer program of an image presentation method, the apparatus performing the following steps after being powered on and running the computer program of the image presentation method by the processor:
obtaining a target image, wherein the target image comprises a background layer sub-image, a mask layer sub-image which is superposed on the background layer sub-image and has transparency not greater than a transparency threshold, and content layer information superposed on the mask layer sub-image, the number of colors of the background layer sub-image is multiple, and the ratio of the number of pixels of at least one color to the number of all pixels of the background layer sub-image meets a preset ratio condition;
displaying the target image;
the target image is a card face image of a membership card provided for a user by a service store in a client application program, and the background layer sub-image comprises name information of the service store; the content layer information includes: rights and interests information selected by the service store; the transparency of the masking layer sub-image is not larger than a transparency threshold, the background color of the masking layer sub-image is a second color which is superimposed on the first color and can reduce the display definition of the first color, and the first color is a color with the largest number of pixel points in the background layer sub-image.
13. A computer storage medium, in which a computer program is stored, the computer program being executed by a processor to perform the image acquisition method according to any one of claims 1 to 7.
14. A computer storage medium, in which a computer program is stored, the computer program being executed by a processor to perform the image presentation method according to claim 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911087253.6A CN111104935B (en) | 2019-11-08 | 2019-11-08 | Image acquisition method, image display method, device and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911087253.6A CN111104935B (en) | 2019-11-08 | 2019-11-08 | Image acquisition method, image display method, device and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111104935A CN111104935A (en) | 2020-05-05 |
CN111104935B true CN111104935B (en) | 2021-10-12 |
Family
ID=70420532
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911087253.6A Active CN111104935B (en) | 2019-11-08 | 2019-11-08 | Image acquisition method, image display method, device and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111104935B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1033681A3 (en) * | 1999-03-04 | 2003-07-23 | Xerox Corporation | Method and apparatus for image data compression |
CN102521820A (en) * | 2011-12-22 | 2012-06-27 | 张著岳 | Object picture display method with dynamic fusion of background and display method thereof |
CN104038700A (en) * | 2014-06-26 | 2014-09-10 | Tcl集团股份有限公司 | Picture taking method and device |
CN204576553U (en) * | 2015-03-03 | 2015-08-19 | 深圳桑达商用机器有限公司 | A kind of member card application and card-issuing equipment |
CN105898614A (en) * | 2015-08-21 | 2016-08-24 | 乐视致新电子科技(天津)有限公司 | Screen menu transparency setting method and device and chip |
CN107424136A (en) * | 2017-07-31 | 2017-12-01 | 北京酷我科技有限公司 | The Processing Algorithm of picture Gaussian Blur under a kind of Mac |
CN110400355A (en) * | 2019-07-29 | 2019-11-01 | 北京华雨天成文化传播有限公司 | A kind of determination method, apparatus, electronic equipment and the storage medium of monochrome video |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103064691B (en) * | 2013-01-30 | 2016-04-06 | 广东欧珀移动通信有限公司 | Make the method and apparatus of desktop icon of electronic equipment |
CN105404438B (en) * | 2014-08-13 | 2019-10-15 | 小米科技有限责任公司 | Blurred background method, apparatus and terminal device |
-
2019
- 2019-11-08 CN CN201911087253.6A patent/CN111104935B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1033681A3 (en) * | 1999-03-04 | 2003-07-23 | Xerox Corporation | Method and apparatus for image data compression |
CN102521820A (en) * | 2011-12-22 | 2012-06-27 | 张著岳 | Object picture display method with dynamic fusion of background and display method thereof |
CN104038700A (en) * | 2014-06-26 | 2014-09-10 | Tcl集团股份有限公司 | Picture taking method and device |
CN204576553U (en) * | 2015-03-03 | 2015-08-19 | 深圳桑达商用机器有限公司 | A kind of member card application and card-issuing equipment |
CN105898614A (en) * | 2015-08-21 | 2016-08-24 | 乐视致新电子科技(天津)有限公司 | Screen menu transparency setting method and device and chip |
CN107424136A (en) * | 2017-07-31 | 2017-12-01 | 北京酷我科技有限公司 | The Processing Algorithm of picture Gaussian Blur under a kind of Mac |
CN110400355A (en) * | 2019-07-29 | 2019-11-01 | 北京华雨天成文化传播有限公司 | A kind of determination method, apparatus, electronic equipment and the storage medium of monochrome video |
Also Published As
Publication number | Publication date |
---|---|
CN111104935A (en) | 2020-05-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9405734B2 (en) | Image manipulation for web content | |
CN106982240B (en) | Information display method and device | |
US9384572B2 (en) | Data analysis system | |
US20180025002A1 (en) | Hue-based color naming for an image | |
CN110858134B (en) | Data, display processing method and device, electronic equipment and storage medium | |
CN107169135B (en) | Image processing method and device and electronic equipment | |
KR20160003788A (en) | Adaptively embedding visual advertising content into media content | |
US9818044B2 (en) | Content update suggestions | |
CN112256366A (en) | Page display method and device and electronic equipment | |
EP3794580A1 (en) | System and method for color mapping for improved viewing by a color vision deficient observer | |
US10389804B2 (en) | Integration of content creation and sharing | |
CN108076359B (en) | Business object display method and device and electronic equipment | |
CN111340921A (en) | Dyeing method, dyeing apparatus, computer system and medium | |
US20170131876A1 (en) | Integration of Content Creation and Sharing | |
CN107770603B (en) | Video image processing method and device and terminal equipment | |
WO2022246945A1 (en) | Information display method and apparatus, ar device and storage medium | |
CN107067295B (en) | Information processing method and electronic equipment | |
CN111104935B (en) | Image acquisition method, image display method, device and equipment | |
CN113298912B (en) | Commodity picture processing method, commodity picture processing device and commodity picture processing server | |
WO2024001677A1 (en) | Page display method and apparatus, computer device, storage medium and program product | |
CN111815784A (en) | Method and device for presenting reality model, electronic equipment and storage medium | |
CN110533744B (en) | Method, device and system for synthesizing picture and mobile terminal | |
CN111107264A (en) | Image processing method, image processing device, storage medium and terminal | |
CN113391742B (en) | Data information output method and device, computer storage medium and electronic equipment | |
KR20210091874A (en) | Cosmetics matching service providing system using augmented reality and method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |