CN105843949A - Image display method and device - Google Patents
Image display method and device Download PDFInfo
- Publication number
- CN105843949A CN105843949A CN201610221920.5A CN201610221920A CN105843949A CN 105843949 A CN105843949 A CN 105843949A CN 201610221920 A CN201610221920 A CN 201610221920A CN 105843949 A CN105843949 A CN 105843949A
- Authority
- CN
- China
- Prior art keywords
- image
- predetermined image
- described predetermined
- feature
- display area
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9577—Optimising the visualization of content, e.g. distillation of HTML documents
Abstract
The invention discloses an image display method and device. The method comprises steps as follows: before a preset image is displayed, judging whether the preset image can be completely displayed in an image display area of the preset image under the condition that the total number of pixels of the preset image keeps unchanged; confirming information about positions of image features in the preset image if the judgment result is negative and the preset image contains the image features matched with preset image features; displaying the image parts which belong to the preset image and contain the image features in the image display area according to the position information. The method is used for solving the problem that the burden on a server is heavy due to the fact that an image is blindly cut to adapt to the size of the image display area in existing image display methods.
Description
Technical field
The application relates to field of computer technology, particularly relates to a kind of method for displaying image and device.
Background technology
At present, in order to enrich the content of website (or application (Application, APP)), it is often net
Stand (or APP) show the word of user to mix respective image, so that word content is best understood from.
Below as a example by news website, tell about conventional images Display Technique and analyze its drawback existed:
After user opens news website, this news website homepage can show headline and relevant figure.For
Making the single page can show more Word message and image information, this news website typically can will join
Figure viewing area arranges less.In such a situa-tion, if the figure viewing area institute in this news website
The total number of the pixel that can comprise is less than the total number of the pixel of figure, then this News Network's standing-meeting is to this figure
Carry out cutting, and the image section obtained by this figure carries out cutting is shown in figure viewing area.
Carry out above-mentioned figure due to this news website is randomness cutting, and this can cause display in figure viewing area
The picture material in territory and headline the probability not corresponded are relatively big, thus also allow for showing and show at this figure
Show that headline that image that the image in region can not make to show to this figure viewing area is relevant is preferably
The probability being understood is bigger.When picture material is not inconsistent with headline, user joins to be well understood to this
The meaning expressed by figure, image or this figure viewing area that typically can show this figure viewing area show
Headline corresponding to image operate further, such as, user can use triggering browser to clothes
Business device sends the mode of request, obtains in the complete image of figure corresponding to this headline of server feedback
Hold, thus cause the heavy load of server.
Summary of the invention
The embodiment of the present application provides a kind of method for displaying image, in order to solve image display side of the prior art
Method causes server to be born relatively in order to image is carried out the size being adapted to image display area blindly cutting
The problem of weight.
The embodiment of the present application provides a kind of image display device, in order to solve image display side of the prior art
Method causes server to be born relatively in order to image is carried out the size being adapted to image display area blindly cutting
The problem of weight.
The embodiment of the present application employing following technical proposals:
A kind of method for displaying image, including:
Before predetermined image is shown, it is judged that constant at the sum of all pixels mesh keeping described predetermined image
In the case of, whether described predetermined image can completely show for showing that the image of described predetermined image shows
In region;
When judged result is no, if described predetermined image comprises the image matched with pre-set image feature
Feature, it is determined that described characteristics of image is the information of location in described predetermined image;
According to the information of described position, described image display area show described predetermined image, comprise institute
State the image section of characteristics of image.
A kind of method for displaying image, including:
Before predetermined image is shown by client, it is judged that at the sum of all pixels mesh keeping described predetermined image
In the case of constant, whether described predetermined image can completely show at the figure for showing described predetermined image
As in viewing area;
When judged result is no, if described predetermined image comprises the image matched with pre-set image feature
Feature, it is determined that described characteristics of image is the information of location in described predetermined image;
The described characteristics of image determined information of location in described predetermined image is sent to client
End, so that client is according to the information of described position, shows described predetermined figure in described image display area
Picture, the image section that comprises described characteristics of image.
A kind of image display device, including:
Judge module, for before showing predetermined image, it is judged that at the picture keeping described predetermined image
In the case of element total number is constant, whether described predetermined image can completely show described predetermined for showing
In the image display area of image;
Position determination module, for when judged result is no, if comprising in described predetermined image and presetting figure
The characteristics of image matched as feature, it is determined that described characteristics of image is location in described predetermined image
Information;
Display module, for the information according to described position, shows described predetermined in described image display area
Image, the image section that comprises described characteristics of image.
A kind of image display device, including:
Judge module, for before predetermined image is shown by client, it is judged that keeping described predetermined figure
In the case of the sum of all pixels mesh of picture is constant, whether described predetermined image can completely show for showing
State in the image display area of predetermined image;
Position determination module, for when judged result is no, if comprising in described predetermined image and presetting figure
The characteristics of image matched as feature, it is determined that described characteristics of image is location in described predetermined image
Information;
Sending module, for the described characteristics of image letter of location in described predetermined image that will determine
Breath is sent to client, so that client is according to the information of described position, shows in described image display area
Image section that show described predetermined image, that comprise described characteristics of image.
At least one technical scheme above-mentioned that the embodiment of the present application uses can reach following beneficial effect:
Use such image display pattern, when the feelings constant at the sum of all pixels mesh keeping described predetermined image
Under condition, described predetermined image can not completely show in the image display area for showing described predetermined image
Time middle, if described predetermined image comprises the characteristics of image matched with pre-set image feature, then so that
The image section shown in image display area comprises the characteristics of image matched with pre-set image feature, thus
Avoid the need to be adapted to the size of image display area and image is carried out the image that blindly cutting causes and shows
The blindness shown, can alleviate server burden to a certain extent.
Accompanying drawing explanation
Accompanying drawing described herein is used for providing further understanding of the present application, constitutes of the application
Point, the schematic description and description of the application is used for explaining the application, is not intended that to the application not
Work as restriction.In the accompanying drawings:
A kind of method for displaying image that Fig. 1 a provides for the embodiment of the present application realize schematic flow sheet;
The image display area display effect for showing predetermined image that Fig. 1 b provides for the embodiment of the present application
Schematic diagram;
The predetermined image display effect schematic diagram that Fig. 1 c provides for the embodiment of the present application;
The predetermined image that Fig. 1 d provides for the embodiment of the present application and the image display area for showing predetermined image
Territory top and the display effect schematic diagram of leftmost side alignment;
Fig. 1 e for the embodiment of the present application provide described image display area show described predetermined image,
Comprise the image section display effect schematic diagram of the characteristics of image matched with pre-set image feature;
A kind of method for displaying image that Fig. 1 f provides for the embodiment of the present application realize schematic flow sheet;
The structural representation of a kind of image display device that Fig. 2 provides for the embodiment of the present application;
The structural representation of a kind of image display device that Fig. 3 provides for the embodiment of the present application.
Detailed description of the invention
For making the purpose of the application, technical scheme and advantage clearer, specifically real below in conjunction with the application
Execute example and technical scheme is clearly and completely described by corresponding accompanying drawing.Obviously, described
Embodiment is only some embodiments of the present application rather than whole embodiments.Based on the enforcement in the application
Example, the every other enforcement that those of ordinary skill in the art are obtained under not making creative work premise
Example, broadly falls into the scope of the application protection.
Below in conjunction with accompanying drawing, describe the technical scheme that each embodiment of the application provides in detail.
Embodiment 1
In order to solve method for displaying image of the prior art to be adapted to the size pair of image display area
Image carries out blindly cutting and causes the problem of server heavy load, and the embodiment of the present application provides a kind of image
Display packing.
The executive agent of the method, can be, but not limited to as mobile phone, panel computer or PC (Personal
Computer, PC) etc. run on user terminal, or those user terminals application (Application,
APP) etc..
For ease of describing, hereafter as a example by executive agent is as APP, the party that the embodiment of the present application is provided
Method is introduced.As it is shown in figure 1, for the embodiment of the present application provide the method implement flow chart,
Mainly comprise the steps:
Step 11, APP is before showing predetermined image, it is judged that at the total number of the pixel of predetermined image
In the case of constant, whether predetermined image can completely show in the image display area for showing predetermined image
In territory.
If judged result is no, then perform step 12;If the determination result is YES, then step 16 is performed.
Wherein, described predetermined image, is the image in described image display area to be shown.Specifically,
If APP is in response to the interface display triggering command of user, the interface comprising certain image i.e. will be shown,
So this image is properly termed as predetermined image.Such as, this APP is the APP for browsing news, then,
This APP instructs, in response to the news browsing of user, the image comprised in the news information that i.e. will show, can
It is referred to as predetermined image.Usually, this predetermined image is arranged by the server of APP or refers to
Fixed.
On the execution opportunity of step 11, be before APP will show the interface comprising this predetermined image, in other words
Before this predetermined image will being shown in this interface.
The shape of this predetermined image can include but not limited to the shapes such as rectangle, circle, triangle.In order to just
In subsequent descriptions, by described predetermined image be shaped as rectangle as a example by, illustrate.
Described image display area, for that comprise in interface to be shown, for showing described predetermined image
Viewing area.The shape of this image display area can include but not limited to the shapes such as rectangle, circle, triangle
Shape.For the ease of subsequent descriptions, by described image display area be shaped as rectangle as a example by, illustrate.
Described interface to be shown, could be for the user interface of display information.
Wherein, described interface to be shown, except including that described image display area is overseas, it is also possible to include but not
It is limited to the text importing region for showing Word message, or for showing the video display area of video information
Deng.
In order to make reader be easier to understand the concept of above-mentioned noun, below with above-mentioned APP as news type
APP, it is that the user interface about news information of above-mentioned APP (rear claims " the with interface to be shown
One interface ") as a example by, above-mentioned noun is carried out one by one to as directed.
Described first interface is in addition to comprising news figure, it is also possible to including but not limited at least one letter following
Breath:
Headline;
News in brief;
Video.
For showing that the viewing area of news figure is the image described in step 11 in described first interface
Viewing area.
The viewing area showing the Word message such as headline or news in brief in described first interface is institute
State text importing region.
The viewing area showing video information in described first interface is described video display area.
Described news figure, predetermined image the most specifically described herein.There is provided for ease of introducing the embodiment of the present application
Scheme, it is assumed that described news figure is the image operated without any cutting or scaling etc., this image quilt
Server is appointed as the predetermined image in image display area to be shown.
After the titles such as the predetermined image relating to the application, image display area carry out described above, below
Continue to use the example above, from the beginning of APP receives interface display instruction, introduce a kind of concrete real of step 11
Existing mode.
Sub-step 1, APP receives the first interface display instruction.
Described instruction, can be click on or the operational order such as slip.
Sub-step 2, the above-mentioned first interface display instruction of APP response, obtain predetermined image and predetermined image
Attribute.
The attribute of described predetermined image, can include but not limited to the length-width ratio of described predetermined image, described pre-
Determine maximum pixel number that image comprised in the horizontal direction (rear claim image level sum of all pixels mesh), described pre-
Determine maximum pixel number that image comprised (rear claim image vertical pixel total number) in vertical direction, and in advance
Determine the total number (rear title the first total number) of the pixel that image is comprised.When predetermined image is rectangle, institute
State the first total number=image level sum of all pixels mesh × image vertical pixel total number.
Described APP can get described predetermined image, and the attribute of described predetermined image from server.
Sub-step 3, APP determines the attribute of the image display area for showing predetermined image.
The attribute character of described image display area, includes but not limited to the length and width of described image display area
Maximum pixel number (the rear title zone level pixel that ratio, described image display area are comprised in the horizontal direction
Total number), the maximum pixel number that comprised in vertical direction of described image display area (rear claim region to hang down
Straight sum of all pixels mesh) and the total number (rear claim the second total number) of the pixel that can comprise of image display area
Deng.Wherein, when described image display area is rectangle, described second total number=zone level pixel is total
Number × region vertical pixel total number.
The layout of the user interface comprised due to described APP is all previously set, so,
Described APP can get the attribute of image display area.
Sub-step 4, it is judged that whether the first total number is more than the second total number.
If the determination result is YES, then judge in the case of the total number of the pixel of predetermined image is constant, described
Predetermined image can not completely show in the described image display area for showing predetermined image;If judging
Result is no, then perform sub-step 5.
The first total number and the second total number that are got by execution sub-step 2 and sub-step 3 are compared
Relatively, just may determine that whether the first total number is more than the second total number.
Sub-step 5, it is judged that whether described image level sum of all pixels mesh is less than described zone level sum of all pixels
Mesh, and whether described image vertical pixel total number is less than described region vertical pixel total number.
If judging, described image level sum of all pixels mesh is less than described zone level sum of all pixels mesh and described
Image vertical pixel total number is less than described region vertical pixel total number, then judge at described predetermined image
In the case of the total number of pixel is constant, described predetermined image can completely show in described image display area
In;Otherwise, then judge in the case of the total number of the pixel of described predetermined image is constant, described predetermined figure
As can imperfect display in described image display area.
Step 12, APP determines pre-set image feature.
Described pre-set image feature, can be directly get at server as pre-set image feature
Characteristics of image;Or, described pre-set image feature, it is also possible to be in described text importing region with to be shown
In the characteristics of image that is associated of Word message.Wherein, described pre-set image feature, can be, but not limited to people
The characteristics of image such as face feature, animal painting feature or article characteristics.
Illustrate how described APP determines described pre-set image feature in detail below:
Sub-step a, obtains the Word message in described text importing region to be shown.
Described APP can get the word in described text importing region to be shown letter in the server
Breath (the hereinafter referred to as first Word message).
Sub-step b, according to the incidence relation of Word message Yu pre-set image feature, determines and described first literary composition
The pre-set image feature that word information is associated.
Described APP, can be by carrying out semanteme to the first Word message after getting the first Word message
Analyze, automatically generate the summary of the first Word message, and extract the key word of the first Word message.According to
The summary of described first Word message, and the key word of described first Word message, determine and meet word
The Word message of constraints.Wherein, the key word of the first Word message, can be at the first Word message
Summary in frequency of occurrence more than preset frequency threshold value word.
Wherein, if the quantity of the key word of the first Word message extracted is one, then described satisfied literary composition
The Word message of word constraints, is this key word.
If the quantity of the key word of the first Word message extracted is more than one, then described meet word constraint
The Word message of condition, can be the word randomly selected from the key word extracted.
After determining the Word message meeting word constraints, described APP can be according to pre-set image
Feature and the incidence relation of Word message, determine described pre-set image feature.
Sometimes, described APP is except can be according to the incidence relation of described pre-set image feature Yu Word message
Determine outside described pre-set image feature, it is also possible to according to described pre-set image feature and described image display area
Incidence relation between territory determines described pre-set image feature.
It addition, described APP can also be according to the title of described pre-set image feature and described predetermined image
Incidence relation determines described pre-set image feature.
Wherein, described pre-set image feature and Word message, described image display area and described predetermined figure
Incidence relation between the title of picture, can be previously set by technical staff and upload in server, when
Described predetermined image will be shown before described image display area by described APP, just can be from server
Those incidence relations of middle acquisition, so that it is determined that go out described pre-set image feature.
How the most specifically introduce described APP according to pre-set image feature and Word message
Incidence relation determines described pre-set image feature:
Situation one:
When described APP is after determining the Word message meeting word constraints, described APP can be in order to
With the text classifier trained, the described Word message meeting word constraints is classified, if than
The described Word message meeting word constraints is " Cheng Long ", then described APP can utilize and train
Text classifier " Cheng Long " is classified as name classification;If the described word letter meeting word constraints
Breath is " Cibotium barometz (L.) J. Sm. ", then described APP can utilize the text classifier trained " Cibotium barometz (L.) J. Sm. " to be returned
Class is animal category;If the described Word message meeting word constraints is " automobile ", then described APP
Can utilize the text classifier trained that " automobile " is classified as goods categories.
Wherein, described in the text classifier that trains, Word message can be referred to some and give
Grader in classification.
The incidence relation of described pre-set image feature and Word message, can be, but not limited to pre-set image feature with
The incidence relation of the incidence relation of name classification, pre-set image feature and animal category, or pre-set image is special
Levy the incidence relation etc. with goods categories.
If the described Word message meeting word constraints determined is classified, really by described APP
Make after this Word message meeting word constraints belongs to name classification, can be according to pre-set image feature
With the incidence relation of name classification, determine that described pre-set image feature is face characteristic.
Situation two:
When described APP is after determining the Word message meeting word constraints, can be directly in service
Device searches whether to exist associating of this Word message meeting word constraints and pre-set image feature
System, if finding, then directly determines described pre-set image feature according to these mapping relations;If search less than,
Then acquiescence face characteristic is described pre-set image feature.
Wherein, technical staff can set up associating of relatively common noun and pre-set image feature the most one by one
Relation, for example, it is possible to set up the incidence relation of " Cheng Long " and face characteristic, or sets up " Cibotium barometz (L.) J. Sm. "
With the incidence relation of animal painting feature, or set up the incidence relation etc. of " automobile " and images of items feature.
It addition, technical staff can also set, when finding the word meeting word constraints determined
During the incidence relation of information and pre-set image feature, acquiescence face characteristic is described pre-set image feature.
Step 13, APP judges whether comprise the figure matched with pre-set image feature in described predetermined image
As feature.
If the determination result is YES, step 14 is performed;If judged result is no, then perform step 17.
Wherein, the described characteristics of image that matches with pre-set image feature can be and pre-set image characteristic type
Identical characteristics of image, and the number of the characteristics of image matched with pre-set image feature is one.
Tell about described APP below to judge whether described predetermined image comprises and match with pre-set image feature
The method of characteristics of image:
The embodiment of the present application can utilize in described APP with open-source cross-platform computer vision storehouse (Open
Source Computer Vision Library, OPENCV) there is the functional module of identical function, judge
Whether described predetermined image comprises the characteristics of image matched with pre-set image feature.
Wherein, described OPENCV, it is made up of a series of C language functions, is to computer vision, figure
As the aspects such as process and image recognition carry out the ideal tools of secondary development, may be used for image recognition.
If assuming, the described pre-set image feature that described APP determines by performing step 12 is that face is special
Levy, then having in the functional module of identical function with OPENCV in described APP can add knowledge
The code of other face characteristic, and run this functional module, judge whether described predetermined image comprises face
Feature, and obtain judged result.
Described APP may determine that in described predetermined image whether comprise outside face characteristic, it is also possible to
To when judging the result comprising face characteristic in described predetermined image, identify in described predetermined image and comprise
Whole face characteristics.If the quantity of the face characteristic that described APP identifies is more than one, then described APP
Need at least two face characteristic, select a face characteristic and match as with pre-set image feature
Characteristics of image.
The characteristics of image matched with pre-set image feature can be determined by following method:
Sub-step S1, it is judged that whether the quantity of the face in described predetermined image is more than one.
If the determination result is YES, then sub-step S2 is performed;If judged result is face that is no, then that will identify that
Feature is as the face characteristic determined.
Sub-step S2, selects the face meeting face constraints from the face identified, this is met
The face of face constraints is as the face characteristic determined.
Wherein, face constraints, can be that the total number of the pixel of individual human face is maximum.If exist simultaneously
The situation that the total number of the pixel of at least two individual human face is maximum, chooses and is in described predetermined image pars intermedia
The face of position is as the characteristics of image matched with pre-set image feature.
Step 14, APP determines that the characteristics of image matched with pre-set image feature is at described predetermined image
The information of middle location.
Described APP can determine, by following method, the characteristics of image matched with pre-set image feature
The information of location in described predetermined image:
Such as, it is assumed that by trisection in described predetermined image vertical direction, then described predetermined image is just divided
Become three parts that the total number comprising pixel is identical, i.e. top, middle part and bottom.Determine above-mentioned face
Central point (or any point) is in which part in described top, middle part or bottom, just defines
Characteristics of image is the information of location in described predetermined image.
It should be strongly noted that it can also be assumed that by the described predetermined image quartering, five deciles or six deciles
Deng, this is not defined by the embodiment of the present application.
Step 15, described APP is according to the information by performing the position that step 14 is determined, at described figure
Figure that show described predetermined image as viewing area, that comprise the characteristics of image matched with pre-set image feature
As part.
Information according to described position, described image level sum of all pixels mesh and vertical pixel total number, and
Zone level sum of all pixels mesh and region vertical pixel total number, show described pre-in described image display area
Image section that determine image, that comprise described characteristics of image.
Described APP is according to the position determined by execution step 14 to divide three kinds of situations to illustrate respectively below
Information, described image display area show described predetermined image, comprise and match with pre-set image feature
The image section of characteristics of image:
Situation one:
Wherein, in order to preferably make reader understand described APP how to show described predetermined image, comprise
With the image section of the characteristics of image that pre-set image feature matches, below in conjunction with Fig. 1 b, Fig. 1 c, Fig. 1 d
With Fig. 1 e, situation one is illustrated:
Fig. 1 b and Fig. 1 c is in the case of same screen resolution, and described image display area is pre-with described
Determine the display effect of image.Wherein, the embodiment of the present application is vertical less than image with image level sum of all pixels mesh
Illustrate as a example by sum of all pixels mesh.
If determining that the central point (or any point) of described face is in described pre-by performing step 14
Determine the top (seeing Fig. 1 c) of image, then the top of predetermined image and described image display area are pushed up most
End alignment, and is alignd in the leftmost side of the predetermined image leftmost side with described image display area (seeing Fig. 1 d)
(or being alignd in the rightmost side of the predetermined image rightmost side with described image display area).Keeping described pre-
Determine what the top of image and the leftmost side overlapped with the top of described image display area and the leftmost side all the time
In the case of (or keep the top of described predetermined image and the rightmost side all the time with described image display area
Top and the rightmost side alignment in the case of), equal proportion amplify (or reducing) described predetermined image,
Align with the rightmost side of described image display area (or by predetermined figure in the rightmost side making described predetermined image
As aliging in the leftmost side of the leftmost side with described image display area) (seeing Fig. 1 e).
Now, it is positioned at the image section in described image display area, is described predetermined image, comprises
The image section (seeing Fig. 1 e) of described characteristics of image.Visible, by such operation, above-mentioned APP can
By described predetermined image, the image section that comprises described characteristics of image shows in described image display area
In.
Situation two: if determine central point (or any point) place of described face by performing step 14
In the middle part of described predetermined image, just by the central point of the central point of described predetermined image Yu image display area
Overlap.In the case of the central point keeping described predetermined image overlaps with the central point of image display area,
Predetermined image is carried out equal proportion scaling, so that the both sides at the place, long limit of predetermined image can show with image
Show the both sides alignment that region is corresponding.Such as, if the limit at the place, long limit of described predetermined image is described predetermined
Limit in image vertical direction, then equal proportion scales, so that the leftmost side of predetermined image and the rightmost side can
To align with the leftmost side of described image display area and the rightmost side.Now, it is positioned at described image display area
In image section, be described predetermined image, comprise the image section of described characteristics of image.It is visible,
By such operation, above-mentioned APP can be by described predetermined image, the image that comprises described characteristics of image
It is partially shown in image display area.
Situation three: if determine central point (or any point) place of described face by performing step 14
In the bottom of described predetermined image, then the lowermost end of predetermined image is alignd with image display area lowermost end,
And is alignd with the leftmost side of described image display area in the predetermined image leftmost side (or predetermined image is the rightest
Align with the rightmost side of described image display area in side).Keeping the lowermost end of described predetermined image and the most left
In the case of aliging with the lowermost end of described image display area and the leftmost side all the time in side (or keeping described
The lowermost end of predetermined image and the rightmost side overlap with lowermost end and the rightmost side of described image display area all the time
In the case of), equal proportion amplifies (or reducing) described predetermined image, so that described predetermined image
Can align the both sides corresponding with image display area in the both sides at place, long limit.Such as, if described predetermined figure
The limit at the place, long limit of picture is the limit in described predetermined image vertical direction, then equal proportion zoom to so that
The leftmost side of predetermined image and the rightmost side can overlap with the leftmost side of image display area and the rightmost side.This
Time, the image section being positioned in image display area is described predetermined image, it is special to comprise described image
The image section levied.Visible, by such operation, above-mentioned APP can be by described predetermined image, bag
Image section containing described characteristics of image shows in image display area.
Step 16, described predetermined image is completely shown in image display area by described APP.
Described APP can not change the first total number, directly completely shows described predetermined image at image
Viewing area.Can also ensure that described image level sum of all pixels mesh is less than zone level sum of all pixels mesh water
Flat sum of all pixels mesh, and described image vertical pixel total number is less than the situation of region vertical pixel total number
Under, show in image display area after suitable for described predetermined image equal proportion is amplified.
Step 17, the display mode being previously set according to described APP developer shows.
The display mode that described APP developer is previously set, can be following display mode:
Predetermined image is reduced process, and the full content comprised by predetermined image shows in image display area
Territory.
It should be strongly noted that sometimes, by performing step 14 and step 15, may by with
The characteristics of image that pre-set image feature matches completely shows in described image display area.So, at this moment,
Just can perform operations described below, reach completely to show the effect of the characteristics of image matched with pre-set image feature
Really:
Directly cut out and comprise by performing the image matched with pre-set image feature that step 14 is determined
The image section of feature, and this image section is suitably scaled, display is in image display area.
Wherein, described suitable scaling, it is to ensure that the image level picture of the above-mentioned image section obtained through cutting
Element total number is less than zone level sum of all pixels mesh, and guarantees the figure of the above-mentioned image section obtained through cutting
As vertical pixel total number is less than region vertical pixel total number, so that the above-mentioned image obtained through cutting
Part can completely show in image display area.
The executive agent of each step of the embodiment of the present application can be distinct device.Such as, step 11~14
Executive agent can be server, step 15~17 executive agent can be client.The simplest
In the case of introducing different executive agent, how to show predetermined image in described image display area, specifically real
Existing flow process can be found in Fig. 1 f:
Step 21, server is before showing predetermined image, it is judged that at the sum of the pixel of predetermined image
In the case of mesh is constant, whether predetermined image can completely show for showing that the image of predetermined image shows
In region.
If judged result is no, then perform step 22;If the determination result is YES, then step 28 is performed.
Step 22, server determines pre-set image feature.
Step 23, server judges whether comprise the figure matched with pre-set image feature in described predetermined image
As feature.
If the determination result is YES, step 24 is performed;If judged result is no, then perform step 31.
Step 24, server determines that the characteristics of image matched with pre-set image feature is at described predetermined image
The information of middle location.
Step 25, server is by by performing the figure matched with pre-set image feature that step 24 is determined
As feature information and predetermined image of location in described predetermined image is sent to client.
Step 26, client receives the characteristics of image matched with pre-set image feature that server sends in institute
State information and the predetermined image of location in predetermined image.
Step 27, client according to the characteristics of image matched with pre-set image feature in described predetermined image
The information of location, described image display area show described predetermined image, comprise with preset figure
Image section as the characteristics of image that feature matches.
Step 28, predetermined image is sent to client by server.
Step 29, client receives the predetermined image that server sends.
Step 30, described predetermined image is completely shown in image display area by client.
Step 31, predetermined image is sent to client by server.
Step 32, client receives the predetermined image that server sends.
Step 33, the display mode that client is previously set according to described APP developer shows.
Use such image display pattern, when the feelings constant at the sum of all pixels mesh keeping described predetermined image
Under condition, described predetermined image can not completely show in the image display area for showing described predetermined image
Time middle, if described predetermined image comprises the characteristics of image matched with pre-set image feature, then so that
The image section shown in image display area comprises the characteristics of image matched with pre-set image feature, thus
Avoid the need to be adapted to the size of image display area and image is carried out the image that blindly cutting causes and shows
The blindness shown, can alleviate server burden to a certain extent.
Embodiment 2
In order to solve method for displaying image of the prior art to be adapted to the size pair of image display area
Image carries out blindly cutting and causes the problem of server heavy load, and the embodiment of the present application provides a kind of image
Display device.
As in figure 2 it is shown, the structural representation of this device provided for the embodiment of the present application, mainly include following
Device:
Judge module 21, for before showing predetermined image, it is judged that is keeping described predetermined image
In the case of sum of all pixels mesh is constant, whether described predetermined image can completely show described pre-for showing
Determine in the image display area of image.
Position determination module 22, for when judged result is no, if comprising in described predetermined image and presetting
The characteristics of image that characteristics of image matches, it is determined that the position that described characteristics of image is residing in described predetermined image
The information put.
Display module 23, for the information according to described position, shows described pre-in described image display area
Image section that determine image, that comprise described characteristics of image.
Wherein, the described image display area for showing described predetermined image, for interface Zhong Bao to be shown
The image display area for showing described predetermined image contained;Described interface to be shown, described except including
Image display area is overseas, also includes the text importing region for showing Word message.
Described pre-set image feature, is the characteristics of image being associated with described Word message.
Position determination module 22, including:
Acquiring unit, for when the judged result that judge module obtains is no, obtains to be shown at described literary composition
Word message in word viewing area.
Characteristics determining unit, for the incidence relation according to Word message Yu pre-set image feature, determines and obtains
The pre-set image feature that the Word message got is associated.
Position determination unit, if for according to the pre-set image feature determined, it is judged that described predetermined image
In comprise the characteristics of image matched with pre-set image feature, it is determined that described characteristics of image is at described predetermined figure
The information of location in Xiang.
In one embodiment, characteristics determining unit, specifically for:
From the Word message got, determine the Word message meeting word constraints;
According to the incidence relation of Word message Yu pre-set image feature, determine and meet word constraints with described
The pre-set image feature that is associated of Word message.
Described pre-set image feature includes: face characteristic;Position determination module 22, specifically for:
If described predetermined image comprises the characteristics of image matched with described face characteristic, then judge described pre-
Whether determine the quantity of the face that image comprises more than one;
If judging, described quantity more than one, is then chosen in the face comprised from described predetermined image and is met people
The face of face constraints, and determine the information of the face selected position in described predetermined image.
In one embodiment, display module 23, specifically for:
The pixel in horizontal direction that information according to described position, described image display area are comprised total
Pixel on the total number of the pixel on number and vertical direction, and the horizontal direction of described predetermined image
The total number of the pixel on total number and vertical direction, shows described predetermined image in described image display area
, the image section comprising described characteristics of image.
Use such image display pattern, when the feelings constant at the sum of all pixels mesh keeping described predetermined image
Under condition, described predetermined image can not completely show in the image display area for showing described predetermined image
Time middle, if described predetermined image comprises the characteristics of image matched with pre-set image feature, then so that
The image section shown in image display area comprises the characteristics of image matched with pre-set image feature, thus
Avoid the need to be adapted to the size of image display area and image is carried out the image that blindly cutting causes and shows
The blindness shown, can alleviate server burden to a certain extent.
Embodiment 3
In order to solve method for displaying image of the prior art to be adapted to the size pair of image display area
Image carries out blindly cutting and causes the problem of server heavy load, and the embodiment of the present application provides a kind of image
Display device.
As it is shown on figure 3, the structural representation of this device provided for the embodiment of the present application, mainly include following
Device:
Judge module 31, for before predetermined image is shown by client, it is judged that keeping predetermined image
Sum of all pixels mesh constant in the case of, whether described predetermined image can completely show described for showing
In the image display area of predetermined image.
Position determination module 32, for when judged result is no, if comprising in described predetermined image and presetting
The characteristics of image that characteristics of image matches, it is determined that the position that described characteristics of image is residing in described predetermined image
The information put.
Sending module 33, for the described characteristics of image location in described predetermined image that will determine
Information is sent to client, so that client is according to the information of described position, in described image display area
Image section that show described predetermined image, that comprise described characteristics of image.
Use such image display pattern, when the feelings constant at the sum of all pixels mesh keeping described predetermined image
Under condition, described predetermined image can not completely show in the image display area for showing described predetermined image
Time middle, if described predetermined image comprises the characteristics of image matched with pre-set image feature, then so that
The image section shown in image display area comprises the characteristics of image matched with pre-set image feature, thus
Avoid the need to be adapted to the size of image display area and image is carried out the image that blindly cutting causes and shows
The blindness shown, can alleviate server burden to a certain extent.
Those skilled in the art are it should be appreciated that embodiments herein can be provided as method, system or meter
Calculation machine program product.Therefore, the application can use complete hardware embodiment, complete software implementation or knot
The form of the embodiment in terms of conjunction software and hardware.And, the application can use and wherein wrap one or more
Computer-usable storage medium containing computer usable program code (include but not limited to disk memory,
CD-ROM, optical memory etc.) form of the upper computer program implemented.
The application is with reference to method, equipment (system) and the computer program product according to the embodiment of the present application
The flow chart of product and/or block diagram describe.It should be understood that can by computer program instructions flowchart and
/ or block diagram in each flow process and/or flow process in square frame and flow chart and/or block diagram and/
Or the combination of square frame.These computer program instructions can be provided to general purpose computer, special-purpose computer, embedding
The processor of formula datatron or other programmable data processing device is to produce a machine so that by calculating
The instruction that the processor of machine or other programmable data processing device performs produces for realizing at flow chart one
The device of the function specified in individual flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and computer or the process of other programmable datas can be guided to set
In the standby computer-readable memory worked in a specific way so that be stored in this computer-readable memory
Instruction produce and include the manufacture of command device, this command device realizes in one flow process or multiple of flow chart
The function specified in flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, makes
Sequence of operations step must be performed to produce computer implemented place on computer or other programmable devices
Reason, thus the instruction performed on computer or other programmable devices provides for realizing flow chart one
The step of the function specified in flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
In a typical configuration, calculating equipment includes one or more processor (CPU), input/defeated
Outgoing interface, network interface and internal memory.
Internal memory potentially includes the volatile memory in computer-readable medium, random access memory
(RAM) and/or the form such as Nonvolatile memory, such as read only memory (ROM) or flash memory (flash RAM).
Internal memory is the example of computer-readable medium.
Computer-readable medium includes that removable media permanent and non-permanent, removable and non-can be by appointing
Where method or technology realize information storage.Information can be computer-readable instruction, data structure, program
Module or other data.The example of the storage medium of computer includes, but are not limited to phase transition internal memory
(PRAM), static RAM (SRAM), dynamic random access memory (DRAM), its
The random access memory (RAM) of his type, read only memory (ROM), electrically erasable are read-only
Memorizer (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read only memory
(CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tape, tape magnetic
Disk storage or other magnetic storage apparatus or any other non-transmission medium, can be used for storage can be calculated
The information that equipment accesses.According to defining herein, computer-readable medium does not include temporary computer-readable matchmaker
Body (transitory media), such as data signal and the carrier wave of modulation.
Also, it should be noted term " includes ", " comprising " or its any other variant are intended to non-
Comprising of exclusiveness, so that include that the process of a series of key element, method, commodity or equipment not only wrap
Include those key elements, but also include other key elements being not expressly set out, or also include for this process,
The key element that method, commodity or equipment are intrinsic.In the case of there is no more restriction, statement " include
One ... " key element that limits, it is not excluded that in including the process of key element, method, commodity or equipment
There is also other identical element.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer journey
Sequence product.Therefore, the application can use complete hardware embodiment, complete software implementation or combine software and
The form of the embodiment of hardware aspect.And, the application can use and wherein include calculating one or more
The computer-usable storage medium of machine usable program code (include but not limited to disk memory, CD-ROM,
Optical memory etc.) form of the upper computer program implemented.
These are only embodiments herein, be not limited to the application.For people in the art
For Yuan, the application can have various modifications and variations.All made within spirit herein and principle
Any modification, equivalent substitution and improvement etc., within the scope of should be included in claims hereof.
Claims (14)
1. a method for displaying image, it is characterised in that described method includes:
Before predetermined image is shown, it is judged that constant at the sum of all pixels mesh keeping described predetermined image
In the case of, whether described predetermined image can completely show for showing that the image of described predetermined image shows
In region;When judged result is no, match if described predetermined image comprises with pre-set image feature
Characteristics of image, it is determined that described characteristics of image is the information of location in described predetermined image;
According to the information of described position, described image display area show described predetermined image, comprise institute
State the image section of characteristics of image.
2. the method for claim 1, it is characterised in that described for showing described predetermined image
Image display area, for interface to be shown comprises for showing that the image of described predetermined image shows
Region;Described interface to be shown, except including that described image display area is overseas, also includes for showing word
The text importing region of information;
Described pre-set image feature, is the characteristics of image being associated with described Word message.
3. the method for claim 1, it is characterised in that when judged result is no, if described
Predetermined image comprises the characteristics of image matched with pre-set image feature, it is determined that described characteristics of image is in institute
State the information of location in predetermined image, including:
When judged result is no, obtain the Word message in described text importing region to be shown;
According to the incidence relation of Word message Yu pre-set image feature, determine relevant to the Word message got
The pre-set image feature of connection;
If according to the pre-set image feature determined, it is judged that described predetermined image comprises special with pre-set image
Levy the characteristics of image matched, it is determined that described characteristics of image is the letter of location in described predetermined image
Breath.
4. method as claimed in claim 3, it is characterised in that special with pre-set image according to Word message
The incidence relation levied, determines the pre-set image feature being associated with the Word message got, including:
From the Word message got, determine the Word message meeting word constraints;
According to the incidence relation of Word message Yu pre-set image feature, determine and meet word constraints with described
The pre-set image feature that is associated of Word message.
5. the method for claim 1, it is characterised in that described pre-set image feature includes: people
Face feature;
If described predetermined image comprises the characteristics of image matched with pre-set image feature, it is determined that described figure
Picture feature information of location in described predetermined image, including:
If described predetermined image comprises the characteristics of image matched with described face characteristic, then judge described pre-
Whether determine the quantity of the face that image comprises more than one;
If judging, described quantity more than one, is then chosen in the face comprised from described predetermined image and is met people
The face of face constraints, and determine the information of the face selected position in described predetermined image.
6. the method for claim 1, it is characterised in that according to the information of described position, in institute
State image section that image display area shows described predetermined image, that comprise described characteristics of image, specifically wrap
Include:
The pixel in horizontal direction that information according to described position, described image display area are comprised total
Pixel on the total number of the pixel on number and vertical direction, and the horizontal direction of described predetermined image
The total number of the pixel on total number and vertical direction, shows described predetermined image in described image display area
, the image section comprising described characteristics of image.
7. a method for displaying image, it is characterised in that described method includes:
Before predetermined image is shown by client, it is judged that at the sum of all pixels mesh keeping described predetermined image
In the case of constant, whether described predetermined image can completely show at the figure for showing described predetermined image
As in viewing area;
When judged result is no, if described predetermined image comprises the image matched with pre-set image feature
Feature, it is determined that described characteristics of image is the information of location in described predetermined image;
The described characteristics of image determined information of location in described predetermined image is sent to client
End, so that client is according to the information of described position, shows described predetermined figure in described image display area
Picture, the image section that comprises described characteristics of image.
8. an image display device, it is characterised in that described device includes:
Judge module, for before showing predetermined image, it is judged that at the picture keeping described predetermined image
In the case of element total number is constant, whether described predetermined image can completely show described predetermined for showing
In the image display area of image;
Position determination module, for when judged result is no, if comprising in described predetermined image and presetting figure
The characteristics of image matched as feature, it is determined that described characteristics of image is location in described predetermined image
Information;
Display module, for the information according to described position, shows described predetermined in described image display area
Image, the image section that comprises described characteristics of image.
9. device as claimed in claim 8, it is characterised in that described for showing described predetermined image
Image display area, for interface to be shown comprises for showing that the image of described predetermined image shows
Region;Described interface to be shown, except including that described image display area is overseas, also includes for showing word
The text importing region of information;
Described pre-set image feature, is the characteristics of image being associated with described Word message.
10. device as claimed in claim 7, it is characterised in that position determination module, including:
Acquiring unit, for when the judged result that judge module obtains is no, obtains to be shown at described literary composition
Word message in word viewing area;
Characteristics determining unit, for the incidence relation according to Word message Yu pre-set image feature, determines and obtains
The pre-set image feature that the Word message got is associated;
Position determination unit, if for according to the pre-set image feature determined, it is judged that described predetermined image
In comprise the characteristics of image matched with pre-set image feature, it is determined that described characteristics of image is at described predetermined figure
The information of location in Xiang.
11. devices as claimed in claim 10, it is characterised in that characteristics determining unit, specifically for:
From the Word message got, determine the Word message meeting word constraints;
According to the incidence relation of Word message Yu pre-set image feature, determine and meet word constraints with described
The pre-set image feature that is associated of Word message.
12. devices as claimed in claim 8, it is characterised in that described pre-set image feature includes: people
Face feature;
Position determination module, specifically for:
If described predetermined image comprises the characteristics of image matched with described face characteristic, then judge described pre-
Whether determine the quantity of the face that image comprises more than one;
If judging, described quantity more than one, is then chosen in the face comprised from described predetermined image and is met people
The face of face constraints, and determine the information of the face selected position in described predetermined image.
13. devices as claimed in claim 8, it is characterised in that display module, specifically for:
The pixel in horizontal direction that information according to described position, described image display area are comprised total
Pixel on the total number of the pixel on number and vertical direction, and the horizontal direction of described predetermined image
The total number of the pixel on total number and vertical direction, shows described predetermined image in described image display area
, the image section comprising described characteristics of image.
14. 1 kinds of image display devices, it is characterised in that described device includes:
Judge module, for before predetermined image is shown by client, it is judged that keeping described predetermined figure
In the case of the sum of all pixels mesh of picture is constant, whether described predetermined image can completely show for showing
State in the image display area of predetermined image;
Position determination module, for when judged result is no, if comprising in described predetermined image and presetting figure
The characteristics of image matched as feature, it is determined that described characteristics of image is location in described predetermined image
Information;
Sending module, for the described characteristics of image letter of location in described predetermined image that will determine
Breath is sent to client, so that client is according to the information of described position, shows in described image display area
Image section that show described predetermined image, that comprise described characteristics of image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610221920.5A CN105843949B (en) | 2016-04-11 | 2016-04-11 | A kind of image display method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610221920.5A CN105843949B (en) | 2016-04-11 | 2016-04-11 | A kind of image display method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105843949A true CN105843949A (en) | 2016-08-10 |
CN105843949B CN105843949B (en) | 2019-07-16 |
Family
ID=56597208
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610221920.5A Active CN105843949B (en) | 2016-04-11 | 2016-04-11 | A kind of image display method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105843949B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103984738A (en) * | 2014-05-22 | 2014-08-13 | 中国科学院自动化研究所 | Role labelling method based on search matching |
CN104281644A (en) * | 2014-08-22 | 2015-01-14 | 广州三星通信技术研究有限公司 | Filename information display method and device |
CN104504651A (en) * | 2015-01-22 | 2015-04-08 | 网易(杭州)网络有限公司 | Preview generation method and device |
US9129550B2 (en) * | 2011-07-21 | 2015-09-08 | Flipboard, Inc. | Adjusting orientation of content regions in a page layout |
CN105205780A (en) * | 2015-10-19 | 2015-12-30 | 新华瑞德(北京)网络科技有限公司 | Picture cropping method and device |
-
2016
- 2016-04-11 CN CN201610221920.5A patent/CN105843949B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9129550B2 (en) * | 2011-07-21 | 2015-09-08 | Flipboard, Inc. | Adjusting orientation of content regions in a page layout |
CN103984738A (en) * | 2014-05-22 | 2014-08-13 | 中国科学院自动化研究所 | Role labelling method based on search matching |
CN104281644A (en) * | 2014-08-22 | 2015-01-14 | 广州三星通信技术研究有限公司 | Filename information display method and device |
CN104504651A (en) * | 2015-01-22 | 2015-04-08 | 网易(杭州)网络有限公司 | Preview generation method and device |
CN105205780A (en) * | 2015-10-19 | 2015-12-30 | 新华瑞德(北京)网络科技有限公司 | Picture cropping method and device |
Also Published As
Publication number | Publication date |
---|---|
CN105843949B (en) | 2019-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107256109B (en) | Information display method and device and terminal | |
US11582292B2 (en) | Real-time content integration based on machine learned selections | |
CA3102222C (en) | Method, device, terminal equipment and storage medium of sharing personal information | |
AU2014309040B9 (en) | Presenting fixed format documents in reflowed format | |
CN107066174A (en) | Floating layer display methods, device and user terminal | |
CN107766349B (en) | Method, device, equipment and client for generating text | |
CN103246678A (en) | Method and device for previewing web page contents | |
WO2021184896A1 (en) | Page screenshot method and device | |
CN106919571A (en) | Obtain the method and device of the picture matched with search keyword | |
US11601391B2 (en) | Automated image processing and insight presentation | |
US20210072880A1 (en) | Method and electronic device for generating at least one data item from screenshot | |
EP3782048A1 (en) | Action indicators for search operation output elements | |
CN112988006A (en) | Display method, display device, electronic equipment and storage medium | |
US20200097536A1 (en) | Automatic generation of document layouts | |
WO2019018062A1 (en) | Organizing images automatically into image grid layout | |
CN106446027A (en) | Information recommendation method and apparatus | |
CN116483488A (en) | Screen display method, device, electronic equipment and readable storage medium | |
JP2018190091A (en) | Retrieval program, retrieval device and retrieval method | |
CN103886036B (en) | A kind of method and apparatus for the page to be presented | |
CN106776634A (en) | A kind of method for network access, device and terminal device | |
CN105843949A (en) | Image display method and device | |
CN111915637B (en) | Picture display method and device, electronic equipment and storage medium | |
CN112950167A (en) | Design service matching method, device, equipment and storage medium | |
CN112286613A (en) | Interface display method and interface display device | |
CN112948629A (en) | Content distribution method and device, electronic equipment and computer storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 100085 information Road No. 2, Haidian District, Beijing (Beijing 1-8, D 2-2), two storey 207A room. Applicant after: Kylin seing network technology Limited by Share Ltd Address before: 100085 information Road No. 2, Haidian District, Beijing (Beijing 1-8, D 2-2), two storey 207A room. Applicant before: BEIJING KYLIN HESHENG NETWORK TECHNOLOGY CO., LTD. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |