CN108737882A - Display methods, device, storage medium and the electronic device of image - Google Patents
Display methods, device, storage medium and the electronic device of image Download PDFInfo
- Publication number
- CN108737882A CN108737882A CN201810437765.XA CN201810437765A CN108737882A CN 108737882 A CN108737882 A CN 108737882A CN 201810437765 A CN201810437765 A CN 201810437765A CN 108737882 A CN108737882 A CN 108737882A
- Authority
- CN
- China
- Prior art keywords
- image frame
- image
- width
- height
- size
- 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
- 238000000034 method Methods 0.000 title claims abstract description 59
- 230000015654 memory Effects 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 15
- 230000000694 effects Effects 0.000 abstract description 16
- 238000005516 engineering process Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 27
- 230000005540 biological transmission Effects 0.000 description 4
- 230000000007 visual effect Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000002452 interceptive effect Effects 0.000 description 3
- 238000005034 decoration Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/431—Generation of visual interfaces for content selection or interaction; Content or additional data rendering
- H04N21/4312—Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/235—Processing of additional data, e.g. scrambling of additional data or processing content descriptors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/435—Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/482—End-user interface for program selection
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/482—End-user interface for program selection
- H04N21/4825—End-user interface for program selection using a list of items to be played back in a given order, e.g. playlists
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/81—Monomedia components thereof
- H04N21/8146—Monomedia components thereof involving graphical data, e.g. 3D object, 2D graphics
- H04N21/8153—Monomedia components thereof involving graphical data, e.g. 3D object, 2D graphics comprising still images, e.g. texture, background image
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Human Computer Interaction (AREA)
- Computer Graphics (AREA)
- Controls And Circuits For Display Device (AREA)
Abstract
The invention discloses a kind of display methods of image, device, storage medium and electronic devices.Wherein, this method includes:The first picture frame is obtained from multimedia data stream being played on;Picture size and target image size in the first picture frame is unmatched, the second picture frame that wide high proportion is the first ratio is intercepted from the first picture frame, wherein, target image size is the size of the corresponding destination display area of multimedia data stream, and the first ratio is the ratio of the width of target image size and the height of target image size;It is target image size by the second picture frame uniform zoom to picture size, obtains target image;In destination display area display target image.The present invention solves the poor technical problem of surface plot display effect of multimedia data stream in the related technology.
Description
Technical Field
The present invention relates to the field of computers, and in particular, to a method and an apparatus for displaying an image, a storage medium, and an electronic apparatus.
Background
In recent years, live broadcast products are more and more popular. In order to make the viewer more directly know the current live content, a live stream is usually captured in real time in a live list (or a search list, etc.) as a cover-view display. The audience can know the approximate content and progress of the current live broadcast from the cover picture without entering a live broadcast interface.
Due to the fact that different terminal devices are different in using mode, the sizes of the real-time screenshots are different, the typesetting and the user visual experience must be considered for the live list, and therefore the front cover picture is displayed in a fixed size. For the case that the real-time screenshot and the cover picture have different specified sizes, the current solution is to compress or stretch the real-time screenshot into the required width and height size forcibly, or to reduce the aspect ratio of the picture into the required size range. For the scheme of forcibly compressing or amplifying the real-time screenshot into the required width and height, the screenshot of the horizontal screen can be elongated when being converted into the vertical screen, the screenshot of the vertical screen looks like being flattened when being converted into the horizontal screen, the shape of the picture is seriously distorted, and the visual effect is poor. For the scheme of reducing the aspect ratio of the picture to be within the required size range, only one dimension of width or height may meet the final requirement after the picture is zoomed, so that the picture cannot cover the whole size area of the cover picture when being displayed. The picture display arrangement is irregular, and the UI interaction effect is poor.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides an image display method, an image display device, a storage medium and an electronic device, which are used for at least solving the technical problem of poor cover map display effect of a multimedia data stream in the related art.
According to an aspect of an embodiment of the present invention, there is provided a method of displaying an image, including: acquiring a first image frame from a multimedia data stream being played; under the condition that the image size of the first image frame is not matched with a target image size, a second image frame with a width-height ratio of a first proportion is cut from the first image frame, wherein the target image size is the size of a target display area corresponding to the multimedia data stream, and the first proportion is the ratio of the width of the target image size to the height of the target image size; scaling the second image frame to an image size equal to the target image size to obtain a target image; and displaying the target image in the target display area.
According to another aspect of the embodiments of the present invention, there is also provided a display device of an image, including: the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a first image frame from a multimedia data stream which is being played; the intercepting module is used for intercepting a second image frame with a first ratio of width to height from the first image frame under the condition that the image size of the first image frame is not matched with a target image size, wherein the target image size is the size of a target display area corresponding to the multimedia data stream, and the first ratio is the ratio of the width of the target image size to the height of the target image size; the zooming module is used for zooming the second image frame to an image size which is equal to the target image size to obtain a target image; and the display module is used for displaying the target image in the target display area.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium, characterized in that the storage medium stores therein a computer program, wherein the computer program is configured to execute the method described in any one of the above when executed.
According to another aspect of the embodiments of the present invention, there is also provided an electronic apparatus, including a memory and a processor, wherein the memory stores therein a computer program, and the processor is configured to execute the method described in any one of the above through the computer program.
In the embodiment of the invention, a first image frame is obtained from a multimedia data stream being played; under the condition that the image size of the first image frame is not matched with the target image size, a second image frame with the width-height ratio of a first proportion is cut from the first image frame, wherein the target image size is the size of a target display area corresponding to the multimedia data stream, and the first proportion is the ratio of the width of the target image size to the height of the target image size; scaling the second image frame to the image size which is the target image size in an equal ratio to obtain a target image; in the method for displaying the target image in the target display area, under the condition that the image size of a first image frame acquired from a multimedia data stream being played is not matched with the target image size, a second image frame with the width-height ratio of a first proportion is cut from the first image frame, so that the width-height ratio of the second image frame is the same as the width-height ratio of the target image size of a target display area corresponding to the multimedia data stream, the obtained second image frame is scaled to the image size of the target image size in an equal ratio manner, so that the size of the obtained target image is the same as the size of the target display area, the target image is displayed in the target display area as a cover picture of the multimedia data stream, the cover picture of the multimedia data stream is ensured not to be distorted and can be filled in the display area of the cover picture, and the technical effect of improving the cover picture display effect of the multimedia data stream is realized, and further solve the technical problem that the cover map display effect of the multimedia data stream is poor in the related art.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic diagram of an alternative method of displaying an image according to an embodiment of the invention;
FIG. 2 is a schematic diagram of an application environment of an alternative image display method according to an embodiment of the present invention;
FIG. 3 is a first schematic diagram of an alternative image display method according to an alternative embodiment of the present invention;
FIG. 4 is a second schematic diagram of an alternative image display method according to an alternative embodiment of the present invention;
FIG. 5 is a third schematic diagram of an alternative image display method according to an alternative embodiment of the present invention;
FIG. 6 is a fourth schematic diagram of an alternative image display method according to an alternative embodiment of the present invention;
FIG. 7 is a fifth schematic diagram of an alternative method of displaying an image according to an alternative embodiment of the invention;
FIG. 8 is a schematic view of an alternative image display device according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating an application scenario of an alternative image display method according to an embodiment of the present invention;
FIG. 10 is a diagram illustrating an application scenario of an alternative image display method according to an embodiment of the present invention; and
FIG. 11 is a schematic diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of an embodiment of the present invention, there is provided a method of displaying an image, as shown in fig. 1, the method including:
s102, acquiring a first image frame from a multimedia data stream being played;
s104, under the condition that the image size of the first image frame is not matched with the target image size, intercepting a second image frame with a first width-height ratio from the first image frame, wherein the target image size is the size of a target display area corresponding to the multimedia data stream, and the first ratio is the ratio of the width of the target image size to the height of the target image size;
s106, scaling the second image frame to an image size which is equal to the target image size to obtain a target image;
and S108, displaying the target image in the target display area.
Alternatively, in this embodiment, the image display method may be applied to a hardware environment formed by the target device 202 shown in fig. 2. As shown in fig. 2, the target device 202 obtains a first image frame from a multimedia data stream being played; under the condition that the image size of the first image frame is not matched with the target image size, a second image frame with the width-height ratio of a first proportion is cut from the first image frame, wherein the target image size is the size of a target display area corresponding to the multimedia data stream, and the first proportion is the ratio of the width of the target image size to the height of the target image size; scaling the second image frame to the image size which is the target image size in an equal ratio to obtain a target image; and displaying the target image in the target display area.
Optionally, in this embodiment, the target device 202 may include, but is not limited to: terminal devices, server devices, and the like. The image display method may be applied to the terminal device side, or the image display method may be applied to the server device side, or the image display method may be performed by the terminal device side and the server device side in an interactive manner.
For example: the server acquires a first image frame from a multimedia data stream being played, and under the condition that the image size of the first image frame is not matched with the size of a target image, a second image frame with a width-height ratio of a first proportion is cut from the first image frame, wherein the size of the target image is the size of a target display area corresponding to the multimedia data stream, and the first proportion is the ratio of the width of the target image size to the height of the target image size. And the server sends the second image frame to the terminal, and the terminal scales the received second image frame to an image size which is equal to the target image size to obtain a target image and displays the target image in a target display area.
Alternatively, in the present embodiment, the above-mentioned image display method may be applied, but not limited, to a scene in which a cover picture of a multimedia data stream is displayed. The multimedia data stream may be, but is not limited to, played on various types of clients, and the client may be installed on the target device, for example, the client may include, but is not limited to: an online education client, an instant messaging client, a community space client, a game client, a shopping client, a browser client, a financial client, a multimedia client, a live broadcast client, etc. Specifically, the method can be applied, but not limited to, in the above-mentioned scene displaying the cover map of the multimedia data stream played in the multimedia client, or can also be applied, but not limited to, in the above-mentioned scene displaying the cover map of the multimedia data stream played in the live broadcast client, so as to improve the display of the cover map of the multimedia data stream played in the multimedia client. The above is only an example, and this is not limited in this embodiment.
Optionally, in this embodiment, the multimedia data stream may include, but is not limited to: video data streams (e.g., live video, video on demand, etc.), audio data streams (e.g., music play, radio, station, etc.), slide show data streams (e.g., PPT), picture data streams (e.g., electronic photo album), etc.
Optionally, in this embodiment, the acquired first image frame may be, but is not limited to, a screenshot obtained from a multimedia data stream, and the screenshot manner may include, but is not limited to, a real-time screenshot or a screenshot at a specified time point, and the like. Alternatively, the first acquired image frame may be, but is not limited to, an image frame designated for the multimedia data stream. For example: album covers in music playback, track effect diagrams in broadcast playback, posters for movie videos, and the like.
Alternatively, in this embodiment, the target display area may be, but is not limited to, a display area including a cover map of the multimedia data stream, and the display area may be located in a play list of the multimedia data or a search list of the multimedia data, and the like.
In an alternative embodiment, taking a cover picture of a live video as an example, as shown in fig. 3, a video stream is being played to a frame a, the image size of the frame a is 100 × 300, a first image frame is obtained from the video stream being played, the target display area of the video stream corresponding to the live video stream in the live list is an area B, the target image size of the area B is 300 × 100, in the case that the image size of the frame a does not match the target image size of the area B, a second image frame with a first ratio of width to height is cut from the frame a, a frame C is cut, wherein the first ratio is a ratio of the width of the target image size to the height of the target image size, i.e., the first ratio is 100/300, and assuming that the width cut on the frame a is 100, the image size of the frame C is 100 × 100/3, the second image frame is scaled by 3 times, the zoom is performed to an image size of 300 × 100, and the target image D is obtained and displayed in the target display area.
It can be seen that, through the above steps, in the case that the image size of the first image frame acquired from the multimedia data stream being played is not matched with the target image size, the second image frame with the width-height ratio of the first proportion is cut from the first image frame, so that the width-height ratio of the second image frame is the same as the width-height ratio of the target image size of the target display area corresponding to the multimedia data stream, and then the obtained second image frame is scaled to the image size of the target image size, so that the size of the obtained target image is the same as the size of the target display area, and then the target image is displayed in the target display area as the cover image of the multimedia data stream, so as to ensure that the cover image of the multimedia data stream can fill the display area of the cover image without distortion, thereby realizing the technical effect of improving the cover image display effect of the multimedia data stream, and further solve the technical problem that the cover map display effect of the multimedia data stream is poor in the related art.
As an alternative, the image size of the first image frame not matching the target image size comprises:
s1, the image size of the first image frame does not fall within the target size range; or,
s2, the image size of the first image frame is different from the target image size.
Optionally, in this embodiment, the determining whether the image size of the first image frame matches the target image size may be determining whether the image size of the first image frame and the target image size are similar, and the determining of the similarity may be, but is not limited to, determining whether the image size of the first image frame falls within a target size range including the target image size. For example: with a target image size of 100 x 300, the target size range may be set, but is not limited to, a width range of 90 to 120 and a height range of 270 to 310, and then both the width and height of the image size falling within the above ranges are determined to be a match.
Alternatively, in the present embodiment, the manner of determining whether the image size of the first image frame matches the target image size may be to determine whether the two are the same. For example: the target image size is 100 × 300, the first image frame having the image size of 100 × 300 is determined as an image frame matching the target image size.
Optionally, in this embodiment, if the image size of the first image frame matches the target image size, the target image may be obtained by directly scaling the first image.
As an alternative, in the case that the first ratio is greater than or equal to 1, the step of cutting out the second image frame with the width-height ratio of the first ratio from the first image frame includes:
s1, determining the width of the first image frame as a first width, and determining the product of the first width and a second ratio as a first height, wherein the second ratio is the ratio of the height of the target image size to the width of the target image size;
s2, the image frame with the width of the first width and the height of the first height is cut from the first image frame to be used as the second image frame.
Alternatively, in this embodiment, the first ratio of the target image size is greater than or equal to 1, and then the width of the target image size is greater than the height, then the width of the first image frame may be determined as the width of the second image frame, and the width-to-height ratio of the second image frame is ensured as the first ratio by the truncation of the first image frame in the height.
Optionally, in this embodiment, the image frame with the width of the first width and the height of the first height may be taken from the first image frame as the second image frame by, but is not limited to: determining the starting height according to the height of the size of the target image and the height of the first image frame, determining the edge where the height of the first image frame is located as the starting edge, and then taking the point with the height on the starting edge as the starting height to cut the image frame with the width as the first width from the first image, wherein the height is the first height and the image frame is taken as the second image frame.
Optionally, in this embodiment, the second image frame may be taken from the first image frame by, but not limited to: determining half of the difference between the height of the first image frame and the height of the target image size as a starting height, determining the left side of the first image frame as a starting edge, establishing a rectangular coordinate system xOy by taking the top left vertex of the first image frame as an origin, the left side of the first image frame as a positive half axis of a y axis, the top side of the first image frame as a positive half axis of an x axis, and determining the coordinates of the starting point as (0), (h1-h2)/2), wherein h1 is the height of the first image frame, and h2 is the height of the target image size; and taking the starting point as the upper left vertex of the second image frame, taking y as (h1-h2)/2 as the upper edge of the second image frame, and taking the image frame with the first height along the y axis as the second image frame.
In an alternative embodiment, iorghidth is the original image width, i.e. the width of the first image frame, iorghigth is the original image height, i.e. the height of the first image frame, iineedwidth is the width of the processed image, i.e. the width of the second image frame (first width), iineedheigth is the height of the processed image (first height), i.e. the height of the second image frame, igoallwidth is the width of the target image size, igoallheigth is the height of the target image size, iPosX is the starting coordinate x cropped in the original image, and iPosY is the starting coordinate y cropped in the original image. When the width of the first image frame is determined to be the first width, then iineedwidth is equal to iOrgWidth, and when the product value of the first width and the second ratio (igoalheight/iGoalWidth) is determined to be the first height, then iineedheight is equal to iOrgWidth. As shown in fig. 4, a rectangular coordinate system xOy is established with the upper left vertex of the first image frame as the origin, the left side of the first image frame as the positive half axis of the y-axis, the upper side of the first image frame as the positive half axis of the x-axis, the x-axis coordinate determining the starting point of the cross-section is iPosX ═ 0, and the y-axis coordinate determining the starting point of the cross-section is iPosY ═ 2 (iOrgHeigth-iinededheigth). The second image frame is the partial image of the dotted frame with the cutting width of iOrgWidth and the height of iGoalHeigth/iGoalWidth, starting from (iPosX, iPosY).
In the present embodiment, as shown in fig. 5, a picture that matches the required aspect ratio of the cover image, i.e., the second image frame, is obtained after the image is cut out, the second image frame is scaled in an equal ratio (if the image size of the second image frame is the same as the target image size, the scaling ratio is 1), a picture with the required size, i.e., the target picture, is obtained, and the target picture is displayed on the live broadcast list.
As an alternative, in the case that the first ratio is smaller than 1, the step of cutting out the second image frame with the width-to-height ratio of the first ratio from the first image frame includes:
s1, determining the height of the first image frame as a second height, and determining the product of the second height and the first ratio as a second width;
s2, an image frame with a second width and a second height is cut from the first image as a second image frame.
Alternatively, in this embodiment, the first ratio of the target image size is smaller than 1, and then the width of the target image size is smaller than the height, then the height of the first image frame may be determined as the height of the second image frame, and the width-to-height ratio of the second image frame is ensured to be the first ratio by truncating the width of the first image frame.
Optionally, in this embodiment, the image frame with the width of the second width and the height of the second height may be taken from the first image frame as the second image frame by, but is not limited to: determining an initial width according to the width of the size of the target image and the width of the first image frame, determining the edge where the width of the first image frame is located as an initial edge, taking the point with the width as the initial width on the initial edge as a starting point, cutting the image frame with the width as a second width from the first image, and taking the image frame with the height as the second height as a second image frame.
Optionally, in this embodiment, the image frame with the width of the second width and the height of the second height may be taken from the first image frame as the second image frame by, but is not limited to: half of the difference between the width of the first image frame and the width of the target image size is determined as a start width, and the upper side of the first image frame is determined as a start side. Establishing a rectangular coordinate system xOy by taking the upper left vertex of the first image frame as an origin, the left side of the first image frame as a positive half axis of a y axis, and the upper side of the first image frame as a positive half axis of an x axis, and determining the coordinates of a starting point as (0, (w1-w2)/2), wherein w1 is the width of the first image frame, and w2 is the width of a target image size; and taking the starting point as the upper left vertex of the second image frame, taking x as (w1-w2)/2 as the left side of the second image frame, and taking the image frame with the second width along the positive direction of the x axis as the second image frame.
In an alternative embodiment, iorghidth is the original image width, i.e. the width of the first image frame, iorghigth is the original image height, i.e. the height of the first image frame, iineedwidth is the width of the processed image, i.e. the width of the second image frame (first width), iineedheigth is the height of the processed image (first height), i.e. the height of the second image frame, igoallwidth is the width of the target image size, igoallheigth is the height of the target image size, iPosX is the starting coordinate x cropped in the original image, and iPosY is the starting coordinate y cropped in the original image. If the height of the first image frame is determined to be the second width, then iineedheight is ierghigth, and if the product value of the second width and the second ratio (igoalheight/iGoalWidth) is determined to be the second height, then iineedwidth is ierghigth (igoalheight/iGoalWidth). As shown in fig. 6, a rectangular coordinate system xOy is established with the upper left vertex of the first image frame as the origin, the left side of the first image frame as the positive half axis of the y-axis, the upper side of the first image frame as the positive half axis of the x-axis, the x-axis coordinate determining the starting point of the cross-section is iPosX (iOrgWidth-iineedwidth)/2, and the y-axis coordinate determining the starting point of the cross-section is iPosY (0). Taking (iPosX, iPosY) as a starting point, a broken-line frame part picture with the width of iOrgWidth and the height of iOrgHeigth (iGoalHeigth/iGoalWidth) is cut to be the second image frame.
In the present embodiment, as shown in fig. 7, a picture that matches the required aspect ratio of the cover image, i.e., the second image frame, is obtained after the image is cut out, the second image frame is scaled in an equal ratio (if the image size of the second image frame is the same as the target image size, the scaling ratio is 1), a picture with the required size, i.e., the target picture, is obtained, and the target picture is displayed on the live list.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
According to another aspect of the embodiments of the present invention, there is also provided an image display apparatus for implementing the above-described image display method, as shown in fig. 8, the apparatus including:
an obtaining module 82, configured to obtain a first image frame from a multimedia data stream being played;
a clipping module 84, configured to, if the image size of the first image frame does not match the target image size, clip a second image frame with a first width-to-height ratio from the first image frame, where the target image size is the size of a target display area corresponding to the multimedia data stream, and the first ratio is the ratio of the width of the target image size to the height of the target image size;
the zooming module 86 is used for zooming the second image frame to the image size which is the target image size in an equal ratio to obtain a target image;
and a display module 88 for displaying the target image in the target display area.
Alternatively, in this embodiment, the display apparatus of the image may be applied to a hardware environment formed by the target device 202 shown in fig. 2. As shown in fig. 2, the target device 202 obtains a first image frame from a multimedia data stream being played; under the condition that the image size of the first image frame is not matched with the target image size, a second image frame with the width-height ratio of a first proportion is cut from the first image frame, wherein the target image size is the size of a target display area corresponding to the multimedia data stream, and the first proportion is the ratio of the width of the target image size to the height of the target image size; scaling the second image frame to the image size which is the target image size in an equal ratio to obtain a target image; and displaying the target image in the target display area.
Optionally, in this embodiment, the target device may include, but is not limited to: terminal devices, server devices, and the like. The image display method may be applied to the terminal device side, or the image display method may be applied to the server device side, or the image display method may be performed by the terminal device side and the server device side in an interactive manner.
For example: the server acquires a first image frame from a multimedia data stream being played, and under the condition that the image size of the first image frame is not matched with the size of a target image, a second image frame with a width-height ratio of a first proportion is cut from the first image frame, wherein the size of the target image is the size of a target display area corresponding to the multimedia data stream, and the first proportion is the ratio of the width of the target image size to the height of the target image size. And the server sends the second image frame to the terminal, and the terminal scales the received second image frame to an image size which is equal to the target image size to obtain a target image and displays the target image in a target display area.
Alternatively, in the present embodiment, the display device of the image may be applied to, but not limited to, a scene of displaying a cover picture of a multimedia data stream. The multimedia data stream may be, but is not limited to, played on various types of clients, for example, the clients may include, but are not limited to: an online education client, an instant messaging client, a community space client, a game client, a shopping client, a browser client, a financial client, a multimedia client, a live broadcast client, etc. Specifically, the method can be applied, but not limited to, in the above-mentioned scene displaying the cover map of the multimedia data stream played in the multimedia client, or can also be applied, but not limited to, in the above-mentioned scene displaying the cover map of the multimedia data stream played in the live broadcast client, so as to improve the display of the cover map of the multimedia data stream played in the multimedia client. The above is only an example, and this is not limited in this embodiment.
Optionally, in this embodiment, the multimedia data stream may include, but is not limited to: video data streams (e.g., live video, video on demand, etc.), audio data streams (e.g., music play, radio, station, etc.), slide show data streams (e.g., PPT), picture data streams (e.g., electronic photo album), etc.
Optionally, in this embodiment, the acquired first image frame may be, but is not limited to, a screenshot obtained from a multimedia data stream, and the screenshot manner may include, but is not limited to, a real-time screenshot or a screenshot at a specified time point, and the like. Alternatively, the first acquired image frame may be, but is not limited to, an image frame designated for the multimedia data stream. For example: album covers in music playback, track effect diagrams in broadcast playback, posters for movie videos, and the like.
Alternatively, in this embodiment, the target display area may be, but is not limited to, a display area including a cover map of the multimedia data stream, and the display area may be located in a play list of the multimedia data or a search list of the multimedia data, and the like.
In an alternative embodiment, taking a cover picture of a live video as an example, as shown in fig. 3, a video stream is being played to a frame a, the image size of the frame a is 100 × 300, a first image frame is obtained from the video stream being played, the target display area of the video stream corresponding to the live video stream in the live list is an area B, the target image size of the area B is 300 × 100, in the case that the image size of the frame a does not match the target image size of the area B, a second image frame with a first ratio of width to height is cut from the frame a, a frame C is cut, wherein the first ratio is a ratio of the width of the target image size to the height of the target image size, i.e., the first ratio is 100/300, and assuming that the width cut on the frame a is 100, the image size of the frame C is 100 × 100/3, the second image frame is scaled by 3 times, the zoom is performed to an image size of 300 × 100, and the target image D is obtained and displayed in the target display area.
It can be seen that, with the above apparatus, when the image size of the first image frame obtained from the multimedia data stream being played is not matched with the target image size, the second image frame with the width-height ratio of the first ratio is cut from the first image frame, so that the width-height ratio of the second image frame is the same as the width-height ratio of the target image size of the target display area corresponding to the multimedia data stream, and then the obtained second image frame is scaled to the image size of the target image size, so that the size of the obtained target image is the same as the size of the target display area, and then the target image is displayed in the target display area as the cover image of the multimedia data stream, so as to ensure that the cover image of the multimedia data stream can fill the display area of the cover image without distortion, thereby realizing the technical effect of improving the cover image display effect of the multimedia data stream, and further solve the technical problem that the cover map display effect of the multimedia data stream is poor in the related art.
As an alternative, the image size of the first image frame not matching the target image size comprises:
the image size of the first image frame does not fall within the target size range; or,
the image size of the first image frame is different from the target image size.
Optionally, in this embodiment, the determining whether the image size of the first image frame matches the target image size may be determining whether the image size of the first image frame and the target image size are similar, and the determining of the similarity may be, but is not limited to, determining whether the image size of the first image frame falls within a target size range including the target image size. For example: with a target image size of 100 x 300, the target size range may be set, but is not limited to, a width range of 90 to 120 and a height range of 270 to 310, and then both the width and height of the image size falling within the above ranges are determined to be a match.
Alternatively, in the present embodiment, the manner of determining whether the image size of the first image frame matches the target image size may be to determine whether the two are the same. For example: the target image size is 100 × 300, the first image frame having the image size of 100 × 300 is determined as an image frame matching the target image size.
Optionally, in this embodiment, if the image size of the first image frame matches the target image size, the target image may be obtained by directly scaling the first image.
As an optional solution, in the case that the first ratio is greater than or equal to 1, the intercepting module includes:
a first determining unit, configured to determine that a width of the first image frame is a first width, and determine that a product value of the first width and a second ratio is a first height, where the second ratio is a ratio of a height of the target image size to a width of the target image size;
and the first cutting unit is used for cutting the image frame with the width of the first width and the height of the first height from the first image frame as a second image frame.
Alternatively, in this embodiment, the first ratio of the target image size is greater than or equal to 1, and then the width of the target image size is greater than the height, then the width of the first image frame may be determined as the width of the second image frame, and the width-to-height ratio of the second image frame is ensured as the first ratio by the truncation of the first image frame in the height.
Optionally, in this embodiment, the first truncating unit includes: the first determining subunit is used for determining a starting height according to the height of the size of the target image and the height of the first image frame, and determining the edge where the height of the first image frame is positioned as a starting edge; and the first intercepting subunit is used for intercepting an image frame with a first width and a first height from the first image by taking a point with the height on the starting edge as the starting height as a starting point, and taking the image frame as a second image frame.
Optionally, in this embodiment, the first determining subunit is configured to: half of the difference between the height of the first image frame and the height of the target image size is determined as a starting height, and the left side of the first image frame is determined as a starting edge.
Optionally, in this embodiment, the first truncating subunit is configured to: establishing a rectangular coordinate system xOy by taking the upper left vertex of the first image frame as an origin, the left side of the first image frame as a positive half axis of a y axis, and the upper side of the first image frame as a positive half axis of an x axis, and determining the coordinates of a starting point as (0, (h1-h2)/2), wherein h1 is the height of the first image frame, and h2 is the height of a target image size; and taking the starting point as the upper left vertex of the second image frame, taking y as (h1-h2)/2 as the upper edge of the second image frame, and taking the image frame with the first height along the y axis as the second image frame.
In an alternative embodiment, iorghidth is the original image width, i.e. the width of the first image frame, iorghigth is the original image height, i.e. the height of the first image frame, iineedwidth is the width of the processed image, i.e. the width of the second image frame (first width), iineedheigth is the height of the processed image (first height), i.e. the height of the second image frame, igoallwidth is the width of the target image size, igoallheigth is the height of the target image size, iPosX is the starting coordinate x cropped in the original image, and iPosY is the starting coordinate y cropped in the original image. When the width of the first image frame is determined to be the first width, then iineedwidth is equal to iOrgWidth, and when the product value of the first width and the second ratio (igoalheight/iGoalWidth) is determined to be the first height, then iineedheight is equal to iOrgWidth. As shown in fig. 4, a rectangular coordinate system xOy is established with the upper left vertex of the first image frame as the origin, the left side of the first image frame as the positive half axis of the y-axis, the upper side of the first image frame as the positive half axis of the x-axis, the x-axis coordinate determining the starting point of the cross-section is iPosX ═ 0, and the y-axis coordinate determining the starting point of the cross-section is iPosY ═ 2 (iOrgHeigth-iinededheigth). The second image frame is the partial image of the dotted frame with the cutting width of iOrgWidth and the height of iGoalHeigth/iGoalWidth, starting from (iPosX, iPosY).
In the present embodiment, as shown in fig. 5, a picture that matches the required aspect ratio of the cover image, i.e., the second image frame, is obtained after the image is cut out, the second image frame is scaled in an equal ratio (if the image size of the second image frame is the same as the target image size, the scaling ratio is 1), a picture with the required size, i.e., the target picture, is obtained, and the target picture is displayed on the live broadcast list.
As an alternative, in the case that the first ratio is smaller than 1, the intercepting module includes:
a second determining unit for determining the height of the first image frame as a second height and determining a product value of the second height and the first ratio as a second width;
and the second cutting unit is used for cutting the image frame with the width of the second width and the height of the second height from the first image as a second image frame.
Alternatively, in this embodiment, the first ratio of the target image size is smaller than 1, and then the width of the target image size is smaller than the height, then the height of the first image frame may be determined as the height of the second image frame, and the width-to-height ratio of the second image frame is ensured to be the first ratio by truncating the width of the first image frame.
Optionally, in this embodiment, the second intercepting unit includes: the second determining subunit is used for determining the starting width according to the width of the size of the target image and the width of the first image frame, and determining the edge where the width of the first image frame is positioned as the starting edge; and the second intercepting subunit is used for intercepting the image frame with the width as the second width and the height as the second height from the first image by taking the point with the width as the initial width on the initial edge as a starting point to serve as the second image frame.
Optionally, in this embodiment, the second determining subunit is configured to: half of the difference between the width of the first image frame and the width of the target image size is determined as a start width, and the upper side of the first image frame is determined as a start side.
Optionally, in this embodiment, the second truncating subunit is configured to: establishing a rectangular coordinate system xOy by taking the upper left vertex of the first image frame as an origin, the left side of the first image frame as a positive half axis of a y axis, and the upper side of the first image frame as a positive half axis of an x axis, and determining the coordinates of a starting point as (0, (w1-w2)/2), wherein w1 is the width of the first image frame, and w2 is the width of a target image size; and taking the starting point as the upper left vertex of the second image frame, taking x as (w1-w2)/2 as the left side of the second image frame, and taking the image frame with the second width along the positive direction of the x axis as the second image frame.
In an alternative embodiment, iorghidth is the original image width, i.e. the width of the first image frame, iorghigth is the original image height, i.e. the height of the first image frame, iineedwidth is the width of the processed image, i.e. the width of the second image frame (first width), iineedheigth is the height of the processed image (first height), i.e. the height of the second image frame, igoallwidth is the width of the target image size, igoallheigth is the height of the target image size, iPosX is the starting coordinate x cropped in the original image, and iPosY is the starting coordinate y cropped in the original image. If the height of the first image frame is determined to be the second width, then iineedheight is ierghigth, and if the product value of the second width and the second ratio (igoalheight/iGoalWidth) is determined to be the second height, then iineedwidth is ierghigth (igoalheight/iGoalWidth). As shown in fig. 6, a rectangular coordinate system xOy is established with the upper left vertex of the first image frame as the origin, the left side of the first image frame as the positive half axis of the y-axis, the upper side of the first image frame as the positive half axis of the x-axis, the x-axis coordinate determining the starting point of the cross-section is iPosX (iOrgWidth-iineedwidth)/2, and the y-axis coordinate determining the starting point of the cross-section is iPosY (0). Taking (iPosX, iPosY) as a starting point, a broken-line frame part picture with the width of iOrgWidth and the height of iOrgHeigth (iGoalHeigth/iGoalWidth) is cut to be the second image frame.
In the present embodiment, as shown in fig. 7, a picture that matches the required aspect ratio of the cover image, i.e., the second image frame, is obtained after the image is cut out, the second image frame is scaled in an equal ratio (if the image size of the second image frame is the same as the target image size, the scaling ratio is 1), a picture with the required size, i.e., the target picture, is obtained, and the target picture is displayed on the live list.
The application environment of the embodiment of the present invention may refer to the application environment in the above embodiments, but is not described herein again. The embodiment of the invention provides an optional specific application example of the connection method for implementing the real-time communication.
As an alternative embodiment, the above-described image display method may be applied, but not limited, to a scene in which a video in live view is shown in a cover view as shown in fig. 9 and 10. In this scenario, for example, live video at a mobile phone terminal is taken as an example, and live screenshot is a picture obtained by capturing a current picture from a live video stream. The cover page picture is a picture related to the live broadcast content and displayed in the live broadcast list. The real-time cover picture is a real-time screenshot of live content as a cover picture. When the horizontal screen live broadcast is the mobile phone horizontal screen live broadcast, the output video interface is horizontal. When the vertical screen direct broadcasting is the vertical screen direct broadcasting of the mobile phone, the output video interface is vertical. The horizontal picture is a picture cut from the horizontal screen live broadcast, and the width is larger than the height. The vertical picture is a picture cut from the vertical screen live broadcast, and the width is smaller than the height.
During live broadcasting, the mobile phone can collect video sources through a horizontal screen and a vertical screen, and a main broadcast can freely select the horizontal screen or the vertical screen for live broadcasting. However, in a live list such as a live app, a web, or a search page, a cover page image with a fixed specification is adopted for the visual experience of composition. If the live screenshot is adopted as the cover picture, live screenshots of a cross screen are met, but a vertical picture needs to be displayed, or live screenshots of a vertical screen need to be displayed, but a cross picture needs to be displayed.
In the scene, a screenshot processing mode is provided for solving the problems, so that a cover picture meeting the set size is obtained after the original screenshot is processed, the picture is paved in the cover picture area and is not distorted, and the display effect of the cover picture is improved.
In this scenario, as shown in fig. 9, for the case of turning a horizontal diagram into a vertical diagram, after an original diagram is cut, center cropping is performed on the original diagram, matching is performed in the maximum range in the center of the original diagram according to the aspect ratio of a required size, an image in the same proportion as a cover diagram is cut by taking the height of the original diagram as the cut height, so that the cut image can meet the required aspect ratio, and then the cut image is scaled to a specified size in an equal proportion.
In this scenario, as shown in fig. 10, for the case of turning a vertical diagram into a horizontal diagram, after an original diagram is cut, center cropping is performed on the original diagram, matching is performed in the maximum range in the center of the original diagram according to the aspect ratio of a required size, an image in the same proportion as a cover diagram is cut by taking the width of the original diagram as the cut width, so that the cut image can meet the required aspect ratio, and then the cut image is scaled to a specified size in an equal proportion.
Optionally, in this embodiment, the selection of the capture area may further use an image recognition technology to recognize the face area in the picture, and capture the picture by taking the face area as a center, so as to further improve the capture effect.
By means of the method, the problem that the live screen capture size and the display size are not matched is solved, processing modes of live screens, search lists and the like needing to be displayed are optimized, and the type setting and interactive visual experience of an interface are improved.
According to still another aspect of an embodiment of the present invention, there is also provided an electronic apparatus for implementing the display of the above-described image, as shown in fig. 11, the electronic apparatus including: one or more processors 1102 (only one of which is shown in the figure), in which a computer program is stored, a memory 1104, a sensor 1106, an encoder 1108, and a transmission device 1110, the processor being arranged to perform the steps of any of the method embodiments described above by means of the computer program.
Optionally, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring a first image frame from the multimedia data stream being played;
s2, under the condition that the image size of the first image frame is not matched with the target image size, cutting a second image frame with the width-height ratio of a first proportion from the first image frame, wherein the target image size is the size of a target display area corresponding to the multimedia data stream, and the first proportion is the ratio of the width of the target image size to the height of the target image size;
s3, scaling the second image frame to the image size which is the target image size in an equal ratio to obtain a target image;
s4, the target image is displayed in the target display area.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 11 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 11 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 11, or have a different configuration than shown in FIG. 11.
The memory 1102 may be used to store software programs and modules, such as program instructions/modules corresponding to the image display method and apparatus in the embodiments of the present invention, and the processor 1104 executes various functional applications and data processing by operating the software programs and modules stored in the memory 1102, that is, implements the control method of the target component described above. The memory 1102 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1102 can further include memory located remotely from the processor 1104 and such remote memory can be coupled to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 1110 is used for receiving or transmitting data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 1110 includes a network adapter (NIC) that can be connected to a router via a network cable and other network devices to communicate with the internet or a local area network. In one example, the transmission device 1110 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Wherein the memory 1102 is used, inter alia, for storing application programs.
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring a first image frame from the multimedia data stream being played;
s2, under the condition that the image size of the first image frame is not matched with the target image size, cutting a second image frame with the width-height ratio of a first proportion from the first image frame, wherein the target image size is the size of a target display area corresponding to the multimedia data stream, and the first proportion is the ratio of the width of the target image size to the height of the target image size;
s3, scaling the second image frame to the image size which is the target image size in an equal ratio to obtain a target image;
s4, the target image is displayed in the target display area.
Optionally, the storage medium is further configured to store a computer program for executing the steps included in the method in the foregoing embodiment, which is not described in detail in this embodiment.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.
Claims (11)
1. A method for displaying an image, comprising:
acquiring a first image frame from a multimedia data stream being played;
under the condition that the image size of the first image frame is not matched with a target image size, a second image frame with a width-height ratio of a first proportion is cut from the first image frame, wherein the target image size is the size of a target display area corresponding to the multimedia data stream, and the first proportion is the ratio of the width of the target image size to the height of the target image size;
scaling the second image frame to an image size equal to the target image size to obtain a target image;
and displaying the target image in the target display area.
2. The method of claim 1, wherein the image size of the first image frame not matching a target image size comprises:
the image size of the first image frame does not fall within a target size range; or,
the image size of the first image frame is different from the target image size.
3. The method of claim 1, wherein in the case that the first ratio is greater than or equal to 1, the cutting a second image frame with a first ratio of width to height from the first image frame comprises:
determining a width of the first image frame to be a first width, and determining a product value of the first width and a second ratio to be a first height, wherein the second ratio is a ratio of a height of the target image size to a width of the target image size;
and cutting the image frame with the width of the first width and the height of the first height from the first image frame to be used as the second image frame.
4. The method of claim 3, wherein said cutting an image frame with a width of the first width and a height of the first height from the first image frame as the second image frame comprises:
determining a starting height according to the height of the size of the target image and the height of the first image frame, and determining the edge where the height of the first image frame is located as a starting edge;
and taking the point with the height on the starting edge as the starting height, and taking an image frame with the width as the first width and the height as the first height as the second image frame.
5. The method of claim 4,
the determining a starting height according to the height of the target image size and the height of the first image frame, and the determining the edge where the height of the first image frame is located as a starting edge includes: determining half of a difference between the height of the first image frame and the height of the target image size as the starting height, and determining a left side of the first image frame as the starting edge;
the cutting an image frame with a width of the first width from the first image with a point with a height on the starting edge as the starting height as a starting point, and the taking an image frame with a height of the first height as the second image frame includes: establishing a rectangular coordinate system xOy by taking the top left vertex of the first image frame as an origin, the left side of the first image frame as a positive half axis of a y axis, and the top side of the first image frame as the positive half axis of an x axis, and determining the coordinates of the starting point as (0, (h1-h2)/2), wherein h1 is the height of the first image frame, and h2 is the height of the target image size; and taking the starting point as the top left vertex of the second image frame, taking y ═ h1-h2)/2 as the top edge of the second image frame, and taking the image frame with the first height along the y axis in the positive direction as the second image frame.
6. The method of claim 1, wherein in the case that the first ratio is smaller than 1, the cutting out a second image frame with a first ratio of width to height from the first image frame comprises:
determining the height of the first image frame as a second height and determining a product value of the second height and the first ratio as a second width;
and cutting the image frame with the width of the second width and the height of the second height from the first image to be used as the second image frame.
7. The method of claim 6, wherein said cutting an image frame having a width of the second width and a height of the second height from the first image as the second image frame comprises:
determining an initial width according to the width of the size of the target image and the width of the first image frame, and determining the edge where the width of the first image frame is located as an initial edge;
and taking the point with the width as the starting width on the starting edge as a starting point, and cutting an image frame with the width as the second width and the height as the second height from the first image as the second image frame.
8. The method of claim 7,
determining an initial width according to the width of the size of the target image and the width of the first image frame, and determining an edge where the width of the first image frame is located as an initial edge comprises: determining a half of a difference between a width of the first image frame and a width of the target image size as the start width, and determining an upper side of the first image frame as the start side;
the cutting, from the first image, an image frame with a width of the second width and a height of the second width as the second image frame, with a point on the starting edge with the width of the starting width as the starting width, as the second image frame, includes: establishing a rectangular coordinate system xOy by taking the top left vertex of the first image frame as an origin, the left side of the first image frame as a positive half axis of a y axis, and the top side of the first image frame as the positive half axis of an x axis, and determining the coordinates of the starting point as (0, (w1-w2)/2), wherein w1 is the width of the first image frame, and w2 is the width of the target image size; and taking the starting point as the top left vertex of the second image frame, taking x ═ w1-w2)/2 as the left side of the second image frame, and taking the image frame with the second width along the positive direction of the x axis as the second image frame.
9. An apparatus for displaying an image, comprising:
the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a first image frame from a multimedia data stream which is being played;
the intercepting module is used for intercepting a second image frame with a first ratio of width to height from the first image frame under the condition that the image size of the first image frame is not matched with a target image size, wherein the target image size is the size of a target display area corresponding to the multimedia data stream, and the first ratio is the ratio of the width of the target image size to the height of the target image size;
the zooming module is used for zooming the second image frame to an image size which is equal to the target image size to obtain a target image;
and the display module is used for displaying the target image in the target display area.
10. A storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 8 when executed.
11. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 8 by means of the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810437765.XA CN108737882B (en) | 2018-05-09 | 2018-05-09 | Image display method, image display device, storage medium and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810437765.XA CN108737882B (en) | 2018-05-09 | 2018-05-09 | Image display method, image display device, storage medium and electronic device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108737882A true CN108737882A (en) | 2018-11-02 |
CN108737882B CN108737882B (en) | 2021-12-17 |
Family
ID=63938125
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810437765.XA Active CN108737882B (en) | 2018-05-09 | 2018-05-09 | Image display method, image display device, storage medium and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108737882B (en) |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110738598A (en) * | 2019-08-28 | 2020-01-31 | 咪咕文化科技有限公司 | Image adaptation method, electronic device and storage medium |
CN111050204A (en) * | 2019-12-27 | 2020-04-21 | 北京达佳互联信息技术有限公司 | Video clipping method and device, electronic equipment and storage medium |
WO2020094089A1 (en) * | 2018-11-08 | 2020-05-14 | 北京字节跳动网络技术有限公司 | Video picture adjustment method and apparatus, and computer device and storage medium |
CN111246272A (en) * | 2020-01-17 | 2020-06-05 | 北京达佳互联信息技术有限公司 | Method and device for displaying video cover picture |
CN111638929A (en) * | 2020-05-26 | 2020-09-08 | 广州视源电子科技股份有限公司 | Startup image processing method, device, equipment and storage medium |
CN112351314A (en) * | 2019-08-07 | 2021-02-09 | 腾讯数码(天津)有限公司 | Multimedia information playing method, server, terminal, system and storage medium |
CN113473192A (en) * | 2020-03-31 | 2021-10-01 | 海信视像科技股份有限公司 | Display device and starting signal source display adaptation method |
CN113727139A (en) * | 2021-07-30 | 2021-11-30 | 北京达佳互联信息技术有限公司 | Method and device for determining cover picture, server and storage medium |
CN113918766A (en) * | 2021-08-12 | 2022-01-11 | 荣耀终端有限公司 | Video thumbnail display method, device and storage medium |
CN114071244A (en) * | 2021-11-10 | 2022-02-18 | 广州博冠信息科技有限公司 | Method and device for generating live cover, computer storage medium and electronic equipment |
CN114428594A (en) * | 2022-01-24 | 2022-05-03 | 北京百度网讯科技有限公司 | Image display method, image display device, electronic device, and storage medium |
WO2022105345A1 (en) * | 2020-11-23 | 2022-05-27 | 青岛海信传媒网络技术有限公司 | Display device |
CN114598940A (en) * | 2022-03-25 | 2022-06-07 | 稿定(厦门)科技有限公司 | Processing method and processing device for video |
CN115474084A (en) * | 2022-08-10 | 2022-12-13 | 北京奇艺世纪科技有限公司 | Method, device, equipment and storage medium for generating video cover image |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070226082A1 (en) * | 2006-03-08 | 2007-09-27 | Leal Guilherme N | Method and system for demand and supply map/shopping path model graphical platform and supplying offers based on purchase intentions |
US20100125522A1 (en) * | 2008-11-18 | 2010-05-20 | Johanny Thomas | Interactive Web-Portal Interface Method and System |
CN102156876A (en) * | 2011-03-31 | 2011-08-17 | 华中科技大学 | Symbol identification method based on hexadecimal conversion |
CN102270093A (en) * | 2011-06-14 | 2011-12-07 | 上海大学 | Video-image-resolution-based vision adaptive method |
CN103607632A (en) * | 2013-11-27 | 2014-02-26 | 广州华多网络科技有限公司 | Previewing method and device based on desktop live broadcast |
CN104050185A (en) * | 2013-03-13 | 2014-09-17 | 百度在线网络技术(北京)有限公司 | Zoom-display processing method and device for page contents |
CN104134186A (en) * | 2013-04-30 | 2014-11-05 | 索尼公司 | Image processing apparatus, image processing method, and program |
US20160232144A1 (en) * | 2015-02-06 | 2016-08-11 | Liang Zhou | Browser extension allowing web users to draw on live web pages |
US20160255419A1 (en) * | 2013-11-14 | 2016-09-01 | Tencent Technology (Shenzhen) Company Limited | Video processing method and associated devices and communication system |
US20170178441A1 (en) * | 2013-10-01 | 2017-06-22 | Igt | System and method for multi-game, multi-play of live dealer games |
CN106940878A (en) * | 2017-02-27 | 2017-07-11 | 深圳华盛昌机械实业有限公司 | A kind of display methods and device |
CN107562877A (en) * | 2017-09-01 | 2018-01-09 | 北京搜狗科技发展有限公司 | Display methods, device and the device shown for view data of view data |
US20180085652A1 (en) * | 2013-12-19 | 2018-03-29 | Your Call, Inc. | Computer-implemented methods and systems enabling fan participation in calling plays at sporting and other events |
-
2018
- 2018-05-09 CN CN201810437765.XA patent/CN108737882B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070226082A1 (en) * | 2006-03-08 | 2007-09-27 | Leal Guilherme N | Method and system for demand and supply map/shopping path model graphical platform and supplying offers based on purchase intentions |
US20100125522A1 (en) * | 2008-11-18 | 2010-05-20 | Johanny Thomas | Interactive Web-Portal Interface Method and System |
CN102156876A (en) * | 2011-03-31 | 2011-08-17 | 华中科技大学 | Symbol identification method based on hexadecimal conversion |
CN102270093A (en) * | 2011-06-14 | 2011-12-07 | 上海大学 | Video-image-resolution-based vision adaptive method |
CN104050185A (en) * | 2013-03-13 | 2014-09-17 | 百度在线网络技术(北京)有限公司 | Zoom-display processing method and device for page contents |
CN104134186A (en) * | 2013-04-30 | 2014-11-05 | 索尼公司 | Image processing apparatus, image processing method, and program |
US20170178441A1 (en) * | 2013-10-01 | 2017-06-22 | Igt | System and method for multi-game, multi-play of live dealer games |
US20160255419A1 (en) * | 2013-11-14 | 2016-09-01 | Tencent Technology (Shenzhen) Company Limited | Video processing method and associated devices and communication system |
CN103607632A (en) * | 2013-11-27 | 2014-02-26 | 广州华多网络科技有限公司 | Previewing method and device based on desktop live broadcast |
US20180085652A1 (en) * | 2013-12-19 | 2018-03-29 | Your Call, Inc. | Computer-implemented methods and systems enabling fan participation in calling plays at sporting and other events |
US20160232144A1 (en) * | 2015-02-06 | 2016-08-11 | Liang Zhou | Browser extension allowing web users to draw on live web pages |
CN106940878A (en) * | 2017-02-27 | 2017-07-11 | 深圳华盛昌机械实业有限公司 | A kind of display methods and device |
CN107562877A (en) * | 2017-09-01 | 2018-01-09 | 北京搜狗科技发展有限公司 | Display methods, device and the device shown for view data of view data |
Non-Patent Citations (2)
Title |
---|
SHRINIVAS PUNDLIK: "《Magnifying Smartphone Screen Using Google Glass for Low-Vision User》", 《IEEE TRANSACTIONS ON NEURAL SYSTEMS AND REHABILITATION ENGINEERING》 * |
刘耀钦: "《HTML5 Canvas绘图技术及其在图像裁剪中的应用研究》", 《洛阳师范学院学报》 * |
Cited By (23)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020094089A1 (en) * | 2018-11-08 | 2020-05-14 | 北京字节跳动网络技术有限公司 | Video picture adjustment method and apparatus, and computer device and storage medium |
US11144201B2 (en) | 2018-11-08 | 2021-10-12 | Beijing Microlive Vision Technology Co., Ltd | Video picture adjustment method and apparatus, computer device and storage medium |
CN112351314A (en) * | 2019-08-07 | 2021-02-09 | 腾讯数码(天津)有限公司 | Multimedia information playing method, server, terminal, system and storage medium |
CN110738598A (en) * | 2019-08-28 | 2020-01-31 | 咪咕文化科技有限公司 | Image adaptation method, electronic device and storage medium |
CN111050204A (en) * | 2019-12-27 | 2020-04-21 | 北京达佳互联信息技术有限公司 | Video clipping method and device, electronic equipment and storage medium |
CN111246272A (en) * | 2020-01-17 | 2020-06-05 | 北京达佳互联信息技术有限公司 | Method and device for displaying video cover picture |
CN115396704B (en) * | 2020-03-31 | 2024-05-28 | 海信视像科技股份有限公司 | Display equipment and power-on signal source display adaptation method |
CN113473192A (en) * | 2020-03-31 | 2021-10-01 | 海信视像科技股份有限公司 | Display device and starting signal source display adaptation method |
CN113473192B (en) * | 2020-03-31 | 2022-07-26 | 海信视像科技股份有限公司 | Display device and starting signal source display adaptation method |
CN115396704A (en) * | 2020-03-31 | 2022-11-25 | 海信视像科技股份有限公司 | Display device and starting signal source display adaptation method |
CN111638929A (en) * | 2020-05-26 | 2020-09-08 | 广州视源电子科技股份有限公司 | Startup image processing method, device, equipment and storage medium |
WO2022105345A1 (en) * | 2020-11-23 | 2022-05-27 | 青岛海信传媒网络技术有限公司 | Display device |
CN113727139A (en) * | 2021-07-30 | 2021-11-30 | 北京达佳互联信息技术有限公司 | Method and device for determining cover picture, server and storage medium |
CN113918766A (en) * | 2021-08-12 | 2022-01-11 | 荣耀终端有限公司 | Video thumbnail display method, device and storage medium |
CN113918766B (en) * | 2021-08-12 | 2023-10-13 | 荣耀终端有限公司 | Video thumbnail display method, apparatus and storage medium |
WO2023016015A1 (en) * | 2021-08-12 | 2023-02-16 | 荣耀终端有限公司 | Method for displaying video thumbnail, and device and storage medium |
CN114071244A (en) * | 2021-11-10 | 2022-02-18 | 广州博冠信息科技有限公司 | Method and device for generating live cover, computer storage medium and electronic equipment |
CN114071244B (en) * | 2021-11-10 | 2022-11-04 | 广州博冠信息科技有限公司 | Method and device for generating live cover, computer storage medium and electronic equipment |
CN114428594B (en) * | 2022-01-24 | 2023-09-01 | 北京百度网讯科技有限公司 | Image display method, device, electronic equipment and storage medium |
CN114428594A (en) * | 2022-01-24 | 2022-05-03 | 北京百度网讯科技有限公司 | Image display method, image display device, electronic device, and storage medium |
CN114598940A (en) * | 2022-03-25 | 2022-06-07 | 稿定(厦门)科技有限公司 | Processing method and processing device for video |
CN115474084A (en) * | 2022-08-10 | 2022-12-13 | 北京奇艺世纪科技有限公司 | Method, device, equipment and storage medium for generating video cover image |
CN115474084B (en) * | 2022-08-10 | 2023-10-31 | 北京奇艺世纪科技有限公司 | Method, device, equipment and storage medium for generating video cover image |
Also Published As
Publication number | Publication date |
---|---|
CN108737882B (en) | 2021-12-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108737882B (en) | Image display method, image display device, storage medium and electronic device | |
CN110798697B (en) | Video display method, device and system and electronic equipment | |
CN104012106B (en) | It is directed at the video of expression different points of view | |
CN108124194B (en) | Video live broadcast method and device and electronic equipment | |
US20170171274A1 (en) | Method and electronic device for synchronously playing multiple-cameras video | |
CN108632676B (en) | Image display method, image display device, storage medium and electronic device | |
US20220046291A1 (en) | Method and device for generating live streaming video data and method and device for playing live streaming video | |
CN109089157B (en) | Video picture cutting method, display device and device | |
CN104618803A (en) | Information push method, information push device, terminal and server | |
CN110288534B (en) | Image processing method, device, electronic equipment and storage medium | |
CN105959620A (en) | Panorama video synchronization display method and panorama video synchronization display device | |
CN104883583A (en) | Method and device for acquiring online video screenshot | |
CN111147911A (en) | Video clipping method and device, electronic equipment and storage medium | |
CN110324648B (en) | Live broadcast display method and system | |
CN111050204A (en) | Video clipping method and device, electronic equipment and storage medium | |
CN106713942A (en) | Video processing method and video processing device | |
CN113891105A (en) | Picture display method and device, storage medium and electronic equipment | |
CN106412617B (en) | Remote debugging control method and device | |
CN103957464A (en) | Advertisement distributing method and system | |
CN103442288A (en) | Method, device and system for processing of trans-equipment data contents | |
CN111147883A (en) | Live broadcast method and device, head-mounted display equipment and readable storage medium | |
CN105407313A (en) | Video calling method, equipment and system | |
CN112954380A (en) | Video playing processing method and device | |
CN109168040B (en) | Program list display method and device and readable storage medium | |
CN111667313A (en) | Advertisement display method and device, client device and storage medium |
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 |