CN113012028A - Image processing method, device, equipment and storage medium - Google Patents

Image processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN113012028A
CN113012028A CN201911319361.1A CN201911319361A CN113012028A CN 113012028 A CN113012028 A CN 113012028A CN 201911319361 A CN201911319361 A CN 201911319361A CN 113012028 A CN113012028 A CN 113012028A
Authority
CN
China
Prior art keywords
original
canvas
frame area
target
pixel
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
CN201911319361.1A
Other languages
Chinese (zh)
Other versions
CN113012028B (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.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies 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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201911319361.1A priority Critical patent/CN113012028B/en
Publication of CN113012028A publication Critical patent/CN113012028A/en
Application granted granted Critical
Publication of CN113012028B publication Critical patent/CN113012028B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T3/04
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T5/92

Abstract

The embodiment of the invention discloses a method, a device and equipment for processing an image and a storage medium. Wherein, the method comprises the following steps: acquiring an original frame area selected from an original layout image of a visual window; determining the size of a target canvas image according to the size of the original picture layout image and the size of the original picture frame area; amplifying the original picture layout image into the target canvas image according to the size of the target canvas image so as to obtain an amplified target picture frame area; and determining the distance between the target picture frame area and the visual window, and moving the target picture frame area into the visual window according to the distance. According to the embodiment of the invention, the original frame area is selected on the original picture layout image, the original canvas is amplified according to the width-height ratio of the original frame area, and the amplified target frame area is moved to the visible window, so that the problem of image deformation caused by only amplifying the original frame area is avoided, and the image processing efficiency is improved.

Description

Image processing method, device, equipment and storage medium
Technical Field
Embodiments of the present invention relate to computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for image processing.
Background
When people read images, a certain area on the images needs to be processed so as to accurately read the images.
In the prior art, a rough image area to be processed is selected by a frame, and the image area is enlarged and spread over the whole window with a visual window as a boundary.
Although this implementation strategy can achieve area scaling, it is impossible to process the image according to the same aspect ratio as the frame selection area, and the scaled image is distorted compared to the image before scaling, which affects the viewing and makes it difficult for the user to precisely frame again, resulting in low image processing efficiency.
Disclosure of Invention
The embodiment of the invention provides an image processing method, device, equipment and storage medium, wherein the method comprises the steps of determining image information of an original canvas and an original frame area, carrying out adaptive adjustment on the original canvas on a visual window, and moving an amplified target frame into the visual window, so that the frame area is not deformed before and after processing, and the image processing efficiency is improved.
In a first aspect, an embodiment of the present invention provides an image processing method, where the method includes:
acquiring an original frame area selected from an original layout image of a visual window;
determining the size of a target canvas image according to the size of the original picture layout image and the size of the original picture frame area;
amplifying the original picture layout image into the target canvas image according to the size of the target canvas image so as to obtain an amplified target picture frame area;
and determining the distance between the target picture frame area and the visual window, and moving the target picture frame area into the visual window according to the distance.
In a second aspect, an embodiment of the present invention further provides an image processing apparatus, including:
the original picture frame region acquisition module is used for acquiring an original picture frame region selected from an original picture layout image of the visual window;
the target canvas image size determining module is used for determining the size of a target canvas image according to the size of the original picture layout image and the size of the original picture frame area;
the original canvas image amplifying module is used for amplifying the original canvas image into the target canvas image according to the size of the target canvas image so as to obtain an amplified target picture frame area;
and the target picture frame area moving module is used for determining the distance between the target picture frame area and the visual window and moving the target picture frame area into the visual window according to the distance.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the image processing method according to any embodiment of the present invention when executing the computer program.
In a fourth aspect, embodiments of the present invention further provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the image processing method according to any of the embodiments of the present invention.
According to the embodiment of the invention, the original frame area is selected on the original picture layout image, the original canvas is amplified according to the width-height ratio of the original frame area, and the amplified target frame area is moved to the visual window, so that the problems that in the prior art, the original frame area is not amplified according to the width-height ratio before amplification and the whole visual window is fully paved are solved, the amplified image is prevented from being deformed, the viewing experience of a user is improved, and the image processing efficiency is improved.
Drawings
Fig. 1 is a schematic flowchart of an image processing method according to a first embodiment of the present invention;
FIG. 2 is a schematic diagram of an original canvas image and an original canvas area in a first embodiment of the present invention;
FIG. 3 is a diagram illustrating a target canvas image and a target frame area according to a first embodiment of the present invention;
FIG. 4 is a flowchart illustrating an image processing method according to a second embodiment of the present invention;
FIG. 5 is a block diagram showing an image processing apparatus according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device in the 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 illustrating an image processing method according to an embodiment of the present invention, where the embodiment is applicable to processing an image, and the method can be executed by an image processing apparatus. As shown in fig. 1, the method specifically includes the following steps:
step 110, obtaining an original frame area selected from the original layout image of the visual window.
The user opens the original canvas image on the intelligent device, the original canvas image is displayed on the visual window, and the intelligent device can be a computer or other devices. The method comprises the steps that a user selects an original picture frame on a visual window in a frame mode, the intelligent device receives a frame selection request triggered by the user, the intelligent device captures events such as pressing, bouncing or moving of tools such as a mouse and the like, and the original picture frame area selected by the user is determined. And determining data such as vertex coordinates, line thickness, line color, filling of the center of the picture frame, filling color, transparency and the like of the original picture frame region according to an event triggered by a user through a mouse and other tools. For example, the minimum and maximum coordinates of the visual window are (0,0) and (10000), and when the user selects the original frame, the coordinates of the top left vertex and the bottom right vertex of the original frame area can be determined to be (200 ) and (900), respectively.
And step 120, determining the size of the target canvas image according to the size of the original picture layout image and the size of the original picture frame area.
The intelligent device obtains the size of an original canvas image and the size of an original picture frame area, and the size of a target canvas image is determined according to the size of the original picture frame image and the size of the original picture frame area. The original canvas image size can include the width pixel of original canvas and the height pixel of original canvas, and the size in former picture frame region can include the width value in former picture frame region and the height value in former picture frame region, and the size in former picture frame region can be calculated by the upper left corner and the lower right corner coordinate of former picture frame and is reachd. The target canvas is an enlarged original canvas, and the target canvas image size may include width pixels of the target canvas and height pixels of the target canvas.
Optionally, before determining the size of the target canvas image according to the size of the original canvas image and the size of the original frame area, the method further includes: determining the width pixel of the original picture frame region according to the width pixel representing the original canvas, the width value of the original picture frame region and the maximum width value of the visual window; and determining the height pixel of the original frame area according to the height pixel representing the original canvas, the height value of the original frame area and the maximum height value of the visual window.
Specifically, the width pixel of the original frame region may be determined by the width pixel of the original canvas, the width value of the original frame region, and the maximum width value of the visual window. And determining the height pixel of the original frame area according to the height pixel of the original canvas, the height value of the original frame area and the maximum height value of the visual window. The maximum width value and the maximum height value of the visual window are determined by the coordinate of the lower right corner of the visual window, for example, the coordinate of the lower right corner of the visual window is (10000), and then the maximum width value and the maximum height value of the visual window are 10000.
The width pixel and the height pixel of the original frame region can be calculated by the following formulas:
Figure BDA0002326723430000051
Figure BDA0002326723430000052
wherein W is the width pixel of the original frame area, H is the height pixel of the original frame area, windows width is the width pixel of the original canvas, and windows height is the width pixel of the original canvasThe height pixel of the original canvas, drawWidth, is expressed as the width value of the original frame area, drawHeight is expressed as the height value of the original frame area, X is expressed as the maximum width value of the visible window, and Y is expressed as the maximum height value of the visible window. The width and height of the original frame region can be determined by the coordinates of the upper left corner and the lower right corner of the original frame, for example, the coordinate of the upper left corner of the original frame is (x)1,y1) The coordinate of the lower right corner is (x)2,y2) Then drawWidth ═ x2-x1,drawHeight=y2-y1. X and Y may be determined according to the requirement of calculation accuracy, and if the coordinates in the visible window are represented by a ten-thousandth ratio, the coordinates in the lower right corner of the visible window are (10000), X is 10000, and Y is 10000. The calculation accuracy can be improved by adopting a ten-thousandth ratio to calculate the width pixel and the height pixel of the original picture frame region, the width pixel and the height pixel of the original picture frame region can provide a judgment basis for the amplification proportion of the original canvas, the phenomenon that the image is amplified and fully paved on the whole visible window to cause image deformation is avoided, and the image processing efficiency is improved.
Optionally, if the width pixel of the original frame area is greater than or equal to the height pixel of the original frame area, determining the width pixel magnification factor of the original canvas according to the maximum width value of the visual window and the width value of the original frame area; determining the width pixel of the target canvas according to the width pixel magnification factor of the original canvas and the width pixel of the original canvas; and determining the height pixel of the target canvas according to the width pixel of the target canvas, the width pixel of the original canvas and the height pixel of the original canvas.
Specifically, after determining the width pixel and the height pixel of the original frame area, comparing the width pixel and the height pixel of the original frame area, if the width pixel of the original frame area is greater than or equal to the height pixel of the original frame area, namely W is greater than or equal to H, determining the width pixel amplification factor of the original canvas according to the maximum width value of the visible window and the width value of the original frame area, and then determining the width pixel of the target canvas according to the width pixel amplification factor of the original canvas and the width pixel of the original canvas.
The formula for determining the width pixel of the target canvas is as follows:
Figure BDA0002326723430000061
where nW is expressed as a width pixel of the target canvas,
Figure BDA0002326723430000062
expressed as the width pixel magnification of the original canvas.
After the width pixel of the target canvas is determined, the amplification factor of the height pixel of the original canvas is determined according to the width pixel of the target canvas and the width pixel of the original canvas, namely the width pixel of the original canvas and the height pixel of the original canvas are amplified in the same proportion. And determining the height pixel of the target canvas according to the height pixel of the original canvas and the amplification factor of the height pixel of the original canvas.
The formula for determining the height pixel of the target canvas is as follows:
Figure BDA0002326723430000063
where nH is expressed as a height pixel of the target canvas,
Figure BDA0002326723430000064
expressed as the height pixel magnification of the original canvas.
Optionally, if the width pixel of the original frame area is smaller than the height pixel of the original frame area, determining the height pixel magnification factor of the original canvas according to the maximum height value of the visible window and the height value of the original frame area; determining the height pixel of the target canvas according to the height pixel magnification factor of the original canvas and the height pixel of the original canvas; and determining the width pixel of the target canvas according to the height pixel of the target canvas, the height pixel of the original canvas and the width pixel of the original canvas.
Specifically, the width pixel and the height pixel of the original picture frame area are compared, if the width pixel of the original picture frame area is smaller than the height pixel of the original picture frame area, namely W is smaller than H, the height pixel amplification factor of the original canvas is determined according to the maximum height value of the visual window and the height value of the original picture frame area, and then the height pixel of the target canvas is determined according to the height pixel amplification factor of the original canvas and the height pixel of the original canvas.
The formula for determining the height pixel of the target canvas is as follows:
Figure BDA0002326723430000071
where nH is expressed as a height pixel of the target canvas,
Figure BDA0002326723430000072
expressed as the height pixel magnification of the original canvas.
After the height pixel of the target canvas is determined, the width pixel amplification factor of the original canvas is determined according to the height pixel of the target canvas and the height pixel of the original canvas, namely the height pixel of the original canvas and the width pixel of the original canvas are amplified in the same proportion. And determining the width pixel of the target canvas according to the width pixel magnification factor of the original canvas and the width pixel of the original canvas.
The formula for determining the width pixel of the target canvas is as follows:
Figure BDA0002326723430000073
where nW is expressed as a width pixel of the target canvas,
Figure BDA0002326723430000074
expressed as the width pixel magnification of the original canvas.
By comparing the width pixels and the height pixels of the original picture frame area, the amplification ratio of the larger value of the width pixels and the height pixels is determined to be used as the amplification standard, so that the width pixels and the height pixels of the original canvas are amplified in the same ratio, and the phenomenon that the amplified image is deformed to influence the watching of a user is avoided.
And step 130, amplifying the original picture layout image into a target canvas image according to the size of the target canvas image so as to obtain an amplified target picture frame area.
After obtaining the width pixels and the height pixels of the target canvas, the intelligent device amplifies the original canvas image into the target canvas image in the same width and height amplification ratio, and correspondingly amplifies the original frame area in the original canvas into the target frame area. As shown in fig. 2 and fig. 3, fig. 2 is a schematic diagram of an original layout image and an original frame area in an embodiment of the present invention. The solid line frame is the original picture layout image in the visual interface, and the dotted line frame is the original picture frame area. FIG. 3 is a diagram illustrating a target canvas image and a target frame area in an embodiment of the present invention. The solid line box is the visual interface, the dashed line box is the target picture frame area, and the dotted line is represented as the target canvas image. And integrally amplifying the original canvas image, wherein the original picture frame area is amplified to be the target picture frame area and is not displayed in the visual window.
Step 140, determine the distance between the target frame area and the visual window, and move the target frame area into the visual window according to the distance.
After the target picture frame region is obtained, the coordinates of the center point of the target picture frame region and the coordinates of the center point of the visible window are determined, and the distance between the center point of the target picture frame region and the center point of the visible window is calculated, wherein the distance takes a pixel as a unit. And moving the target picture frame region into the visual window according to the distance so as to display the target picture frame region in the visual window.
Optionally, determining a first distance and a second distance from the center point of the target picture frame region to a left frame and an upper frame in the visual window; determining a third distance and a fourth distance from the center point of the visual window to the left frame and the upper frame; and determining the leftward and upward translation distance of the central point of the target picture frame region according to the first distance, the second distance, the third distance and the fourth distance.
Specifically, if the coordinates of the center point of the target frame area are determined to be (x)3,y3) Then the leftward and upward translation distances of the center point of the target frame area can be determined by the following formula:
Figure BDA0002326723430000091
Figure BDA0002326723430000092
wherein, offsetWidth represents the leftward translation distance of the center point of the target frame area, offsetHeight represents the upward translation distance of the center point of the target frame area,
Figure BDA0002326723430000093
represented as a first distance from the center point of the target frame area to the left border in the visual window,
Figure BDA0002326723430000094
represented as a second distance from the center point of the target frame area to the top border in the visual window,
Figure BDA0002326723430000095
represented as a third distance from the center point of the visual window to the left frame,
Figure BDA0002326723430000096
represented as a second distance from the center point of the visual window to the upper border. And determining the left-moving distance of the central point of the target picture frame region according to the first distance and the third distance, and determining the upward-moving distance of the central point of the target picture frame region according to the second distance and the fourth distance. And moving the target picture frame area to the center of the visual window so as to view the enlarged original picture frame area in the visual window. By calculating the distance between the target picture frame region and the visual window, the target picture frame region can be moved into the visual window, and the original picture is integrally amplified, so that the deformation of the image is avoided, and the image processing efficiency is improved.
After the user enlarges the image, the user can precisely select the enlarged image again and store the image after selection. If the intelligent device receives an image reduction request sent by a user, the intelligent device can reset the size of the Canvas according to the size of the window by a Canvas method, determine the color, the shape and the coordinates of the restored image, and display the reset image on the Canvas to achieve the effect of restoration. And the picture frame can also be translated to the translation direction and the translation distance of the visible window in the opposite direction according to the canvas after being amplified, and can be translated downwards and rightwards when being reduced if the picture frame is translated upwards and leftwards after the canvas is amplified. Then, the canvas is reduced by the same times according to the amplification factor of the previous canvas, so that the aspect ratio of the canvas is kept unchanged, and the reduction effect is achieved.
According to the technical scheme, the original picture frame region is acquired from the original canvas image of the visual window, the original canvas is amplified to be the target canvas according to the size of the original picture frame region and the size of the original picture frame image, the original picture frame region is amplified to be the target picture frame region, the target picture frame region is displayed to the visual window through the distance between the target picture frame region and the visual window, and the user can check conveniently. The problem of among the prior art, do not consider the aspect ratio of original image when enlarging the image, lead to the image deformation after enlargeing is solved, through calculating target canvas image size, improved the computational accuracy of enlargement ratio and image processing's efficiency, promote user's the experience of looking over.
Example two
Fig. 4 is a flowchart illustrating an image processing method according to a second embodiment of the present invention, which is further optimized based on the second embodiment of the present invention. As shown in fig. 4, the method specifically includes the following steps:
step 410, obtaining an original frame area selected from the original layout image of the visual window.
And 420, amplifying the width value of the original picture frame area and the height value of the original picture frame area, and determining the size of the target canvas image according to the size of the original picture layout image and the size of the expanded original picture frame area.
The size of the original frame area is determined according to the acquired original frame area, the size of the original frame area can be determined according to coordinates of the upper left corner and the lower right corner of the original frame area, and the size of the original frame area can comprise the width value of the original frame area and the height value of the original frame area. For example, if the coordinates of the upper left corner and the lower right corner of the original frame area are (200 ) and (900), the width of the original frame area is 700 and the height of the original frame area is 700.
If the user selects the original frame region in a frame mode, the frame selection range is not accurate enough, the width value of the original frame region and the height value of the original frame region can be expanded, namely the range of the original frame region is enlarged, the size of the expanded original frame region is obtained, and the size of the expanded original frame region can comprise the width value and the height value of the expanded original frame region.
The size of the original frame area after expansion can be determined by the following formula:
widthLimit=k×drawWidth;
heightLimit=k×drawHeight;
wherein, width limit is expressed as the width value of the expanded original frame area, height limit is expressed as the height value of the expanded original frame area, and k is the expansion multiple of the width value and the height value of the original frame area.
After the size of the expanded original frame area is obtained, determining width pixels and height pixels of the expanded original frame area according to the size of the expanded original frame area, the size of the original picture image, the maximum width value of the visual window and the maximum height value of the visual window.
The width pixel and the height pixel of the original picture frame region after expansion can be determined by the following formulas:
Figure BDA0002326723430000111
Figure BDA0002326723430000112
wherein, W 'represents the width pixel of the expanded original frame area, and H' represents the height pixel of the expanded original frame area.
And if the width pixel of the expanded original frame area is greater than or equal to the height pixel of the expanded original frame area, determining the width pixel magnification factor of the original canvas according to the maximum width value of the visual window and the width value of the expanded original frame area. And determining the width pixel of the target canvas according to the width pixel magnification factor of the original canvas and the width pixel of the original canvas. And determining the height pixel of the target canvas according to the width pixel of the target canvas, the width pixel of the original canvas and the height pixel of the original canvas.
The width pixel and height pixel of the target canvas may be determined by the following equations:
Figure BDA0002326723430000113
Figure BDA0002326723430000114
and if the width pixel of the expanded original frame area is smaller than the height pixel of the expanded original frame area, determining the height pixel magnification factor of the original canvas according to the maximum height value of the visual window and the height value of the expanded original frame area. And determining the height pixel of the target canvas according to the height pixel magnification factor of the original canvas and the height pixel of the original canvas. And determining the width pixel of the target canvas according to the height pixel of the target canvas, the height pixel of the original canvas and the width pixel of the original canvas.
The height pixel and width pixel of the target canvas may be determined by the following formulas:
Figure BDA0002326723430000121
Figure BDA0002326723430000122
by expanding the original picture frame region, the region to be subjected to image processing can be prevented from being missed when the user selects the original picture frame region, the secondary frame selection operation of the user is reduced, and the precision and the efficiency of image processing are improved.
And 430, amplifying the original picture layout image into a target canvas image according to the size of the target canvas image to obtain an amplified target picture frame area.
Step 440, determine the distance between the target frame area and the visual window, and move the target frame area into the visual window according to the distance.
According to the embodiment of the invention, the original picture frame area selected from the original picture layout image of the visual window is obtained, the original picture frame area is expanded, the range of the original picture frame area is increased, and the image processing is performed on the expanded original picture frame area, so that the problem that the frame selection range is inaccurate when a user selects the frame for the first time is solved, the user experience is improved, and the user can conveniently check the image.
EXAMPLE III
Fig. 5 is a block diagram of an image processing apparatus according to a third embodiment of the present invention, which is capable of executing an image processing method according to any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 5, the apparatus specifically includes:
an original frame region acquiring module 501, configured to acquire an original frame region selected from an original layout image of a visual window;
a target canvas image size determining module 502, configured to determine a target canvas image size according to the original picture layout image size and the size of the original picture frame region;
the original image layout amplifying module 503 is configured to amplify the original image layout into a target canvas image according to the size of the target canvas image, so as to obtain an amplified target frame area;
the target frame area moving module 504 is configured to determine a distance between the target frame area and the visual window, and move the target frame area into the visual window according to the distance.
Optionally, the apparatus further comprises:
the original frame region width pixel determining module is used for determining the width pixel of the original frame region according to the width pixel representing the original canvas, the width value of the original frame region and the maximum width value of the visual window;
and the original frame area height pixel determination module is used for determining the height pixel of the original frame area according to the height pixel representing the original canvas, the height value of the original frame area and the maximum height value of the visual window.
Optionally, the apparatus further comprises:
and the original picture frame area amplifying module is used for amplifying the width value of the original picture frame area and the height value of the original picture frame area.
Optionally, the target canvas image size determining module 502 is specifically configured to:
if the width pixel of the original frame area is larger than or equal to the height pixel of the original frame area, determining the width pixel magnification factor of the original canvas according to the maximum width value of the visible window and the width value of the original frame area;
determining the width pixel of the target canvas according to the width pixel magnification factor of the original canvas and the width pixel of the original canvas;
and determining the height pixel of the target canvas according to the width pixel of the target canvas, the width pixel of the original canvas and the height pixel of the original canvas.
Optionally, the target canvas image size determining module 502 is further specifically configured to:
if the width pixel of the original frame area is smaller than the height pixel of the original frame area, determining the height pixel magnification factor of the original canvas according to the maximum height value of the visual window and the height value of the original frame area;
determining the height pixel of the target canvas according to the height pixel magnification factor of the original canvas and the height pixel of the original canvas;
and determining the width pixel of the target canvas according to the height pixel of the target canvas, the height pixel of the original canvas and the width pixel of the original canvas.
Optionally, the target frame area moving module 504 is specifically configured to:
determining a first distance and a second distance from the central point of the target picture frame area to a left frame and an upper frame in the visual window;
determining a third distance and a fourth distance from the center point of the visual window to the left frame and the upper frame;
and determining the leftward and upward translation distance of the central point of the target picture frame region according to the first distance, the second distance, the third distance and the fourth distance.
According to the embodiment of the invention, the original picture frame region is obtained from the original canvas image of the visual window, the original canvas is enlarged into the target canvas according to the size of the original picture frame region and the size of the original picture frame image, the original picture frame region is enlarged into the target picture frame region, and the target picture frame region is displayed into the visual window by determining the distance between the target picture frame region and the visual window, so that the user can conveniently check the target picture frame region. The problem of among the prior art, do not consider the aspect ratio of original image when enlarging the image, lead to the image deformation after enlargeing is solved, through calculating target canvas image size, improved the computational accuracy of enlargement ratio and image processing's efficiency, promote user's the experience of looking over.
Example four
Fig. 6 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. FIG. 6 illustrates a block diagram of an exemplary computer device 600 suitable for use in implementing embodiments of the invention. The computer device 600 shown in fig. 6 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention.
As shown in fig. 6, computer device 600 is in the form of a general purpose computing device. The components of computer device 600 may include, but are not limited to: one or more processors or processing units 601, a system memory 602, and a bus 603 that couples various system components including the system memory 602 and the processing unit 601.
Bus 603 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.
Computer device 600 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 600 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 602 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)604 and/or cache memory 605. The computer device 600 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 606 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive"). Although not shown in FIG. 6, 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 the bus 603 by one or more data media interfaces. Memory 602 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 608 having a set (at least one) of program modules 607 may be stored, for example, in memory 602, such program modules 607 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. The program modules 607 generally perform the functions and/or methods of the described embodiments of the invention.
The computer device 600 may also communicate with one or more external devices 609 (e.g., keyboard, pointing device, display 610, etc.), with one or more devices that enable a user to interact with the computer device 600, and/or with any devices (e.g., network card, modem, etc.) that enable the computer device 600 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 611. Moreover, the computer device 600 may also 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 612. As shown, a network adapter 612 communicates with the other modules of the computer device 600 via the bus 603. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the computer device 600, 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 601 executes various functional applications and data processing by running a program stored in the system memory 602, for example, to implement the image processing method provided by the embodiment of the present invention, including:
acquiring an original frame area selected from an original layout image of a visual window;
determining the size of a target canvas image according to the size of the original picture frame image and the size of the original picture frame area;
amplifying the original picture layout image into a target canvas image according to the size of the target canvas image to obtain an amplified target picture frame area;
and determining the distance between the target picture frame area and the visual window, and moving the target picture frame area into the visual window according to the distance.
EXAMPLE five
The fifth embodiment of the present invention further provides a storage medium containing computer-executable instructions, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the image processing method provided in the fifth embodiment of the present invention is implemented, where the computer program includes:
acquiring an original frame area selected from an original layout image of a visual window;
determining the size of a target canvas image according to the size of the original picture frame image and the size of the original picture frame area;
amplifying the original picture layout image into a target canvas image according to the size of the target canvas image to obtain an amplified target picture frame area;
and determining the distance between the target picture frame area and the visual window, and moving the target picture frame area into the visual window according to the distance.
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. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. 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, wireline, optical fiber 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 computer device. 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 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. An image processing method, comprising:
acquiring an original frame area selected from an original layout image of a visual window;
determining the size of a target canvas image according to the size of the original picture layout image and the size of the original picture frame area;
amplifying the original picture layout image into the target canvas image according to the size of the target canvas image so as to obtain an amplified target picture frame area;
and determining the distance between the target picture frame area and the visual window, and moving the target picture frame area into the visual window according to the distance.
2. The method of claim 1, further comprising, prior to determining a target canvas image size based on the original frame image size and the size of the original frame area:
determining the width pixel of the original picture frame region according to the width pixel representing the original canvas, the width value of the original picture frame region and the maximum width value of the visual window;
and determining the height pixel of the original frame area according to the height pixel representing the original canvas, the height value of the original frame area and the maximum height value of the visual window.
3. The method of claim 2, further comprising, before determining the width pixel and the height pixel of the original frame region:
and amplifying the width value of the original picture frame area and the height value of the original picture frame area.
4. The method according to any one of claims 1-3, wherein determining a target canvas image size based on the original canvas image size and the original frame area size comprises:
if the width pixel of the original frame area is larger than or equal to the height pixel of the original frame area, determining the width pixel magnification factor of the original canvas according to the maximum width value of the visible window and the width value of the original frame area;
determining the width pixel of the target canvas according to the width pixel magnification factor of the original canvas and the width pixel of the original canvas;
and determining the height pixel of the target canvas according to the width pixel of the target canvas, the width pixel of the original canvas and the height pixel of the original canvas.
5. The method of any of claims 1-3, wherein determining a target canvas image size based on the size of the original canvas image and the size of the original frame area, further comprises:
if the width pixel of the original frame area is smaller than the height pixel of the original frame area, determining the height pixel magnification factor of the original canvas according to the maximum height value of the visual window and the height value of the original frame area;
determining the height pixel of the target canvas according to the height pixel magnification factor of the original canvas and the height pixel of the original canvas;
and determining the width pixel of the target canvas according to the height pixel of the target canvas, the height pixel of the original canvas and the width pixel of the original canvas.
6. The method of claim 1, wherein said determining a distance between the target picture-frame region and the visual window comprises:
determining a first distance and a second distance from the center point of the target picture frame region to a left frame and an upper frame in the visual window;
determining a third distance and a fourth distance from a center point of the visual window to the left border and the upper border;
and determining the leftward and upward translation distance of the central point of the target picture frame region according to the first distance, the second distance, the third distance and the fourth distance.
7. An image processing apparatus characterized by comprising:
the original picture frame region acquisition module is used for acquiring an original picture frame region selected from an original picture layout image of the visual window;
the target canvas image size determining module is used for determining the size of a target canvas image according to the size of the original picture layout image and the size of the original picture frame area;
the original canvas image amplifying module is used for amplifying the original canvas image into the target canvas image according to the size of the target canvas image so as to obtain an amplified target picture frame area;
and the target picture frame area moving module is used for determining the distance between the target picture frame area and the visual window and moving the target picture frame area into the visual window according to the distance.
8. The apparatus of claim 7, further comprising:
the original frame region width pixel determining module is used for determining the width pixel of the original frame region according to the width pixel representing the original canvas, the width value of the original frame region and the maximum width value of the visual window;
and the original frame area height pixel determination module is used for determining the height pixel of the original frame area according to the height pixel representing the original canvas, the height value of the original frame area and the maximum height value of the visual window.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the image processing method according to any of claims 1-6 when executing the program.
10. A storage medium containing computer-executable instructions for performing the image processing method of any one of claims 1 to 6 when executed by a computer processor.
CN201911319361.1A 2019-12-19 2019-12-19 Image processing method, device, equipment and storage medium Active CN113012028B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911319361.1A CN113012028B (en) 2019-12-19 2019-12-19 Image processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911319361.1A CN113012028B (en) 2019-12-19 2019-12-19 Image processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113012028A true CN113012028A (en) 2021-06-22
CN113012028B CN113012028B (en) 2023-03-24

Family

ID=76381302

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911319361.1A Active CN113012028B (en) 2019-12-19 2019-12-19 Image processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113012028B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060209093A1 (en) * 2005-03-15 2006-09-21 Microsoft Corporation Method and computer-readable medium for generating graphics having a finite number of dynamically sized and positioned shapes
KR20100013106A (en) * 2008-07-30 2010-02-09 삼성전자주식회사 Apparatus and method for zoom display of target area from reproducing image
US20110251829A1 (en) * 2010-04-08 2011-10-13 Microsoft Corporation Simulating painting
US20130162646A1 (en) * 2011-12-27 2013-06-27 Apostolos Lerios Texture Repository for Image Processing Applications
CN107204023A (en) * 2017-06-22 2017-09-26 网易(杭州)网络有限公司 Avoid the method and apparatus of aliasing being plotted in canvas painting canvas
CN108897826A (en) * 2018-06-22 2018-11-27 上海哔哩哔哩科技有限公司 Banner picture rapid generation, system and storage medium
CN110446110A (en) * 2019-07-29 2019-11-12 深圳市东微智能科技股份有限公司 Playback method, video playback apparatus and the storage medium of video

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060209093A1 (en) * 2005-03-15 2006-09-21 Microsoft Corporation Method and computer-readable medium for generating graphics having a finite number of dynamically sized and positioned shapes
KR20100013106A (en) * 2008-07-30 2010-02-09 삼성전자주식회사 Apparatus and method for zoom display of target area from reproducing image
US20110251829A1 (en) * 2010-04-08 2011-10-13 Microsoft Corporation Simulating painting
US20130162646A1 (en) * 2011-12-27 2013-06-27 Apostolos Lerios Texture Repository for Image Processing Applications
CN107204023A (en) * 2017-06-22 2017-09-26 网易(杭州)网络有限公司 Avoid the method and apparatus of aliasing being plotted in canvas painting canvas
CN108897826A (en) * 2018-06-22 2018-11-27 上海哔哩哔哩科技有限公司 Banner picture rapid generation, system and storage medium
CN110446110A (en) * 2019-07-29 2019-11-12 深圳市东微智能科技股份有限公司 Playback method, video playback apparatus and the storage medium of video

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HANGGE: "Fabric.js - 画布视图viewport的自适应(内容自动缩放并居中)", 《HTTPS://WWW.HANGGE.COM/BLOG/CACHE/DETAIL_1861.HTML》 *
LEON ZHANG: "大屏上的全屏页面的自适应适配方案", 《HTTPS://WWW.NJLEONZHANG.COM/2018/08/15/FLEXIBLE-PC-FULL-SCREEN.HTML》 *

Also Published As

Publication number Publication date
CN113012028B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
US10187546B2 (en) Method and device for correcting document image captured by image pick-up device
US9064318B2 (en) Image matting and alpha value techniques
US10317777B2 (en) Automatic zooming method and apparatus
KR20100051648A (en) Method for manipulating regions of a digital image
CN106774862B (en) VR display method based on sight and VR equipment
US20150084930A1 (en) Information processor, processing method, and projection system
US9013512B2 (en) Overscan support
US20190005323A1 (en) Information processing apparatus for tracking processing
US20190005347A1 (en) Information processing apparatus, program, and information processing method
CN111292335A (en) Method and device for determining foreground mask feature map and electronic equipment
CN110390295B (en) Image information identification method and device and storage medium
CN110443772B (en) Picture processing method and device, computer equipment and storage medium
CN109325909B (en) Image amplification method and image amplification device
CN113012028B (en) Image processing method, device, equipment and storage medium
WO2018152710A1 (en) Image correction method and device
CN114924822B (en) Screenshot method and device of three-dimensional topological structure, electronic equipment and storage medium
CN109739403B (en) Method and apparatus for processing information
CN112528707A (en) Image processing method, device, equipment and storage medium
CN112532875B (en) Terminal device, image processing method and device thereof, and storage medium
US20130321470A1 (en) Apparatus and method for viewing an image that is larger than an area of a display device
CN114549303A (en) Image display method, image processing method, image display device, image processing equipment and storage medium
CN110349109B (en) Fisheye distortion correction method and system and electronic equipment thereof
US11393214B2 (en) Apparatus and method for congestion visualization
CN109242941B (en) Three-dimensional object synthesis using visual guidance as part of a two-dimensional digital image
CN113626120A (en) Method and device for determining display page, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant