CN111738917A - Picture scaling method, device, equipment and storage medium - Google Patents

Picture scaling method, device, equipment and storage medium Download PDF

Info

Publication number
CN111738917A
CN111738917A CN201910492474.5A CN201910492474A CN111738917A CN 111738917 A CN111738917 A CN 111738917A CN 201910492474 A CN201910492474 A CN 201910492474A CN 111738917 A CN111738917 A CN 111738917A
Authority
CN
China
Prior art keywords
picture
sub
stretched
target
pictures
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910492474.5A
Other languages
Chinese (zh)
Other versions
CN111738917B (en
Inventor
李宝瑜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201910492474.5A priority Critical patent/CN111738917B/en
Publication of CN111738917A publication Critical patent/CN111738917A/en
Application granted granted Critical
Publication of CN111738917B publication Critical patent/CN111738917B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The embodiment of the invention discloses a picture expansion method, a picture expansion device, picture expansion equipment and a storage medium, wherein the method comprises the following steps: acquiring at least two areas to be stretched and target stretching information in a picture to be stretched; cutting the picture to be stretched based on each region to be stretched, and determining at least two first sub-pictures, wherein each first sub-picture comprises one region to be stretched; according to the target expansion information, expanding and contracting the area to be expanded and contracted in each first sub-picture, and determining a second sub-picture after expansion and contraction; and splicing the second sub-pictures to obtain the picture to be stretched. By the technical scheme of the embodiment of the invention, the picture quality can be ensured, and the picture expansion efficiency is improved.

Description

Picture scaling method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to a picture processing technology, in particular to a picture scaling method, a picture scaling device, picture scaling equipment and a storage medium.
Background
With the rapid development of scientific technology, various application software can be developed and applied to intelligent equipment. In the design of a user interface, some picture controls, such as dialog boxes, need to be adapted to different screen resolutions and different lengths of display contents, so that the size of a picture needs to be dynamically adjusted by stretching or compressing the picture.
Currently, in application software based on an iOS operating system, if a plurality of local areas in a picture are scaled, each local area needs to be scaled one by one. For example, when two local regions in a certain picture are stretched, one local region in the picture needs to be stretched first, a new stretched picture is obtained in a system screen capture mode, and then another local region in the new picture is stretched, so that a final stretched picture is obtained.
However, in the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
because the new picture generated in the middle of the existing picture scaling mode is obtained by screen capture, the situation of distortion of partial areas can occur. And when the number of the local areas to be stretched is large, more new pictures can be generated, the overhead of the system performance is greatly increased, and the picture stretching efficiency is also reduced.
Disclosure of Invention
The embodiment of the invention provides a picture stretching method, a picture stretching device, picture stretching equipment and a storage medium, which are used for ensuring the picture quality and improving the picture stretching efficiency.
In a first aspect, an embodiment of the present invention provides a picture scaling method, including:
acquiring at least two areas to be stretched and target stretching information in a picture to be stretched;
cutting the picture to be stretched based on each region to be stretched, and determining at least two first sub-pictures, wherein each first sub-picture comprises one region to be stretched;
according to the target expansion and contraction information, expanding and contracting the area to be expanded and contracted in each first sub-picture, and determining a second sub-picture after expansion and contraction;
and splicing the second sub-pictures to obtain the picture to be stretched.
In a second aspect, an embodiment of the present invention further provides a picture stretching device, including:
the device comprises a to-be-stretched area acquisition module, a target stretching module and a stretching module, wherein the to-be-stretched area acquisition module is used for acquiring at least two to-be-stretched areas and target stretching information in a to-be-stretched picture;
the to-be-stretched picture cutting module is used for cutting the to-be-stretched picture based on each to-be-stretched area and determining at least two first sub-pictures, wherein each first sub-picture comprises one to-be-stretched area;
the first sub-picture expansion module is used for expanding and contracting the area to be expanded and contracted in each first sub-picture according to the target expansion and contraction information and determining an expanded and contracted second sub-picture;
and the second sub-picture splicing module is used for splicing the second sub-pictures to obtain the picture to be stretched.
In a third aspect, an embodiment of the present invention further provides an apparatus, where the apparatus includes:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the steps of the picture scaling method as provided by any of the embodiments of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the steps of the picture scaling method provided in any embodiment of the present invention.
The embodiment of the invention has the following advantages or beneficial effects:
the method comprises the steps that according to each area to be stretched in an image to be stretched, the image to be stretched is cut to obtain at least two first sub-images, and each first sub-image comprises one area to be stretched; according to the target expansion information corresponding to the picture to be expanded, the area to be expanded in each first sub-picture is expanded and contracted simultaneously to obtain the second sub-picture after expansion and contraction, all the second sub-pictures are spliced to obtain the picture after expansion and contraction of the picture to be expanded and contracted, so that a plurality of local areas in the picture can be controlled to expand and contract simultaneously, a new picture in the middle can not be generated, the picture quality is guaranteed, the system performance cost is reduced, and the picture expansion and contraction efficiency is greatly improved.
Drawings
Fig. 1 is a flowchart of a method for scaling a picture according to an embodiment of the present invention;
fig. 2 is a flowchart of a picture scaling method according to a second embodiment of the present invention;
fig. 3 is an example of picture stretching according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a picture stretching device according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a picture scaling method according to an embodiment of the present invention, which is applicable to scaling at least two local regions in a picture, and is particularly applicable to an application scenario for scaling a picture in application software based on an iOS operating system. The method can be executed by a picture expansion device, and the device can be realized by software and/or hardware and is integrated in a terminal with an iOS system or an Android system, such as a terminal of a smart phone, a tablet computer or a handheld game console. As shown in fig. 1, the method specifically includes the following steps:
s110, at least two areas to be stretched and contracted and target stretching and contracting information in the picture to be stretched and contracted are obtained.
The region to be stretched or shrunk may be a region that needs to be stretched or compressed, and may be any one of local regions specified in the picture to be stretched or shrunk. The position, the size and the number of the area to be stretched in the picture to be stretched can be determined according to the service requirement and the actual scene. The target telescopic information may include, but is not limited to, a total telescopic distance and a telescopic direction corresponding to the picture to be telescopic, where the total telescopic distance may refer to a total length of the picture to be telescopic that needs to be stretched or compressed; the telescoping direction may be a transverse direction, a longitudinal direction, or any other designated direction.
Specifically, in this embodiment, each region to be zoomed in and out in the picture to be zoomed out and zoomed out may be predetermined based on the service scene and the shape and size of the picture to be zoomed out and zoomed out. And determining target expansion and contraction information corresponding to the picture to be expanded and contracted based on the screen resolution or the length of the content to be displayed so as to be adaptive to the screen resolution or to display the picture content with the length.
And S120, cutting the picture to be stretched based on each region to be stretched, and determining at least two first sub-pictures, wherein each first sub-picture comprises one region to be stretched.
Specifically, the picture to be stretched may be cut according to each region to be stretched in the picture to be stretched, so that each first sub-picture obtained after cutting includes one region to be stretched. The number of the regions to be stretched is equal to the number of the first sub-pictures in this embodiment.
Exemplarily, S120 may include: determining a cutting line between every two adjacent areas to be stretched based on the position of each area to be stretched in the picture to be stretched; and cutting the picture to be stretched according to each cutting line, and taking each picture obtained after cutting as a first sub-picture.
The cutting line may refer to any line between two regions to be stretched so as to separate the two regions to be stretched. The cutting line in this embodiment may be a straight line or a curved line.
Specifically, treat that every two are adjacent in the picture that stretches out and draws back can determine a line of cut between treating the flexible region, for example, can treat two adjacent symmetrical lines between the flexible region as the line of cut to avoid treating flexible region and cause the damage, make the cutting more accurate. The first sub-picture where each to-be-stretched region is located can be obtained by cutting along a cutting line between every two adjacent to-be-stretched regions, that is, the to-be-stretched picture is divided into a plurality of first sub-pictures, and each first sub-picture contains one to-be-stretched region.
S130, according to the target expansion information, expanding and contracting the area to be expanded and contracted in each first sub-picture, and determining a second sub-picture after expansion and contraction.
Specifically, this embodiment can be based on current flexible mode, according to the flexible information of target, with the region of treating in every sub-picture flexible along the direction of stretching out and drawing back simultaneously, extend or shorten to the target distance to can realize stretching out and drawing back simultaneously a plurality of local areas in the picture, improve flexible efficiency.
It should be noted that, in this embodiment, the region to be stretched or compressed in the picture is stretched or compressed, and the region except the region to be stretched or compressed in the picture is not stretched or compressed, so that the situation of distortion of the picture can be avoided, and the picture quality is ensured.
Illustratively, S130 may include: determining a target telescopic distance corresponding to each first sub-picture according to the total telescopic distance in the target telescopic information and the number of the first sub-pictures; and according to the stretching direction and the target stretching distance in the target stretching information, stretching the region to be stretched in each first sub-picture, and determining the stretched first sub-picture as a second sub-picture.
Specifically, the target telescopic distance of the region to be telescopic in each sub-picture, which needs to be telescopic, may be determined according to the total telescopic distance corresponding to the picture to be telescopic and the number of the first sub-pictures. In this embodiment, the target telescopic distance corresponding to each first sub-picture may be the same or different. For example, the total scaling distance in the target scaling information may be divided by the number of the first sub-pictures, and the obtained operation result may be used as the target scaling distance corresponding to each first sub-picture, so that each first sub-picture may be scaled by the same distance. And determining each first zoomed sub-picture as a corresponding second sub-picture.
And S140, splicing the second sub-pictures to obtain the picture to be stretched.
Specifically, in this embodiment, according to the arrangement order of each first sub-picture in the picture to be stretched and contracted, each corresponding second sub-picture may be spliced, and the picture obtained by splicing is determined to be the picture after the picture to be stretched and contracted.
Exemplarily, S140 may include: and splicing every two adjacent second sub-pictures according to the picture position corresponding to each second sub-picture to obtain the picture to be stretched.
Specifically, every two adjacent second sub-pictures are determined according to the picture position where each second sub-picture is located, and the two adjacent second sub-pictures can be spliced into one picture by moving the position of one of the second sub-pictures.
According to the technical scheme of the embodiment, at least two first sub-pictures are obtained by cutting the picture to be stretched according to each region to be stretched in the picture to be stretched, wherein each first sub-picture comprises one region to be stretched; according to the target expansion information corresponding to the picture to be expanded, the area to be expanded in each first sub-picture is expanded and contracted simultaneously to obtain the second sub-picture after expansion and contraction, all the second sub-pictures are spliced to obtain the picture after expansion and contraction of the picture to be expanded and contracted, so that a plurality of local areas in the picture can be controlled to expand and contract simultaneously, a middle new picture cannot be generated, the picture quality is guaranteed, the system performance cost is reduced, and the picture expansion and contraction efficiency is greatly improved.
Example two
Fig. 2 is a flowchart of a picture scaling method according to a second embodiment of the present invention, and in this embodiment, further optimization is performed on "every two adjacent second sub-pictures are spliced according to a picture position corresponding to each second sub-picture to obtain a picture after scaling of the picture to be scaled" based on the above embodiment, where explanations of terms that are the same as or correspond to the above embodiment are not repeated herein.
Referring to fig. 2, the method for extending and retracting a picture provided in this embodiment specifically includes the following steps:
s210, at least two areas to be stretched and contracted and target stretching and contracting information in the pictures to be stretched and contracted are obtained.
S220, determining a cutting line between every two adjacent areas to be stretched based on the positions of the areas to be stretched in the picture to be stretched.
For example, the present embodiment may establish a coordinate system in the display interface in advance, for example, taking the horizontal direction as the X axis, the vertical direction as the Y axis, and the downward angle or other position point of the display page as the origin of the coordinate system. When the stretching direction of each region to be stretched in the picture to be stretched is the X-axis direction, the cutting line between every two adjacent regions to be stretched can be determined according to the following formula:
Figure BDA0002087492190000071
wherein G isxFor two adjacent regions Q to be stretched1And Q2The X-axis coordinate value corresponding to the cutting line between; region Q to be stretched1And Q2The stretching directions of the two-way pipe are all X-axis directions; q1The front area to be stretched and contracted along the X-axis direction; q2The region to be stretched is the region to be stretched and contracted behind the X-axis direction; q1xIs a region Q to be stretched1A corresponding maximum X-axis coordinate value; q2xIs a region Q to be stretched2The corresponding minimum X-axis coordinate value.
Specifically, when the region to be stretched and contracted extends and contracts along the X-axis direction, the X-axis coordinate value G corresponding to the cutting line between the two adjacent regions to be stretched and contracted can be determined according to the maximum X-axis coordinate value of the previous region and the minimum X-axis coordinate value of the subsequent region to be stretched and contractedxThe cutting line is then: x ═ GxThe corresponding straight line. Similarly, when the region to be stretched extends and contracts along the Y-axis direction, it can be determined that the cutting line is Y ═ GyThe corresponding straight line.
And S230, cutting the picture to be stretched according to each cutting line, and taking each picture obtained after cutting as a first sub-picture.
S240, according to the target expansion and contraction information, expanding and contracting the area to be expanded and contracted in each first sub-picture, and determining a second sub-picture after expansion and contraction.
And S250, taking the first second sub-picture along the X-axis in the extension direction as the current second sub-picture.
Specifically, each second sub-picture after stretching is arranged along the X axis in the stretching direction, and in this embodiment, every two adjacent second sub-pictures can be periodically and circularly spliced along the X axis in the stretching direction. In the first cycle period, the first second sub-picture along the X-axis of the extension direction may be taken as the current second sub-picture, so as to be sequentially spliced along the extension direction. Optionally, the last second sub-picture along the X-axis in the telescopic direction may also be used as the current second sub-picture in the present embodiment, so as to sequentially stitch along the reverse direction of the telescopic direction.
And S260, acquiring the maximum X-axis coordinate value corresponding to the current second sub-picture, and setting the minimum X-axis coordinate value of the target second sub-picture adjacent to the current second sub-picture as the maximum X-axis coordinate value so as to splice the current second sub-picture and the target second sub-picture.
The target second sub-picture is a second sub-picture adjacent to the current second sub-picture along the stretching direction X axis. For example, if the current second sub-picture is the first second sub-picture along the X-axis of the extension direction, the target second sub-picture is the second sub-picture along the X-axis of the extension direction accordingly.
Specifically, based on a preset coordinate system, X-axis coordinate values corresponding to positions in the current second sub-picture may be obtained, and the X-axis coordinate values are compared to determine a maximum X-axis coordinate value corresponding to the current second sub-picture, for example, an X-axis coordinate value corresponding to a rightmost position in the current second sub-picture. By setting the minimum X-axis coordinate value of the target second sub-picture as the maximum X-axis coordinate value corresponding to the current second sub-picture, the target second sub-picture can be moved to the position corresponding to the maximum X-axis coordinate value of the current second sub-picture, i.e. to the rightmost side of the current second sub-picture, along the extension direction X, so that the current second sub-picture and the target second sub-picture can be spliced into one picture.
Illustratively, the current second sub-picture may be spliced with the target second sub-picture by:
rightImage.left=leftImage.right
wherein, the rightImage is the current second sub-picture; and the leftImage is the target second sub-picture.
S270, detecting whether a second sub-picture which is not spliced exists or not, and if yes, entering the step S280; if not, the process proceeds to step S290.
Specifically, whether splicing is completed is determined by detecting whether a second sub-picture which is not spliced yet exists currently. If the second sub-picture which is not spliced exists, continuing the splicing operation by executing the operation of the step S280; if there is no un-stitched second sub-picture, it indicates that the stitching is completed, and at this time, the operation of step S290 is performed.
S280, updating the picture spliced by the current second sub-picture and the target second sub-picture into the current second sub-picture, and returning to the step S260.
Specifically, by updating the current second sub-picture and the target second sub-picture into the current second sub-picture and returning to execute the operations in steps S260 to S270, the spliced picture and the next adjacent second sub-picture can be spliced, so that all the second sub-pictures can be sequentially spliced.
And S290, determining the picture obtained by splicing the current second sub-picture and the target second sub-picture as the picture to be subjected to picture expansion and contraction.
Specifically, when the second sub-picture which is not spliced does not exist at present, the splicing of the second sub-picture is completed, and at the moment, the spliced picture can be determined as the picture after the picture to be stretched and contracted, so that the stretched and contracted complete picture can be obtained more quickly.
Exemplarily, FIG. 3 showsAn example of picture stretching is described. As can be seen from fig. 3: the picture to be stretched is a bubble picture which comprises two areas Q to be stretched1And Q2The cutting line between the two regions to be stretched is a perpendicular bisector between the two regions to be stretched. By cutting the bubble picture along the cutting line, two first sub-pictures, namely, the first sub-pictures 1 and 2, can be obtained. According to the target stretching length corresponding to each first sub-picture, simultaneously stretching the region to be stretched in each first sub-picture by the target stretching length, namely stretching the region to be stretched Q1Stretching to a region Q1', and a region Q to be stretched2Stretching to a region Q2', so that two second sub-pictures, i.e. second sub-pictures 1 and 2, can be obtained. According to the position coordinates of the two second sub-pictures, the two second sub-pictures can be spliced into a complete picture, so that the stretched bubble picture is obtained. It should be noted that the stretching operation in this embodiment is only performed on the region to be stretched in the first sub-picture, and the region other than the region to be stretched, for example, a small triangle in the bubble picture, is not stretched, so that the picture distortion can be avoided, and the picture quality is ensured.
According to the technical scheme, every two adjacent second sub-pictures are subjected to periodic cycle splicing along the X axis in the telescopic direction, so that the splicing accuracy and splicing speed can be guaranteed, and the telescopic efficiency of the pictures is further improved.
The following is an embodiment of the picture scaling device provided in the embodiments of the present invention, and the device and the picture scaling method in the embodiments belong to the same inventive concept, and details that are not described in detail in the embodiments of the picture scaling device may refer to the embodiments of the picture scaling method.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a picture stretching device according to a third embodiment of the present invention, where this embodiment is applicable to a situation where at least two local areas in a picture are stretched, the device may specifically include: the image processing system comprises a to-be-stretched region acquisition module 310, a to-be-stretched image cutting module 320, a first sub-image stretching module 330 and a second sub-image splicing module 340.
The to-be-stretched area obtaining module 310 is configured to obtain at least two to-be-stretched areas and target stretching information in a to-be-stretched picture; the to-be-stretched picture cutting module 320 is configured to cut the to-be-stretched picture based on each to-be-stretched region, and determine at least two first sub-pictures, where each first sub-picture includes one to-be-stretched region; the first sub-picture expansion module 330 is configured to expand and contract a region to be expanded and contracted in each first sub-picture according to the target expansion and contraction information, and determine an expanded and contracted second sub-picture; and the second sub-picture splicing module 340 is configured to splice the second sub-pictures to obtain a picture to be zoomed out or zoomed out.
Optionally, the to-be-stretched picture cutting module 320 includes:
the cutting line determining unit is used for determining a cutting line between every two adjacent areas to be stretched based on the position of each area to be stretched in the picture to be stretched;
and the first sub-picture determining unit is used for cutting the picture to be stretched according to each cutting line and taking each picture obtained after cutting as a first sub-picture.
Optionally, the cutting line determining unit determines the cutting line between each two adjacent regions to be stretched according to the following formula:
Figure BDA0002087492190000121
wherein G isxFor two adjacent regions Q to be stretched1And Q2The X-axis coordinate value corresponding to the cutting line between; region Q to be stretched1And Q2The stretching directions of the two-way pipe are all X-axis directions; q1The front area to be stretched and contracted along the X-axis direction; q2The region to be stretched is the region to be stretched and contracted behind the X-axis direction; q1xIs a region Q to be stretched1A corresponding maximum X-axis coordinate value; q2xIs a region Q to be stretched2The corresponding minimum X-axis coordinate value.
Optionally, the first sub-picture scaling module 330 includes:
the target telescopic distance determining unit is used for determining a target telescopic distance corresponding to each first sub-picture according to the total telescopic distance in the target telescopic information and the number of the first sub-pictures;
and the second sub-picture determining unit is used for stretching the area to be stretched in each first sub-picture according to the stretching direction and the target stretching distance in the target stretching information, and determining the stretched first sub-picture as a second sub-picture.
Optionally, the target telescopic distance determining unit is specifically configured to: and dividing the total telescopic distance in the target telescopic information by the number of the first sub-pictures to obtain an operation result as a target telescopic distance corresponding to each first sub-picture.
Optionally, the second sub-picture stitching module 340 is specifically configured to:
and splicing every two adjacent second sub-pictures according to the picture position corresponding to each second sub-picture to obtain the picture to be stretched.
Optionally, the second sub-picture stitching module 340 is further specifically configured to:
taking the first second sub-picture along the X axis of the stretching direction as a current second sub-picture;
acquiring a maximum X-axis coordinate value corresponding to the current second sub-picture, and setting the minimum X-axis coordinate value of a target second sub-picture adjacent to the current second sub-picture as the maximum X-axis coordinate value so as to splice the current second sub-picture and the target second sub-picture;
detecting whether a second sub-picture which is not spliced exists;
if so, updating the picture obtained by splicing the current second sub-picture and the target second sub-picture into the current second sub-picture, and returning to execute the operation of obtaining the maximum X-axis coordinate value corresponding to the current second sub-picture;
if not, determining the picture obtained by splicing the current second sub-picture and the target second sub-picture as the picture to be subjected to picture expansion and contraction.
The picture expansion device provided by the embodiment of the invention can execute the picture expansion method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the picture expansion method.
Example four
Fig. 5 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention. Fig. 5 illustrates a block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention. The device 12 shown in fig. 5 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present invention.
As shown in FIG. 5, device 12 is in the form of a general purpose computing device. The components of device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with device 12, and/or with any devices (e.g., network card, modem, etc.) that enable device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by running a program stored in the system memory 28, for example, to implement the steps of the picture scaling method provided by the embodiment of the present invention, the method including:
acquiring at least two areas to be stretched and target stretching information in a picture to be stretched;
cutting the picture to be stretched based on each region to be stretched, and determining at least two first sub-pictures, wherein each first sub-picture comprises one region to be stretched;
according to the target expansion information, expanding and contracting the area to be expanded and contracted in each first sub-picture, and determining a second sub-picture after expansion and contraction;
and splicing the second sub-pictures to obtain the picture to be stretched.
Of course, those skilled in the art will appreciate that the processor may also implement the solution of the method for determining the reserved inventory provided by any embodiment of the present invention.
EXAMPLE five
This fifth embodiment provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the picture scaling method provided in any embodiment of the present invention, where the method includes:
acquiring at least two areas to be stretched and target stretching information in a picture to be stretched;
cutting the picture to be stretched based on each region to be stretched, and determining at least two first sub-pictures, wherein each first sub-picture comprises one region to be stretched;
according to the target expansion information, expanding and contracting the area to be expanded and contracted in each first sub-picture, and determining a second sub-picture after expansion and contraction;
and splicing the second sub-pictures to obtain the picture to be stretched.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It will be understood by those skilled in the art that the modules or steps of the invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and optionally they may be implemented by program code executable by a computing device, such that it may be stored in a memory device and executed by a computing device, or it may be separately fabricated into various integrated circuit modules, or it may be fabricated by fabricating a plurality of modules or steps thereof into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A picture scaling method is characterized by comprising the following steps:
acquiring at least two areas to be stretched and target stretching information in a picture to be stretched;
cutting the picture to be stretched based on each region to be stretched, and determining at least two first sub-pictures, wherein each first sub-picture comprises one region to be stretched;
according to the target expansion and contraction information, expanding and contracting the area to be expanded and contracted in each first sub-picture, and determining a second sub-picture after expansion and contraction;
and splicing the second sub-pictures to obtain the picture to be stretched.
2. The method according to claim 1, wherein the segmenting the picture to be scaled based on each of the regions to be scaled and determining at least two first sub-pictures comprises:
determining a cutting line between every two adjacent areas to be stretched based on the position of each area to be stretched in the picture to be stretched;
and cutting the picture to be stretched according to each cutting line, and taking each picture obtained after cutting as a first sub-picture.
3. The method according to claim 2, characterized in that the cutting line between each two adjacent areas to be stretched is determined according to the following formula:
Figure FDA0002087492180000011
wherein G isxFor two adjacent regions Q to be stretched1And Q2The X-axis coordinate value corresponding to the cutting line between; the region Q to be stretched1And Q2The stretching directions of the two-way pipe are all X-axis directions; q1The front area to be stretched and contracted along the X-axis direction; q2The region to be stretched is the region to be stretched and contracted behind the X-axis direction; q1xIs a region Q to be stretched1A corresponding maximum X-axis coordinate value; q2xIs a region Q to be stretched2The corresponding minimum X-axis coordinate value.
4. The method according to claim 1, wherein scaling the region to be scaled in each of the first sub-pictures according to the target scaling information, and determining a scaled second sub-picture comprises:
determining a target telescopic distance corresponding to each first sub-picture according to a total telescopic distance in the target telescopic information and the number of the first sub-pictures;
and according to the stretching direction and the target stretching distance in the target stretching information, stretching the region to be stretched in each first sub-picture, and determining the stretched first sub-picture as a second sub-picture.
5. The method according to claim 4, wherein determining a target scaling distance corresponding to each first sub-picture according to a total scaling distance in the target scaling information and the number of the first sub-pictures comprises:
dividing the total telescopic distance in the target telescopic information by the number of the first sub-pictures to obtain an operation result as a target telescopic distance corresponding to each first sub-picture.
6. The method according to claim 1, wherein the splicing the second sub-pictures to obtain the picture after the picture to be zoomed in and out comprises:
and splicing every two adjacent second sub-pictures according to the picture position corresponding to each second sub-picture to obtain the picture after the picture to be stretched is stretched.
7. The method according to claim 6, wherein splicing every two adjacent second sub-pictures according to the picture position corresponding to each second sub-picture to obtain the picture after the picture to be scaled is scaled comprises:
taking the first second sub-picture along the X axis of the stretching direction as a current second sub-picture;
acquiring a maximum X-axis coordinate value corresponding to the current second sub-picture, and setting the minimum X-axis coordinate value of a target second sub-picture adjacent to the current second sub-picture as the maximum X-axis coordinate value so as to splice the current second sub-picture and the target second sub-picture;
detecting whether a second sub-picture which is not spliced exists;
if so, updating the picture obtained by splicing the current second sub-picture and the target second sub-picture into the current second sub-picture, and returning to execute the operation of obtaining the maximum X-axis coordinate value corresponding to the current second sub-picture;
if not, determining the picture obtained by splicing the current second sub-picture and the target second sub-picture as the picture to be stretched.
8. A picture expansion device, comprising:
the device comprises a to-be-stretched area acquisition module, a target stretching module and a stretching module, wherein the to-be-stretched area acquisition module is used for acquiring at least two to-be-stretched areas and target stretching information in a to-be-stretched picture;
the to-be-stretched picture cutting module is used for cutting the to-be-stretched picture based on each to-be-stretched area and determining at least two first sub-pictures, wherein each first sub-picture comprises one to-be-stretched area;
the first sub-picture expansion module is used for expanding and contracting the area to be expanded and contracted in each first sub-picture according to the target expansion and contraction information and determining an expanded and contracted second sub-picture;
and the second sub-picture splicing module is used for splicing the second sub-pictures to obtain the picture to be stretched.
9. An apparatus, characterized in that the apparatus comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the picture scaling method steps of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the picture scaling method steps of any one of claims 1-7.
CN201910492474.5A 2019-06-06 2019-06-06 Picture telescoping method, device, equipment and storage medium Active CN111738917B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910492474.5A CN111738917B (en) 2019-06-06 2019-06-06 Picture telescoping method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910492474.5A CN111738917B (en) 2019-06-06 2019-06-06 Picture telescoping method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111738917A true CN111738917A (en) 2020-10-02
CN111738917B CN111738917B (en) 2024-06-18

Family

ID=72645908

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910492474.5A Active CN111738917B (en) 2019-06-06 2019-06-06 Picture telescoping method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111738917B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112288623A (en) * 2020-06-09 2021-01-29 北京沃东天骏信息技术有限公司 Picture scaling method, device, equipment and storage medium
CN112558849A (en) * 2020-12-07 2021-03-26 北京锐安科技有限公司 Graphic model generation method, device, equipment and storage medium
CN113256485A (en) * 2021-05-21 2021-08-13 百果园技术(新加坡)有限公司 Image stretching method, device, electronic equipment and storage medium
CN114185628A (en) * 2021-11-19 2022-03-15 北京奇艺世纪科技有限公司 Picture adjusting method, device and equipment of iOS system and computer readable medium
CN114281230A (en) * 2021-12-15 2022-04-05 贵阳语玩科技有限公司 Background picture generation method, device, medium and equipment suitable for different aspect ratios

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013083055A1 (en) * 2011-12-09 2013-06-13 腾讯科技(深圳)有限公司 Image processing method and system
WO2017190691A1 (en) * 2016-05-05 2017-11-09 贵州白山云科技有限公司 Picture compression method and apparatus
CN107680045A (en) * 2017-10-13 2018-02-09 广州酷狗计算机科技有限公司 Picture telescopic method and device
WO2019072149A1 (en) * 2017-10-11 2019-04-18 腾讯科技(深圳)有限公司 Thumbnail generation method and apparatus, electronic device, and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013083055A1 (en) * 2011-12-09 2013-06-13 腾讯科技(深圳)有限公司 Image processing method and system
WO2017190691A1 (en) * 2016-05-05 2017-11-09 贵州白山云科技有限公司 Picture compression method and apparatus
WO2019072149A1 (en) * 2017-10-11 2019-04-18 腾讯科技(深圳)有限公司 Thumbnail generation method and apparatus, electronic device, and storage medium
CN107680045A (en) * 2017-10-13 2018-02-09 广州酷狗计算机科技有限公司 Picture telescopic method and device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112288623A (en) * 2020-06-09 2021-01-29 北京沃东天骏信息技术有限公司 Picture scaling method, device, equipment and storage medium
CN112558849A (en) * 2020-12-07 2021-03-26 北京锐安科技有限公司 Graphic model generation method, device, equipment and storage medium
CN113256485A (en) * 2021-05-21 2021-08-13 百果园技术(新加坡)有限公司 Image stretching method, device, electronic equipment and storage medium
CN113256485B (en) * 2021-05-21 2024-01-30 百果园技术(新加坡)有限公司 Image stretching method, device, electronic equipment and storage medium
CN114185628A (en) * 2021-11-19 2022-03-15 北京奇艺世纪科技有限公司 Picture adjusting method, device and equipment of iOS system and computer readable medium
CN114185628B (en) * 2021-11-19 2024-04-12 北京奇艺世纪科技有限公司 Picture adjustment method, device and equipment of iOS (integrated operation system) and computer readable medium
CN114281230A (en) * 2021-12-15 2022-04-05 贵阳语玩科技有限公司 Background picture generation method, device, medium and equipment suitable for different aspect ratios

Also Published As

Publication number Publication date
CN111738917B (en) 2024-06-18

Similar Documents

Publication Publication Date Title
CN111738917B (en) Picture telescoping method, device, equipment and storage medium
CN109218656B (en) Image display method, device and system
EP3822757A1 (en) Method and apparatus for setting background of ui control
WO2024125329A1 (en) Livestreaming special effect rendering method and apparatus, device, readable storage medium, and product
JP6671673B1 (en) Layout analysis method, reading assistance device, circuit and medium
CN112068739A (en) Infrared touch response method, device and storage medium
US11494961B2 (en) Sticker generating method and apparatus, and medium and electronic device
CN110471700B (en) Graphic processing method, apparatus, storage medium and electronic device
CN114596383A (en) Line special effect processing method and device, electronic equipment, storage medium and product
US20240054703A1 (en) Method for image synthesis, device for image synthesis and storage medium
CN112532785B (en) Image display method, image display device, electronic apparatus, and storage medium
CN112215751A (en) Image scaling method, image scaling device and terminal equipment
CN111045576B (en) Display control method, display control device, terminal equipment and electronic equipment
CN111507123B (en) Method and device for placing reading materials, reading equipment, electronic equipment and medium
CN113963000B (en) Image segmentation method, device, electronic equipment and program product
CN113220201B (en) Picture display method, device, equipment and storage medium
CN113538269A (en) Image processing method and device, computer readable storage medium and electronic device
CN109739403B (en) Method and apparatus for processing information
US9723216B2 (en) Method and system for generating an image including optically zoomed and digitally zoomed regions
CN111223105B (en) Image processing method and device
CN114092362A (en) Panoramic picture loading method and device
CN112465692A (en) Image processing method, device, equipment and storage medium
CN116134476A (en) Plane correction method and device, computer readable medium and electronic equipment
CN111200705A (en) Image processing method and device
CN112822418B (en) Video processing method and device, storage medium and electronic equipment

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