Image processing method, device, equipment and computer readable storage medium

文档序号:1904144 发布日期:2021-11-30 浏览:14次 中文

阅读说明:本技术 图像处理方法、装置、设备和计算机可读存储介质 (Image processing method, device, equipment and computer readable storage medium ) 是由 不公告发明人 于 2021-09-02 设计创作,主要内容包括:本公开提供了一种图像处理方法、装置、设备和计算机可读存储介质。该图像处理方法包括:在所述显示屏的当前显示方向为纵向显示方向的情况下,将所述显示屏的长边尺寸确定为第一最大显示宽度,并将所述显示屏的短边尺寸确定为第一最大显示高度;对于具有第一尺寸的待显示的输入图像,确定用于在所述第一最大显示宽度和所述第一最大显示高度的条件下进行显示的第二尺寸的显示图像,其中所述第二尺寸包括第二宽度尺寸和第二高度尺寸;以及在用于纵向显示的坐标系下,确定所述第二尺寸的显示图像的位置坐标,以所述显示屏的长边显示所述第二宽度尺寸且以所述显示屏的短边显示所述第二高度尺寸,从而改善用户体验。(The present disclosure provides an image processing method, apparatus, device, and computer-readable storage medium. The image processing method comprises the following steps: under the condition that the current display direction of the display screen is the longitudinal display direction, determining the size of the long side of the display screen as a first maximum display width, and determining the size of the short side of the display screen as a first maximum display height; for an input image to be displayed having a first size, determining a display image of a second size for display under the conditions of the first maximum display width and the first maximum display height, wherein the second size includes a second width size and a second height size; and determining position coordinates of the display image of the second size in a coordinate system for vertical display, displaying the second width size with a long side of the display screen and the second height size with a short side of the display screen, thereby improving user experience.)

1. An image processing method for a display screen, comprising:

under the condition that the current display direction of the display screen is the longitudinal display direction, determining the size of the long side of the display screen as a first maximum display width, and determining the size of the short side of the display screen as a first maximum display height;

for an input image to be displayed having a first size, determining a display image of a second size for display under conditions of a first maximum display width and a first maximum display height based on the first maximum display width and the first maximum display height, wherein the first size includes a first width size and a first height size, and the second size includes a second width size and a second height size; and

determining position coordinates of the display image of the second size in a coordinate system for portrait display, the second width size being displayed with a long side of the display screen and the second height size being displayed with a short side of the display screen,

and under the longitudinal display direction, the display screen has a second maximum display height and a second maximum display width, the second maximum display height is the long side dimension, and the second maximum display width is the short side dimension.

2. The method of claim 1, wherein determining the location coordinates of the display image of the second size in a coordinate system for portrait display comprises:

determining initial position coordinates of the display image of the second size in a coordinate system for lateral display, wherein in the lateral display direction, the display screen has a third maximum display height and a third maximum display width, the third maximum display height is the short side dimension, and the third maximum display width is the long side dimension;

determining first position coordinates of the display image of the second size based on the initial position coordinates in a coordinate system for portrait display;

performing rotation coordinate transformation on the determined first position coordinate to obtain a rotated position coordinate of the display image of the second size; and

and displaying the display image of the second size according to the rotated position coordinates in a vertical display direction, so that the second width size is displayed by a long side of the display screen and the second height display size is displayed by a short side of the display screen.

3. The method of claim 2, wherein performing a rotational coordinate transformation on the determined first position coordinates to obtain rotated position coordinates of the second size display comprises:

rotating clockwise by 90 degrees around a center point of the display image of the second size as a center based on the determined first position coordinates to obtain rotated position coordinates of the display screen of the second size,

the initial position coordinates comprise a horizontal distance and a vertical distance of the upper left corner of the display image with the second size in the coordinate system displayed horizontally relative to the upper left corner of the display screen, the first position coordinates comprise a horizontal distance and a vertical distance of the upper left corner of the display image with the second size in the coordinate system displayed vertically relative to the upper left corner of the display screen, and the rotated position coordinates comprise a horizontal distance and a vertical distance of the upper left corner of the display image with the second size in the coordinate system displayed vertically relative to the upper left corner of the display screen.

4. The method of any of claims 1-3, wherein, for an input image to be displayed having a first size, determining, based on a first maximum display width and a first maximum display height, a display image of a second size for display subject to the first maximum display width and the first maximum display height comprises:

in a case where a first screen width-to-height ratio between a first maximum display width and a first maximum display height of the display screen is smaller than a first width-to-height ratio between a first width dimension and a first height dimension of an input image to be displayed, setting a second width dimension equal to the first maximum display width of the display screen and obtaining the second height dimension based on the second width dimension and the first width-to-height ratio, an

In the case where the first screen aspect ratio is greater than or equal to the first aspect ratio, the second height dimension is set equal to a first maximum display height of the display screen, and the second width dimension is obtained based on the second height dimension and the first aspect ratio.

5. An image processing apparatus for a display screen, comprising:

the device comprises a first maximum display width and first maximum display height determining module, a second maximum display height determining module and a display module, wherein the first maximum display width and the first maximum display height determining module are used for determining the size of a long side of the display screen as a first maximum display width and determining the size of a short side of the display screen as a first maximum display height under the condition that the current display direction of the display screen is a longitudinal display direction;

a first display image determining module, configured to determine, for an input image to be displayed having a first size, a display image of a second size for displaying under the conditions of the first maximum display width and the first maximum display height, wherein the first size includes a first width size and a first height size, and the second size includes a second width size and a second height size;

a second display image determination module, configured to determine, in a coordinate system of vertical display, a position coordinate of the display image of the second size, display the second width size with a long side of the display screen, and display the second height size with a short side of the display screen,

and under the longitudinal display direction, the display screen has a second maximum display height and a second maximum display width, the second maximum display height is the long side dimension, and the second maximum display width is the short side dimension.

6. The apparatus of claim 1, wherein the second display image determination module is further to:

determining initial position coordinates of the display image of the second size in a coordinate system for lateral display, wherein in the lateral display direction, the display screen has a third maximum display height and a third maximum display width, the third maximum display height is the short side dimension, and the third maximum display width is the long side dimension;

determining first position coordinates of the display image of the second size based on the initial position coordinates in a coordinate system for portrait display;

performing rotation coordinate transformation on the determined first position coordinate to obtain a rotated position coordinate of the display image of the second size; and

and displaying the display image of the second size according to the rotated position coordinates in a vertical display direction, so that the second width size is displayed by a long side of the display screen and the second height display size is displayed by a short side of the display screen.

7. The apparatus of claim 6, wherein the second display image determination module is further to:

rotating clockwise by 90 degrees around a center point of the display image of the second size as a center based on the determined first position coordinates to obtain rotated position coordinates of the display screen of the second size,

the initial position coordinates comprise a horizontal distance and a vertical distance of the upper left corner of the display image with the second size in the coordinate system displayed horizontally relative to the upper left corner of the display screen, the first position coordinates comprise a horizontal distance and a vertical distance of the upper left corner of the display image with the second size in the coordinate system displayed vertically relative to the upper left corner of the display screen, and the rotated position coordinates comprise a horizontal distance and a vertical distance of the upper left corner of the display image with the second size in the coordinate system displayed vertically relative to the upper left corner of the display screen.

8. The apparatus of any of claims 5-7, wherein the first display image determination module is further to:

in a case where a first screen width-to-height ratio between a first maximum display width and a first maximum display height of the display screen is smaller than a first width-to-height ratio between a first width dimension and a first height dimension of an input image to be displayed, setting a second width dimension equal to the first maximum display width of the display screen and obtaining the second height dimension based on the second width dimension and the first width-to-height ratio, an

In the case where the first screen aspect ratio is greater than or equal to the first aspect ratio, the second height dimension is set equal to a first maximum display height of the display screen, and the second width dimension is obtained based on the second height dimension and the first aspect ratio.

9. An image processing apparatus, the apparatus comprising:

a processor; and

a memory having computer-readable program instructions stored therein,

wherein the computer readable program instructions, when executed by the processor, perform the method of any of claims 1-4.

10. A computer readable storage medium for storing computer readable instructions which, when executed by a computer, cause the computer to perform the method of any one of claims 1-4.

Technical Field

The present application relates to the field of image processing, and in particular, to an image processing method, an image processing apparatus, an image processing device, and a computer-readable storage medium.

Background

As more and more mobile terminals having display screens are provided, the requirements of users for the display screens are higher and higher. In general, the displayed image is positive whether the display screen is displayed horizontally or vertically. For example, when a car is displayed, the image of the car is positive (i.e., the top of the car is facing up and the wheels are facing down). For example, for most images with a width greater than a height, the size of the image displayed in the landscape mode is larger than the size of the image displayed in the portrait mode, thereby utilizing more screen space and displaying more details. However, it cannot be forced that the user must view in the landscape display mode.

Disclosure of Invention

The present disclosure has been made in view of the above problems. The present disclosure provides an image processing method, an image processing apparatus, an image processing device, and a computer-readable storage medium.

According to an aspect of the present disclosure, there is provided an image processing method including: under the condition that the current display direction of the display screen is the longitudinal display direction, determining the size of the long side of the display screen as a first maximum display width, and determining the size of the short side of the display screen as a first maximum display height; for an input image to be displayed having a first size, determining a display image of a second size for display under conditions of a first maximum display width and a first maximum display height based on the first maximum display width and the first maximum display height, wherein the first size includes a first width size and a first height size, and the second size includes a second width size and a second height size; and under a coordinate system used for longitudinal display, determining position coordinates of a display image of the second size, displaying the second width size with a long side of the display screen and displaying the second height size with a short side of the display screen, wherein in the longitudinal display direction, the display screen has a second maximum display height and a second maximum display width, the second maximum display height is the long side size, and the second maximum display width is the short side size.

According to an example of the present disclosure, determining position coordinates of the display image of the second size in a coordinate system for landscape display includes: determining initial position coordinates of the display image of the second size in a coordinate system for portrait display, wherein in the landscape display direction, the display screen has a third maximum display height and a third maximum display width, the third maximum display height is the short side dimension, and the third maximum display width is the long side dimension; determining first position coordinates of the display image of the second size based on the initial position coordinates in a coordinate system for portrait display; performing rotation coordinate transformation on the determined first position coordinate to obtain a rotated position coordinate of the display image of the second size; and displaying the display image of the second size according to the rotated position coordinates in a vertical display direction, thereby displaying the second width size with a long side of the display screen and the second height display size with a short side of the display screen.

According to an example of the present disclosure, performing rotational coordinate transformation on the determined first position coordinates to obtain rotated position coordinates of the display screen of the second size includes: and based on the determined first position coordinate, clockwise rotating by 90 degrees around the central point of the display image with the second size as a center to obtain a rotated position coordinate of the display picture with the second size, wherein the initial position coordinate comprises a horizontal distance and a vertical distance of the upper left corner of the display image with the second size relative to the upper left corner of the display screen under a coordinate system of horizontal display, the first position coordinate comprises a horizontal distance and a vertical distance of the upper left corner of the display image with the second size relative to the upper left corner of the display screen under a coordinate system of vertical display, and the rotated position coordinate comprises a horizontal distance and a vertical distance of the upper left corner of the display image with the second size relative to the upper left corner of the display screen under a coordinate system of vertical display.

According to an example of the present disclosure, for an input image to be displayed having a first size, determining a display image of a second size for display under conditions of a first maximum display width and a first maximum display height based on the first maximum display width and the first maximum display height includes: in a case where a first screen aspect ratio between a first maximum display width and a first maximum display height of the display screen is smaller than a first aspect ratio between a first width dimension and a first height dimension of an input image to be displayed, setting a second width dimension equal to the first maximum display width of the display screen and obtaining the second height dimension based on the second width dimension and the first aspect ratio, and in a case where the first screen aspect ratio is greater than or equal to the first aspect ratio, setting the second height dimension equal to the first maximum display height of the display screen and obtaining the second width dimension based on the second height dimension and the first aspect ratio.

According to an aspect of the present disclosure, there is provided an image processing apparatus for a display screen, including: the device comprises a first maximum display width and first maximum display height determining module, a second maximum display height determining module and a display module, wherein the first maximum display width and the first maximum display height determining module are used for determining the size of a long side of the display screen as a first maximum display width and determining the size of a short side of the display screen as a first maximum display height under the condition that the current display direction of the display screen is a longitudinal display direction; a first display image determining module, configured to determine, for an input image to be displayed having a first size, a display image of a second size for displaying under the conditions of the first maximum display width and the first maximum display height, wherein the first size includes a first width size and a first height size, and the second size includes a second width size and a second height size; and a second display image determining module, configured to determine, in a vertical display coordinate system, a position coordinate of a display image of the second size, to display the second width size on a long side of the display screen and to display the second height size on a short side of the display screen, where, in the vertical display direction, the display screen has a second maximum display height and a second maximum display width, the second maximum display height is the long side size, and the second maximum display width is the short side size.

According to an example of the present disclosure, the second display image determination module is further configured to: determining initial position coordinates of the display image of the second size in a coordinate system for lateral display, wherein in the lateral display direction, the display screen has a third maximum display height and a third maximum display width, the third maximum display height is the short side dimension, and the second maximum display width is the long side dimension; determining first position coordinates of the display image of the second size based on the initial position coordinates in a coordinate system for portrait display; performing rotation coordinate transformation on the determined first position coordinate to obtain a rotated position coordinate of the display image of the second size; and displaying the display image of the second size according to the rotated position coordinates in a vertical display direction, thereby displaying the second width size with a long side of the display screen and the second height display size with a short side of the display screen.

According to an example of the present disclosure, the second display image determination module is further configured to: and based on the determined first position coordinate, clockwise rotating by 90 degrees around the central point of the display image with the second size as a center to obtain a rotated position coordinate of the display picture with the second size, wherein the initial position coordinate comprises a horizontal distance and a vertical distance of the upper left corner of the display image with the second size relative to the upper left corner of the display screen under a coordinate system of horizontal display, the first position coordinate comprises a horizontal distance and a vertical distance of the upper left corner of the display image with the second size relative to the upper left corner of the display screen under a coordinate system of vertical display, and the rotated position coordinate comprises a horizontal distance and a vertical distance of the upper left corner of the display image with the second size relative to the upper left corner of the display screen under a coordinate system of vertical display.

According to an example of the present disclosure, the first display image determination module is further configured to: in a case where a first screen aspect ratio between a first maximum display width and a first maximum display height of the display screen is smaller than a first aspect ratio between a first width dimension and a first height dimension of an input image to be displayed, setting a second width dimension equal to the first maximum display width of the display screen and obtaining the second height dimension based on the second width dimension and the first aspect ratio, and in a case where the first screen aspect ratio is greater than or equal to the first aspect ratio, setting the second height dimension equal to the first maximum display height of the display screen and obtaining the second width dimension based on the second height dimension and the first aspect ratio.

According to an aspect of the present disclosure, there is provided an image processing apparatus, the apparatus including: a processor; and a memory in which computer-readable program instructions are stored, wherein the above-described image processing method is performed when the computer-readable program instructions are executed by the processor.

According to an aspect of the present disclosure, there is provided a computer-readable storage medium for storing computer-readable instructions, which, when executed by a computer, cause the computer to perform the above-described image processing method.

In the aspect of the disclosure, the effect that the horizontal display effect is also displayed in the vertical display direction can be realized, so that more image details are provided, and the user experience is improved.

Drawings

The above and other objects, features and advantages of the present disclosure will become more apparent by describing in more detail embodiments of the present disclosure with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the principles of the disclosure and not to limit the disclosure. In the drawings, like reference numbers generally represent like parts or steps.

FIG. 1 is a flow chart of an image processing method according to an embodiment of the present disclosure;

FIG. 2 is a schematic diagram of a display screen according to an embodiment of the present disclosure with a current display orientation being a portrait display orientation;

FIG. 3 is a schematic illustration of a display image of a second size displayed conditioned on the first maximum display width and first maximum display height according to an embodiment of the disclosure;

FIG. 4 is another schematic illustration of a display image of a second size being displayed conditioned on the first maximum display width and first maximum display height in accordance with an embodiment of the present disclosure;

FIG. 5 is a flow chart of a method of determining position coordinates of a display image of a second size in a coordinate system for portrait display according to an embodiment of the present disclosure;

FIG. 6 is a schematic diagram of determining position coordinates of a display image of a second size in a coordinate system for portrait display according to an embodiment of the present disclosure;

FIG. 7 is a schematic diagram of a rotational coordinate transformation performed on the initial position coordinates determined in FIG. 6, in accordance with an embodiment of the present disclosure;

FIG. 8 is another schematic diagram of determining position coordinates of a display image of a second size in a coordinate system for portrait display according to an embodiment of the present disclosure;

FIG. 9 is a schematic diagram of a rotational coordinate transformation performed on the initial position coordinates determined in FIG. 8, in accordance with an embodiment of the present disclosure;

10(a) - (b) are schematic diagrams of rotational coordinate transformation of an enlarged display image according to an embodiment of the present disclosure;

FIG. 11 is a schematic diagram of an image processing apparatus according to an embodiment of the present disclosure;

FIG. 12 is a schematic diagram of an image processing apparatus according to an embodiment of the present disclosure;

fig. 13 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present disclosure.

Detailed Description

The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure. It is to be understood that the described embodiments are merely exemplary of some, and not all, of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without any inventive step, are intended to be within the scope of the present disclosure.

Flow charts are used herein to illustrate steps of methods according to embodiments of the present application. It should be understood that the preceding and following steps are not necessarily performed in the exact order in which they are performed. Rather, various steps may be processed in reverse order or simultaneously. Meanwhile, other operations may be added to the processes, or a certain step or steps may be removed from the processes.

First, an image processing method for implementing an embodiment of the present disclosure is described with reference to fig. 1. For example, the method may be implemented in software, hardware, firmware, or any combination thereof, loaded and executed by a processor in a device such as a cell phone, a tablet, a laptop, a desktop, a web server, or the like. For example, the image processing method of the present disclosure may be applied to various suitable fields, such as automobile displays and the like.

According to the image processing method, the position of the display image under the condition that the current display direction of the display screen is the virtual transverse display direction can be obtained firstly, and the position of the display image which is transversely displayed under the condition that the current display direction of the display screen is the longitudinal display direction is obtained through position rotation transformation, so that various zooming modes can be adaptively provided for a user, and the user experience is improved.

As shown in fig. 1, the image processing method 100 includes the following steps S101-S103.

In step S101, when the current display direction of the display screen is the longitudinal display direction, the long side size of the display screen is determined as a first maximum display width, and the short side size of the display screen is determined as a first maximum display height.

In step S102, for an input image to be displayed having a first size, the first size including a first width size and a first height size, the second size including a second width size and a second height size, a display image of a second size for displaying under the conditions of a first maximum display width and a first maximum display height is determined based on the first maximum display width and the first maximum display height.

In step S103, in a coordinate system for vertical display, determining position coordinates of the display image of the second size, displaying the second width size with a long side of the display screen, and displaying the second height size with a short side of the display screen, where in the vertical display direction, the display screen has a second maximum display height and a second maximum display width, the second maximum display height is the long side size, and the second maximum display width is the short side size.

For example, for step S101, the display screen may be incorporated into a wide range of devices, including digital televisions, digital direct broadcast systems, wireless broadcast systems, Personal Digital Assistants (PDAs), laptop or desktop computers, tablet computers, e-book readers, digital cameras, digital recording devices, digital media players, video gaming devices, video gaming consoles, cellular or satellite radio telephones (so-called "smart phones"), video teleconferencing devices, video streaming devices, and the like. As a specific example, in a case where a display screen is incorporated into a smartphone, in a case where a current display direction of the display screen is a portrait display direction, the current display direction of the smartphone may be considered as a portrait display direction.

For example, the current display direction of the display screen may be determined by determining the current width and the current height of the display screen. As one example, where the current width of the display screen is less than the current height, the current display orientation of the display screen is portrait display (e.g., the smartphone is portrait display). As another example, where the current width of the display screen is greater than the current height, the current display orientation of the display screen is landscape (e.g., the smartphone is landscape). The present disclosure is explained taking a current display direction of a display screen as a longitudinal display direction as an example.

Fig. 2 shows a schematic diagram in which the current display direction of the display screen is the portrait display direction according to an embodiment of the present disclosure. As shown in fig. 2, in the case where the current display direction of the display screen is the portrait display direction, the long side size of the display screen is determined as a first maximum display width, and the short side size of the display screen is determined as a first maximum display height. Fig. 3 to 4 are schematic diagrams showing a display image having a reference scale (e.g., a scale of 1) displayed under the conditions of the first maximum display width and the first maximum display height. For example, it may be understood that the portrait display orientation is changed to a virtual landscape display orientation (as indicated by the dashed boxes in fig. 3-4).

For step S102, for example, for an input image to be displayed with a first size, the resolution (e.g., 2016 × 1512 pixels) of the input image to be displayed with the first size is the same as the resolution of the display image with the second size, based on the first maximum display width and the first maximum display height, a display image with a second size for displaying under the conditions of the first maximum display width and the first maximum display height may be determined. For example, the first size and the second size both represent a currently displayed physical size of the image, and a first aspect ratio between the first width size and the first height size is equal to a second aspect ratio between the second width size and the second height size.

For example, as shown in fig. 3, in the case where a first screen width-to-height ratio between a first maximum display width and a first maximum display height of the display screen is greater than or equal to a first width-to-height ratio between a first width dimension and a first height dimension of the input image to be displayed, the second height dimension may be set equal to the first maximum display height of the display screen (height filling), and the second width dimension may be obtained based on the second height dimension and the first width-to-height ratio.

For example, as shown in fig. 4, in the case where a first screen width-to-height ratio between a first maximum display width and a first maximum display height of the display screen is smaller than a first width-to-height ratio between a first width dimension and a first height dimension of the input image to be displayed, the second width dimension may be set equal to the first maximum display width (width fill) of the display screen and the second height dimension may be obtained by calculation based on the second width dimension and the first width-to-height ratio.

For example, the display image having the second size obtained after the height filling and the width filling described in fig. 3 to 4 may be taken as the display image of the scale of 1, and the display image may be scaled with reference to the second width size, the second height size, and the position of the display image of the scale of 1 to obtain the size and the position of the scaled display image.

For example, with respect to step S103, determining the position coordinates of the display image of the second size in the coordinate system for portrait display according to an embodiment of the present disclosure is explained with reference to fig. 5 to 9. FIG. 5 illustrates a flow chart of a method 200 of determining position coordinates of a display image of a second size in a coordinate system for portrait display according to an embodiment of the present disclosure. Fig. 6 illustrates a schematic diagram of determining position coordinates of a display image of a second size in a coordinate system for portrait display according to an embodiment of the present disclosure. FIG. 7 illustrates a schematic diagram of a rotational coordinate transformation performed on the initial position coordinates determined in FIG. 6, according to an embodiment of the disclosure. Fig. 8 illustrates another schematic diagram for determining position coordinates of a display image of a second size in a coordinate system for portrait display according to an embodiment of the present disclosure. FIG. 9 illustrates a schematic diagram of a rotational coordinate transformation of the initial position coordinates determined in FIG. 8 according to an embodiment of the disclosure.

As shown in fig. 5, determining the position coordinates of the display image of the second size in the coordinate system for portrait display may include: determining initial position coordinates of the display image of the second size in a coordinate system for landscape display, wherein the display screen has a third maximum display height and a third maximum display width in the landscape display direction, the third maximum display height being the short side size and the third maximum display width being the long side size (S201); determining first position coordinates of the display image of the second size based on the initial position coordinates in a coordinate system for portrait display (S202); performing rotational coordinate transformation on the determined first position coordinates to obtain rotated position coordinates of the display image of the second size (S203); and displaying the display image of the second size in accordance with the rotated position coordinates in a portrait display direction, thereby displaying the second width size with a long side of the display screen and the second height display size with a short side of the display screen (S204).

For example, with respect to step S203, performing rotational coordinate transformation on the determined first position coordinates to obtain rotated position coordinates of the display screen of the second size may include: and based on the determined first position coordinate, clockwise rotating by 90 degrees by taking the central point of the display image with the second size as a center to obtain a rotated position coordinate of the display picture with the second size. Here, the initial position coordinates may include a horizontal distance and a vertical distance of an upper left corner of the display image of the second size in the horizontally displayed coordinate system with respect to an upper left corner of the display screen, the first position coordinates may include a horizontal distance and a vertical distance of an upper left corner of the display image of the second size in the vertically displayed coordinate system with respect to an upper left corner of the display screen, and the rotated position coordinates may include a horizontal distance and a vertical distance of an upper left corner of the display image of the second size in the vertically displayed coordinate system with respect to an upper left corner of the display screen.

As an example, the rotational coordinate transformation corresponding to fig. 3 is first described with reference to fig. 6 to 7.

As shown in fig. 6, the display image in the dashed box may represent the display image in the condition of the first maximum display width and the first maximum display height (e.g., the virtual lateral display direction) shown in fig. 3, and the dashed box may also represent the display image in the coordinate system for lateral display (e.g., with the upper left corner of the dashed box as the origin of coordinates); the display image in the solid line frame may represent the display image in the conditions of the second maximum display width and the second maximum display height (such as the longitudinal display direction) shown in fig. 3, and the solid line frame may also represent the display image in the coordinate system for longitudinal display (for example, with the upper left corner of the solid line frame as the origin of coordinates).

For example, returning to fig. 5, for step S201, in the coordinate system for the lateral display (as indicated by the dashed line box), the initial position coordinates (horizontal distance rotaleft and vertical distance rotatop of the upper left corner of the display image of the second size with respect to the display screen) of the display image of the second size (as indicated by the automobile image in fig. 6) may be first determined:

rotateLeft=(windowHeight-width)/2

rotateTop=0 (1)

here, height and width may be obtained as described in detail in fig. 3. Here, the windows width and the windows height respectively indicate a first maximum display width and a first maximum display height, the height and the width respectively indicate a second height size and a second width size of the display image of the second size, and the imgaas aspect indicates a first aspect ratio between the first width size and the first height size of the input image to be displayed. As an example, the initial position coordinates of the display image of the second size in the coordinate system of the horizontal display are represented by rotaleft and rotatop, but it should be appreciated that the initial position coordinates may be represented by other manners, and are not limited herein.

Next, as shown in fig. 6, for step S102, the first position coordinates of the display image of the second size (horizontal distance left and vertical distance top of the upper left corner of the display image of the second size with respect to the upper left corner of the display screen in the coordinate system for portrait display) may be determined based on the initial position coordinates in the coordinate system for portrait display (as shown in the solid line box of fig. 6):

top=width/2+rotateLeft-height/2

left=windowHeight-height/2-rotateTop-width/2 (2)

as an example, the present application takes Top and Left as an example to represent the first position coordinate of the display image of the second size in the coordinate system of the vertical display, and it should be appreciated that the present application may also represent the first position coordinate in other manners, which is not limited herein.

Next, as shown in fig. 7, according to step S203, the first position coordinate in the coordinate system of the vertical display is subjected to rotational coordinate transformation, for example, clockwise rotated by 90 degrees around the center point of the display image of the second size, so as to obtain the rotated position coordinate of the display image of the second size (the horizontal distance Left _1 and the vertical distance Top _1 between the upper Left corner of the display image of the second size after being rotated and the upper Left corner of the display screen in the coordinate system of the vertical display):

Left_1=windowHeight

Top_1=(windowWidth-width)/2 (3)

for example, the algorithm for the rotational transformation of the first position coordinate to the rotated position coordinate may be any suitable existing or future coordinate transformation algorithm, and the application is not limited thereto.

Next, returning to step S204, as shown in fig. 7, the display image of the second size is displayed in the rotated position coordinates in the vertical display direction (e.g., the vertical screen direction) (as shown by the solid line frame in fig. 7), so that the second width size is displayed with the long side of the display screen and the second height display size is displayed with the short side of the display screen.

As another example, a rotational coordinate transformation corresponding to fig. 4 is described with reference to fig. 8 to 9.

As shown in fig. 8, the display image in the dashed box may represent the display image in the condition of the first maximum display width and the first maximum display height (e.g., the virtual lateral display direction) shown in fig. 4, and the dashed box may also represent the display image in the coordinate system for lateral display (e.g., with the upper left corner of the dashed box as the origin of coordinates); the display image in the solid line frame may represent the display image in the conditions of the second maximum display width and the second maximum display height (such as the longitudinal display direction) shown in fig. 4, and the solid line frame may also represent the display image in the coordinate system for longitudinal display (for example, with the upper left corner of the solid line frame as the origin of coordinates).

For example, returning to fig. 5, for step S201, in the coordinate system for the lateral display (as indicated by the dashed line box), the initial position coordinates (the horizontal distance rotaleft and the vertical distance rotatop of the upper left corner of the display image of the second size with respect to the display screen in the coordinate system for the lateral display) of the display image of the second size (such as the car image in fig. 8) may be first determined:

rotateLeft=0

rotateTop=(windowHeight-height)/2 (4)

here, the width and height can be obtained as detailed in fig. 4. Here, the windows width and the windows height respectively indicate a first maximum display width and a first maximum display height, the height and the width respectively indicate a second height size and a second width size of the display image of the second size, and the imgaas aspect indicates a first aspect ratio between the first width size and the first height size of the input image to be displayed. As an example, the initial position coordinates of the display image of the second size in the coordinate system of the horizontal display are represented by rotaleft and rotatop, but it should be appreciated that the initial position coordinates may be represented by other manners, and are not limited herein.

Next, for step S102, the first position coordinates of the display image of the second size (horizontal distance left and vertical distance top of the upper left corner of the display image of the second size with respect to the upper left corner of the display screen in the coordinate system for portrait display) may be determined based on the initial position coordinates in the coordinate system for portrait display (as shown in the solid line box of fig. 8):

top=width/2+rotateLeft-height/2

left=windowHeight-height/2-rotateTop-width/2 (5)

as an example, the present application takes Top and Left as an example to represent the first position coordinate of the display image of the second size in the coordinate system of the vertical display, and it should be appreciated that the present application may also represent the first position coordinate in other manners, which is not limited herein.

Next, as shown in fig. 9, according to step S203, the first position coordinate in the coordinate system of the vertical display is subjected to rotational coordinate transformation, for example, clockwise rotated by 90 degrees around the center point of the display image of the second size, so as to obtain the rotated position coordinate of the display image of the second size (the horizontal distance Left _1 and the vertical distance Top _1 between the upper Left corner of the display image of the second size after being rotated and the upper Left corner of the display screen in the coordinate system of the vertical display):

Left_1=(windowHeight+height)/2

Top_1=0 (6)

for example, the algorithm for the rotational transformation of the first position coordinate to the rotated position coordinate may be any suitable existing or future coordinate transformation algorithm, and the application is not limited thereto.

Next, returning to step S204, as shown in fig. 9, the display image of the second size is displayed in the rotated position coordinates in the vertical display direction (e.g., the vertical screen direction) (as shown by the solid line frame of fig. 9), so that the second width size is displayed with the long side of the display screen and the second height display size is displayed with the short side of the display screen.

It should be appreciated that the above clockwise rotation is only an example, and the position coordinates after rotation can also be obtained by counterclockwise rotation in a similar manner, which is not described herein again.

The present disclosure describes the initial position coordinates in terms of the horizontal and vertical distances of the upper left corner of the display image in the horizontally displayed coordinate system relative to the upper left corner of the display screen, describes the first position coordinates in terms of the horizontal and vertical distances of the upper left corner of the display image in the vertically displayed coordinate system relative to the upper left corner of the display screen, and describes the rotated position coordinates in terms of the horizontal and vertical distances of the upper left corner of the display image in the vertically displayed coordinate system relative to the upper left corner of the display screen is merely an example, and it should be appreciated that the present disclosure may also describe the initial position coordinates and the rotated position coordinates in terms of other relative positional relationships, and the present disclosure is not limited.

The rotational coordinate transformation of a displayed image having a reference scale (e.g., scale of 1) corresponding to fig. 3-4 is described above with reference to fig. 6-9. For example, for a display image having another zoom ratio, the method of the present application may be applied to perform rotational coordinate transformation so as to perform landscape display in a case where the current display direction of the display screen is the portrait display direction.

Fig. 10(a) - (b) show schematic diagrams of rotational coordinate transformation of an enlarged display image according to an embodiment of the present disclosure. For example, fig. 10(a) corresponds to the display direction and the display coordinate system of the dotted line frame of fig. 6 to 9 of the present application, and fig. 10(b) corresponds to the display direction and the display coordinate system of the solid line frame of fig. 6 to 9 of the present application.

Referring to the description of fig. 6-9, first, in a coordinate system for lateral display (as shown in fig. 10 (a)), initial position coordinates (horizontal distance rotaleft and vertical distance rotatop of the upper left corner of the enlarged display image with respect to the upper left corner of the display screen, with the upper left corner of the display screen as a coordinate origin) of the enlarged display image (e.g., the car image in fig. 10 (a)) may be first determined. Next, as shown in fig. 10(b), first position coordinates of the enlarged display image (horizontal distance left and vertical distance top of the upper left corner of the enlarged display image with respect to the upper left corner of the display screen in fig. 10 (b)) may be determined based on the initial position coordinates in the coordinate system for portrait display:

left=d-width/2

top=a-b (7)

wherein the variables (var) a, b, c, d are each

var a=width/2+rotateLeft,

var b=height/2,

var c=height/2+rotateTop,

var d=windowHeight–c, (8)

Here, the widdth and widowheight respectively indicate a first maximum display width and a first maximum display height, height and width respectively indicate a height size and a width size of the enlarged display image, imgaas aspect indicates an aspect ratio between the width size and the height size of the input image to be displayed, and the horizontal distance and the vertical distance from the picture rotation center to the picture edge are respectively width/2 and height/2.

From equations (7) and (8), the transformation relationship from the initial position coordinates to the first position coordinates can be obtained (the same as equations (2) and (5)):

top=width/2+rotateLeft-height/2

left=windowHeight-height/2-rotateTop-width/2 (9)

next, the first position coordinates in the coordinate system of the vertical display shown in fig. 10(b) are subjected to rotational coordinate transformation in accordance with step S203, for example, rotated 90 degrees clockwise around the center point of the enlarged display image to obtain rotated position coordinates of the enlarged display image.

It should be appreciated that the rotation coordinate transformation of the enlarged display image shown in fig. 10(a) - (b) is only an example, and the present disclosure may also process the reduced display image according to the above method, and will not be described herein.

According to the image processing method, the position of the display image under the condition that the current display direction of the display screen is the virtual transverse display direction can be obtained firstly, and the position of the display image which is transversely displayed under the condition that the current display direction of the display screen is the longitudinal display direction is obtained through position rotation transformation, so that the transverse display effect is also displayed under the longitudinal display direction, more image details are provided, and the user experience is improved.

An image processing method according to an embodiment of the present disclosure is described above with reference to fig. 1 to 10. Next, an image processing apparatus according to an embodiment of the present disclosure is described with reference to fig. 11.

As shown in fig. 11, the image processing apparatus 1000 according to the embodiment of the present disclosure includes a first maximum display width and first maximum display height determining module 1001, a first display image determining module 1002, and a second display image determining module 1003. Those skilled in the art understand that: these modules may be implemented in various ways by hardware alone, by software alone, or by a combination thereof, and the present disclosure is not limited to any one of them. These modules may be implemented, for example, by a central processing module (CPU), image processor (GPU), Tensor Processor (TPU), Field Programmable Gate Array (FPGA) or other form of processing module having data processing and/or instruction execution capabilities and corresponding computer instructions.

For example, the first maximum display width and first maximum display height determining module 1001 may be configured to determine, when the current display direction of the display screen is the portrait display direction, a long side size of the display screen as the first maximum display width, and determine a short side size of the display screen as the first maximum display height.

For example, the first maximum display width and first maximum display height determination module 1001 may determine the current display orientation of the display screen by determining the current width and current height of the display screen. As one example, where the current width of the display screen is less than the current height, the current display orientation of the display screen is portrait display (e.g., the smartphone is portrait display). As another example, where the current width of the display screen is greater than the current height, the current display orientation of the display screen is landscape (e.g., the smartphone is landscape). The present disclosure is explained taking a current display direction of a display screen as a longitudinal display direction as an example.

For example, the first display image determining module 1002 may be configured to determine, for an input image to be displayed having a first size, a display image of a second size for displaying under the conditions of the first maximum display width and the first maximum display height, wherein the first size includes a first width size and a first height size, and the second size includes a second width size and a second height size. For example, the resolution (e.g., 2016 pixels 1512 pixels) of the input image to be displayed of the first size and the displayed image of the second size are the same. For example, the first size and the second size both represent a currently displayed physical size of the image, and a first aspect ratio between the first width size and the first height size is equal to a second aspect ratio between the second width size and the second height size.

For example, in a case where a first screen aspect ratio between a first maximum display width and a first maximum display height of the display screen is greater than or equal to a first aspect ratio between a first width dimension and a first height dimension of the input image to be displayed, the first display image determination module 1002 may set the second height dimension to be equal to the first maximum display height of the display screen (height filling), and obtain the second width dimension based on the second height dimension and the first aspect ratio.

For example, in a case where a first screen aspect ratio between a first maximum display width and a first maximum display height of the display screen is smaller than a first aspect ratio between a first width size and a first height size of the input image to be displayed, the first display image determination module 1002 may set the second width size to be equal to the first maximum display width (width fill) of the display screen and calculate the second height size based on the second width size and the first aspect ratio.

For example, the display image having the second size obtained after the height filling and the width filling may be taken as the display image of the scale of 1, and the display image may be scaled with reference to the second width size, the second height size, and the position of the display image of the scale of 1 to obtain the size and the position of the scaled display image.

For example, the second display image determining module 1003 may be configured to determine, in a coordinate system of a vertical display, position coordinates of a display image of the second size, display the second width size with a long side of the display screen and display the second height size with a short side of the display screen, where, in the vertical display direction, the display screen has a second maximum display height and a second maximum display width, the second maximum display height is the long side size, and the second maximum display width is the short side size.

For example, the second display image determination module 1003 may be further configured to: determining initial position coordinates of the display image of the second size in a coordinate system for lateral display, wherein in the lateral display direction, the display screen has a third maximum display height and a third maximum display width, the third maximum display height is the short side dimension, and the third maximum display width is the long side dimension; determining first position coordinates of the display image of the second size based on the initial position coordinates in a coordinate system for portrait display; performing rotation coordinate transformation on the determined first position coordinate to obtain a rotated position coordinate of the display image of the second size; and displaying the display image of the second size according to the rotated position coordinates in a vertical display direction, thereby displaying the second width size with a long side of the display screen and the second height display size with a short side of the display screen.

For example, the second display image determination module 1003 may be further configured to: and based on the determined first position coordinate, clockwise rotating by 90 degrees around the central point of the display image with the second size as a center to obtain a rotated position coordinate of the display picture with the second size, wherein the first position coordinate comprises a horizontal distance and a vertical distance of the upper left corner of the display image with the second size relative to the upper left corner of the display screen under the coordinate system of vertical display, and the rotated position coordinate comprises a horizontal distance and a vertical distance of the upper left corner of the display image with the second size relative to the upper left corner of the display screen under the coordinate system of vertical display.

It should be appreciated that the above clockwise rotation is only an example, and the position coordinates after rotation can also be obtained by counterclockwise rotation in a similar manner, which is not described herein again.

The present disclosure describes the initial position coordinates in terms of the horizontal and vertical distances of the upper left corner of the display image in the horizontally displayed coordinate system relative to the upper left corner of the display screen, describes the first position coordinates in terms of the horizontal and vertical distances of the upper left corner of the display image in the vertically displayed coordinate system relative to the upper left corner of the display screen, and describes the rotated position coordinates in terms of the horizontal and vertical distances of the upper left corner of the display image in the vertically displayed coordinate system relative to the upper left corner of the display screen is merely an example, and it should be appreciated that the present disclosure may also describe the initial position coordinates and the rotated position coordinates in terms of other relative positional relationships, and the present disclosure is not limited.

According to the image processing device, the position of the display image under the condition that the current display direction of the display screen is the virtual transverse display direction can be obtained firstly, and the position of the display image which is transversely displayed under the condition that the current display direction of the display screen is the longitudinal display direction is obtained through position rotation transformation, so that the transverse display effect is also displayed under the longitudinal display direction, more image details are provided, and the user experience is improved.

Next, an image processing apparatus 1100 according to an embodiment of the present disclosure is described with reference to fig. 12. Fig. 12 shows a schematic diagram of an image processing device 1100 according to an embodiment of the disclosure. Since the functions of the image processing apparatus 1100 of the present embodiment are the same as the details of the method described hereinabove with reference to fig. 1, a detailed description of the same is omitted here for the sake of simplicity.

The image processing apparatus 1100 of the present disclosure includes a processor 1102; and a memory 1101 in which computer readable instructions are stored, which when executed by the processor perform a method of image processing, the method comprising: under the condition that the current display direction of the display screen is the longitudinal display direction, determining the size of the long side of the display screen as a first maximum display width, and determining the size of the short side of the display screen as a first maximum display height; for an input image to be displayed having a first size, determining a display image of a second size for display under the conditions of the first maximum display width and the first maximum display height, wherein the first size includes a first width size and a first height size, and the second size includes a second width size and a second height size; and under a coordinate system used for longitudinal display, determining position coordinates of a display image of the second size, displaying the second width size with a long side of the display screen and displaying the second height size with a short side of the display screen, wherein in the longitudinal display direction, the display screen has a second maximum display height and a second maximum display width, the second maximum display height is the long side size, and the second maximum display width is the short side size.

For technical effects of the image processing apparatus 1000 and the image processing device 1100 in different embodiments, reference may be made to technical effects of the image processing method provided in the embodiments of the present disclosure, which are not described herein again.

The image processing apparatus 1000 and the image processing device 1100 may be used for various appropriate electronic devices.

Fig. 13 is a schematic diagram of a computer-readable storage medium 1200 according to an embodiment of the present disclosure.

As shown in fig. 13, the present disclosure also includes a computer-readable storage medium 1200 for storing computer-readable instructions 1201 which, when executed by a computer, the computer performs an image processing method, the method comprising: under the condition that the current display direction of the display screen is the longitudinal display direction, determining the size of the long side of the display screen as a first maximum display width, and determining the size of the short side of the display screen as a first maximum display height; for an input image to be displayed having a first size, determining a display image of a second size for display under the conditions of the first maximum display width and the first maximum display height, wherein the first size includes a first width size and a first height size, and the second size includes a second width size and a second height size; and under a coordinate system used for longitudinal display, determining position coordinates of a display image of the second size, displaying the second width size with a long side of the display screen and displaying the second height size with a short side of the display screen, wherein in the longitudinal display direction, the display screen has a second maximum display height and a second maximum display width, the second maximum display height is the long side size, and the second maximum display width is the short side size.

The computer-readable storage medium includes, but is not limited to, volatile memory and/or non-volatile memory, for example. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc.

Those skilled in the art will appreciate that the disclosure of the present disclosure is susceptible to numerous variations and modifications. For example, the various devices or components described above may be implemented in hardware, or may be implemented in software, firmware, or a combination of some or all of the three.

Further, while the present disclosure makes various references to certain elements of a system according to embodiments of the present disclosure, any number of different elements may be used and run on a client and/or server. The units are illustrative only, and different aspects of the systems and methods may use different units.

It will be understood by those skilled in the art that all or part of the steps of the above methods may be implemented by instructing the relevant hardware through a program, and the program may be stored in a computer readable storage medium, such as a read only memory, a magnetic or optical disk, and the like. Alternatively, all or part of the steps of the above embodiments may be implemented using one or more integrated circuits. Accordingly, each module/unit in the above embodiments may be implemented in the form of hardware, and may also be implemented in the form of a software functional module. The present disclosure is not limited to any specific form of combination of hardware and software.

Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.

The foregoing is illustrative of the present disclosure and is not to be construed as limiting thereof. Although a few exemplary embodiments of this disclosure have been described, those skilled in the art will readily appreciate that many modifications are possible in the exemplary embodiments without materially departing from the novel teachings and advantages of this disclosure. Accordingly, all such modifications are intended to be included within the scope of this disclosure as defined in the claims. It is to be understood that the foregoing is illustrative of the present disclosure and is not to be construed as limited to the specific embodiments disclosed, and that modifications to the disclosed embodiments, as well as other embodiments, are intended to be included within the scope of the appended claims. The present disclosure is defined by the claims and their equivalents.

24页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种应用程序声音的控制实现方法以及电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类