CN112598571B - Image scaling method, device, terminal and storage medium - Google Patents

Image scaling method, device, terminal and storage medium Download PDF

Info

Publication number
CN112598571B
CN112598571B CN201911184398.8A CN201911184398A CN112598571B CN 112598571 B CN112598571 B CN 112598571B CN 201911184398 A CN201911184398 A CN 201911184398A CN 112598571 B CN112598571 B CN 112598571B
Authority
CN
China
Prior art keywords
image
image data
scaling
camera
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911184398.8A
Other languages
Chinese (zh)
Other versions
CN112598571A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201911184398.8A priority Critical patent/CN112598571B/en
Priority to PCT/CN2020/101687 priority patent/WO2021103574A1/en
Publication of CN112598571A publication Critical patent/CN112598571A/en
Application granted granted Critical
Publication of CN112598571B publication Critical patent/CN112598571B/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)
  • Studio Devices (AREA)
  • Image Processing (AREA)

Abstract

The application provides an image zooming method, an image zooming device, a terminal and a storage medium. The method comprises the steps of obtaining an image scaling instruction, wherein the image scaling instruction comprises the scaling of an image to be scaled; calling corresponding image data according to the image zooming instruction, wherein the image data comprises main image data acquired by a first camera and tele image data acquired by a second camera, and the focal length of the first camera is smaller than that of the second camera; and generating a target image according to the scaling and the called image data.

Description

Image scaling method, device, terminal and storage medium
Technical Field
The present application relates to image processing, and for example, to an image scaling method, apparatus, terminal, and storage medium.
Background
When browsing images, it is often necessary to zoom the image, e.g. to better view the overall composition by reducing the image, or to view details of a part of the image by enlarging the image, etc. In zooming, if the zooming ratio is large, the zoomed image is unclear, for example, for an image with good composition and color, the image is low in definition and noisy when the details in the image are viewed after being zoomed in. Some image browsing software limits the scaling of the image to avoid the problem of too low resolution, but also limits the applicability of the image browsing function.
Disclosure of Invention
The application provides an image zooming method, an image zooming device, a terminal and a storage medium, which are used for improving the zooming definition and enhancing the flexibility of image zooming.
The embodiment of the application provides an image zooming method, which comprises the following steps:
acquiring an image scaling instruction, wherein the image scaling instruction comprises the scaling of an image to be scaled;
calling corresponding image data according to the image zooming instruction, wherein the image data comprises main image data acquired by a first camera and tele image data acquired by a second camera, and the focal length of the first camera is smaller than that of the second camera;
and generating a target image according to the scaling and the called image data.
An embodiment of the present application further provides an image scaling apparatus, including:
the instruction acquisition module is used for acquiring an image scaling instruction, wherein the image scaling instruction comprises the scaling of an image to be scaled;
the data calling module is used for calling corresponding image data according to the image zooming instruction, wherein the image data comprises main image data acquired by a first camera and tele image data acquired by a second camera, and the focal length of the first camera is smaller than that of the second camera;
and the scaling module is used for generating a target image according to the scaling and the called image data.
An embodiment of the present application further provides a terminal, including:
one or more processors;
storage means for storing one or more programs;
the first camera is used for acquiring main image data of an image to be zoomed;
the second camera is used for acquiring the tele image data of the image to be zoomed;
the focal length of the first camera is smaller than that of the second camera;
when executed by the one or more processors, cause the one or more processors to implement the image scaling method described above.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the image scaling method described above.
Drawings
FIG. 1 is a flowchart of an image scaling method according to an embodiment;
FIG. 2 is a schematic diagram of image scaling according to an embodiment;
FIG. 3 is a schematic diagram of image scaling provided by another embodiment;
fig. 4 is a schematic diagram illustrating a preset area determined according to calibration parameters of a camera according to an embodiment;
FIG. 5 is a flowchart of an image scaling method according to another embodiment;
FIG. 6 is a schematic structural diagram of an image scaling apparatus according to an embodiment;
fig. 7 is a schematic hardware structure diagram of a terminal according to an embodiment.
Detailed Description
The present application will be described with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Fig. 1 is a flowchart of an image scaling method according to an embodiment, as shown in fig. 1, the method includes steps 110 and 130.
In step 110, an image scaling instruction is obtained, the image scaling instruction comprising a scaling of an image to be scaled.
In step 120, corresponding image data is called according to the image scaling instruction, wherein the image data comprises main image data acquired by a first camera and tele image data acquired by a second camera, and the focal length of the first camera is smaller than that of the second camera.
In step 130, a target image is generated from the scaling and the recalled image data.
In this embodiment, the image scaling instruction may be input by a user through touch, voice, shortcut key, or the like, and the image scaling instruction includes a scaling of the image to be scaled. For an image to be zoomed, the corresponding image data can be divided into two groups: the first group is main image data acquired through the first camera, and is suitable for zooming in a certain zooming ratio range, and the definition of zoomed images in the zooming ratio range is not too low, so that the browsing requirement can be met; the second group is tele-map data acquired by the second camera, suitable for zooming beyond the zoom scale range. The second camera is a long-focus camera, when the long-focus camera and the non-long-focus camera are used for shooting a unified scene, the long-focus camera can obviously enlarge main content in an image, and the enlargement ratio is related to the zooming performance of the long-focus camera. Based on the recalled main image data and/or tele image data, the target image is generated and displayed in a scaled manner.
In this embodiment, step 120 may specifically include: calling main image data corresponding to the image to be zoomed under the condition that the zoom ratio is within a preset zoom ratio range; and calling the tele-image data corresponding to the image to be zoomed under the condition that the zooming scale is not within the preset zooming scale range. The following steps can be also included: calling main image data corresponding to the image to be zoomed under the condition that the zooming ratio is smaller than a certain threshold value; and calling the tele-chart data corresponding to the image to be zoomed under the condition that the zooming proportion is larger than a certain threshold value, thereby more clearly displaying the main content in the image to be zoomed.
In an embodiment, a plurality of targets (i.e., a plurality of subjects) may exist in an image to be zoomed, which target needs to be zoomed specifically may be determined according to a region pointed by an image zooming instruction of a user, and then, corresponding image data is called for the target according to a zooming ratio to zoom and display the target.
In one embodiment, the main map data and the tele-map data may also be called simultaneously, merged and scaled according to the scaling ratio. For example, for the region where the target is located in the image to be zoomed, the tele-image data may be called and a part of the data may be extracted to zoom to provide higher definition and more details, while for the background region in the image to be zoomed, a fast and simple algorithm (such as an interpolation algorithm) may be used to zoom so that the zoom ratio of the background region is consistent with that of the region where the target is located and the background region may be fused or spliced, but no more details need to be provided for the background region.
In one embodiment, the primary image data may be the original data when the image to be zoomed is displayed, i.e., the image to be zoomed is generated and displayed based on the primary image data prior to zooming.
The image zooming method of the embodiment can be applied to a terminal with a camera shooting function, such as a mobile phone, a tablet computer, a video camera and the like, wherein the terminal is provided with a first camera and a second camera, and the second camera is a long-focus camera. When an image is shot, the first camera and the second camera are used for shooting the same scene respectively to obtain main image data and tele image data respectively, and the main image data and the tele image data can be stored in the same image data file so as to call the main image data and/or the tele image data of the image for zooming when an image zooming instruction of the image is received.
In the embodiment of the application, an image zooming method is provided, and by calling corresponding main image data and/or tele image data according to a zooming ratio, the zooming quality and speed can be considered, the zooming definition can be improved, and the image zooming applicability can be enhanced.
In one embodiment, before the obtaining of the image scaling instruction, the method further comprises: acquiring main image data of the image to be zoomed through a first camera; acquiring tele-chart data of at least one target in the image to be zoomed through a second camera; and storing the main image data and each long-focus image data in an associated manner.
In this embodiment, for an image to be zoomed, main image data and tele image data are acquired respectively. For example, when shooting, a first camera and a second camera of the terminal are turned on, the first camera is used for shooting a main graph, the second camera is used for focusing on an area or a position where a target is located in the same scene, and a long-focus image is shot. The area or the position of the target can be automatically identified by the second camera by using a target identification algorithm so as to distinguish the target from the background; or may be specified by the user; in the case of shooting the main image first, the default focusing position of the first camera when shooting the main image may be used.
There may be one or more targets in the same scene, and in the case of multiple targets, focus shooting is performed separately for each target to acquire corresponding tele-chart data. On the basis, the corresponding coordinate position of the target in each long-focus image data in the main image data can be calculated through an image registration algorithm, so that each long-focus image data and the main image data are associated according to the coordinate position and are stored in an image data file of the image to be zoomed.
In an embodiment, the main image data acquired by the first camera and the tele-image data of each target acquired by the second camera are uniformly stored in an image data file, and the image data file includes a name or an identifier of an image to be zoomed, an image data index and an image data type identifier, and may further include a coordinate position corresponding relation. For example, the contents stored in the image data file include:
the method comprises the steps that image names to be zoomed + main image data indexes + main image data + tele image data indexes + tele image data;
or comprises the following steps:
the method comprises the steps that the image name to be zoomed, the tele-image data index of a target 1, the tele-image data of the target 1, the tele-image data index of a target 2, the tele-image data of the target 2, the main image data index and the main image data are added;
or comprises the following steps:
the image name to be zoomed + the index of the main map data + the index of the tele-map data of the target 1 + the data of the tele-map of the target 1 + the coordinate position of the target 1 in the main map data.
By storing the main image data and each tele-chart data in an associated manner, the main image data and each tele-chart data can be quickly positioned in the process of calling the image data.
In one embodiment, the tele-map data may be saved to a header extension field (e.g., xmp field) of the main map data.
In an embodiment, the image zooming instruction further comprises a zooming area, wherein the zooming area comprises at least one of a first area and a second area, the first area is a zooming area belonging to the preset area, and the second area is a zooming area not belonging to the preset area; calling corresponding image data according to the image scaling instruction, wherein the calling comprises the following steps: for the first area, calling image data corresponding to the first area according to the scaling; and calling the main image data corresponding to the second area.
In this embodiment, the zoom area may be determined according to an image zoom instruction of a user, and the zoom area may wholly or partially belong to a preset area, or may not belong to the preset area. The preset area may be an area where a target in the image to be zoomed is located, or an area where corresponding tele-chart data exists, or a framing area or a focusing area of the second camera.
In one embodiment, for the first region, invoking corresponding image data according to a scaling ratio includes: for the first area, calling main image data corresponding to the first area under the condition that the scaling ratio is smaller than or equal to a preset ratio; and calling the tele-map data corresponding to each target in the first area under the condition that the scaling is larger than the preset scaling.
FIG. 2 is a diagram illustrating image scaling according to an embodiment. As shown in fig. 2, the left side is the image to be zoomed, the right side is the target image, and the arrow shape represents the target in the image to be zoomed; the shaded area represents a zooming area selected by an input image zooming instruction when the user zooms the target; the dashed box area indicates a preset area where the tele-chart data exists. For the case shown in fig. 2, if all the zoom regions belong to the preset region, the zoom region is the first region, and for the first region, the corresponding image data is called according to the zoom ratio, for example, if the zoom ratio is small, the main image data is called to quickly zoom and meet the requirement of definition, and if the zoom ratio is large, the tele image data is called to provide more details. And if the zooming area is completely positioned outside the dashed box area, namely the zooming area does not belong to the preset area, the zooming area is the second area, and the corresponding main image data is directly called for the second area.
In an embodiment, when a plurality of targets exist in an image to be zoomed, the main image data is stored in association with the tele-image data of each target, and is distinguished by using the name of the image to be zoomed, the index of the image data, the type identifier of the image data and/or the corresponding relation of the coordinate and the position, and the tele-image data corresponding to the target in the zooming area selected by the image zooming instruction is called.
In one embodiment, generating the target image from the scaled and recalled image data includes: under the condition that the zooming area comprises a first area, performing digital interpolation on the called main image data or zooming on the called tele image data according to the zooming proportion aiming at the first area to obtain a target image; under the condition that the zooming area comprises a second area, carrying out digital interpolation on the called main image data according to the zooming proportion aiming at the second area to obtain a target image; and under the condition that the zooming area comprises a first area and a second area, performing digital interpolation on the called main image data or zooming on the called tele image data according to the zooming proportion aiming at the first area to obtain a first image, performing digital interpolation on the called main image data according to the zooming proportion aiming at the second area to obtain a second image, and splicing the first image and the second image to obtain a target image.
In this embodiment, under the condition that the zoom region is the first region, if the zoom ratio is small, the called main image data is zoomed to the zoom ratio by adopting a digital interpolation method to obtain a target image; if the scaling is large, the tele-chart data is called, and the called tele-chart data is scaled according to the scaling.
And in the case that the zooming area is the second area, calling the main image data, and adopting a digital interpolation method to target the image.
Under the condition that the zooming area comprises a first area and a second area, calling the first area, wherein the calling area may be main image data or tele image data, performing digital interpolation if the calling area is the main image data, and zooming according to the zooming ratio if the calling area is the tele image data to obtain a partially zoomed first image of a target in an image to be zoomed in a preset area; and performing digital interpolation on the main image data called by the second area according to the scaling to obtain a second image, and splicing the second image and the first image to obtain a target image.
FIG. 3 is a schematic diagram of image scaling according to another embodiment. As shown in fig. 3, the left side is the image to be zoomed, and the right side is the target image. The arrow shape represents an object in the image to be zoomed; the shaded area represents a zooming area selected by an input image zooming instruction when the user zooms the target; the dashed box area indicates a preset area where the tele-chart data exists. For the case shown in fig. 3, the zoom area partially belongs to the preset area, i.e. the zoom area comprises a first area and a second area. In this case, for the part (first area) belonging to the preset area in the zoom area, the corresponding image data is called according to the zoom ratio, for example, if the zoom ratio is small, the main image data is called to quickly zoom and meet the requirement of definition, and if the zoom ratio is large, the tele image data is called to provide more details of the target; and for the part (second area) of the zoom area which does not belong to the preset area, directly calling the corresponding main image data. The finally obtained target image is obtained by scaling and splicing the image data called by the first area and the image data called by the second area according to the scaling.
In fig. 3, for example, the scaling ratio is greater than the preset ratio, in the scaled target image, the shaded portion below the arrow shape is generated based on the main image data called for the second region, and the unshaded portion above the arrow shape is generated based on the tele image data called for the first region, and these two portions have the same scaling ratio and are fused into the complete target image, but have different definitions, and the definition of the first region after scaling is higher due to the tele image data being called. In the case where the scaling ratio is less than the preset ratio, the first region and the second region both call up the main image data, and the target image may be generated by a digital interpolation method based on the main image data.
When the zoom area includes the first area and the second area, a part of image data corresponding to the first area (for example, image data of an upper unshaded portion in an arrow shape in fig. 3) is extracted from the image data called for by the first area and is used for zoom processing to obtain a first image, and image data of other portions is not processed; for the main image data called by the second region, partial image data corresponding to the second region, for example, image data of a hatched portion in the lower part of the arrow shape in fig. 3, is extracted) and used for the scaling processing to obtain the second image, and image data of an upper non-hatched portion is not processed. The extraction process adopts an image registration algorithm, and gray value matching, characteristic value matching and other modes can be utilized.
In one embodiment, before the obtaining of the image scaling instruction, the method further comprises: and determining the preset area according to the calibration parameters of the first camera and the second camera.
Fig. 4 is a schematic diagram illustrating a preset area determined according to calibration parameters of a camera according to an embodiment. The setting positions of the first camera and the second camera on the terminal are fixed, and the calibration parameters (such as the angle of view, the focal length and the like) of the cameras are known quantities, and the angle of view relationship between the first camera and the second camera can be calculated according to the parameters, so that the preset area is determined.
As shown in fig. 4, the outer solid line frame represents the finder range of the first camera, and the inner broken line frame represents the finder range of the second camera. The view range of the second camera is positioned at the horizontal center of the view range of the first camera, and the view width of the second camera and the view range of the first camera have a certain proportionality coefficient, and the proportionality coefficient is related to the field angle of the first camera and the view range of the second camera. Assuming that the view width of the first camera is 2w, the field angle is 2 α, the field angle of the second camera is 2 β, the view width in the vertical direction of the view range is set to x, and the view distances are all represented as d, the following triangular relationship exists:
Figure BDA0002292070130000091
so that x can be calculated; based on a similar principle for the horizontal direction of the viewing range, the viewing length of the viewing range in the horizontal direction can be determined by using the proportion of the field angle after the top is removed, and then the viewing range of the second camera is determined.
In the process of determining the preset range, the obtained result is an approximate value, and the offset of the setting positions of the first camera and the second camera on the terminal needs to be considered. In addition, the first camera and the second camera can be calibrated by other methods, so that a more accurate coordinate relation is obtained.
Fig. 5 is a flowchart of an image scaling method according to another embodiment. As shown in fig. 5, the method comprises steps 201 and 212.
In step 201, main image data of an image to be zoomed is acquired by a first camera.
In step 202, tele-map data of at least one target in the image to be zoomed is acquired by the second camera.
In step 203, the main map data and each tele map data are stored in association.
For example, a user may start a first camera and a second camera of the terminal, and respectively shoot a target to obtain an image to be zoomed, where the image shot by the first camera is main image data, and the image shot by the second camera is tele-image data. In the process of acquiring the main image data of the image to be zoomed through the first camera, the framing range of the second camera can be drawn or identified in the modes of a dotted line frame, a light color frame, a shadow and the like on a shooting interface or a preview interface of the terminal, namely, a preset area is identified, so that an imaging main body of the second camera of a user is prompted, the user can conveniently focus a target, the long-focus image data can be acquired for subsequent zooming processing for an important target, and the problem that the image cannot be clearly viewed due to missing acquisition is avoided. If the number of the targets is multiple, the tele-chart data of each target can be respectively acquired from different angles and positions through the mobile terminal, and the corresponding coordinate position of the target in each tele-chart data in the main graph data is calculated in an image registration mode. And storing the main image data of the same image to be zoomed and all the tele image data into an image data file in an associated mode.
In step 204, a preset area is determined according to the calibration parameters of the first camera and the second camera.
In step 205, an image scaling instruction is obtained, the image scaling instruction including a scaling ratio and a scaling region.
In step 206, is the zoom region included the first region? If yes, executing step 207, calling corresponding image data according to the scaling; if not, step 210 is executed to continuously determine whether the second area is included.
In step 207, is the scaling less than or equal to the preset scale? If yes, go to step 208, and go to step 210 to continue to determine whether the second area is included; if not, go to step 209 and step 210, and continue to determine whether the second area is included.
In step 208, the main map data corresponding to the first region is called.
In step 209, the tele-map data corresponding to each target in the first region is called.
In step 210, does the zoom region include the second region? If yes, go to step 211, otherwise go directly to step 212.
In step 211, the main image data corresponding to the second region is called.
In step 212, a target image is generated from the scaling and the recalled image data.
When the tele-map data is called for the first region and the main-map data is called for the second region, it is necessary to extract partial data for each of the two image data and perform scaling and fusion (see fig. 3) in the process of generating the target image.
In this embodiment, a user may open an image data file through a terminal and display an image to be zoomed (the image to be zoomed may be generated based on main image data), and a preset region may be identified in the image to be zoomed by using a flash frame, a character, a shadow, or the like, so as to prompt the user that the image in the region has corresponding tele-image data and has a higher definition after being enlarged. The user can carry out zooming operation in the forms of double-click on a preset area, double-finger dragging, voice or shortcut keys and the like, and the target image is displayed through the gradual animation.
In one embodiment, the image to be zoomed is a panoramic image;
before the image zooming instruction is acquired, the method further comprises the following steps: acquiring a main image of an image to be zoomed under multiple fields of view through a first camera and synthesizing main image data; acquiring a tele-chart image of at least one target in the image to be zoomed under multiple fields of view through a second camera and synthesizing tele-chart data of the target; and storing the main map data and each tele-map data in an associated manner.
In this embodiment, the image to be zoomed is a panoramic image, the main image data is synthesized according to the main image acquired by the first camera under multiple fields of view, and the tele image data is synthesized according to the tele image acquired by the second camera under multiple fields of view for each target. For one target, a plurality of long-focus image images are registered and spliced to synthesize long-focus image data, and the angle of view corresponding to the long-focus image data is the same as the angle of view corresponding to the main image data. The main image data and the tele image data of each target are stored in a correlation mode, and the corresponding image data can be directly called and zoomed in the image zooming process without the image registration process. The target image is also a panoramic image obtained by calling corresponding image data for the zoom area and zooming according to the zoom ratio.
In an embodiment, the method of image scaling may be applied in video scaling. The video to be zoomed is composed of continuous multiframe images to be zoomed. The video to be zoomed can be recorded through the first camera and the second camera, the video data comprises main video data and long-focus video data, and the main video data and the long-focus video data are stored in a correlation mode and called according to the video zooming instruction. The video zooming instruction comprises a zooming area, a zooming proportion and a target zooming frame, and only image data of an image to be zoomed corresponding to the target zooming frame is needed to be called when the video data is called. The video data files of the main video data and the tele video data store names of videos to be zoomed, video data indexes, video data types and the like, and also store time stamps or arrangement sequences and the like of images to be zoomed of each frame. For a specific process for obtaining a video to be zoomed and a zooming method, reference may be made to the above embodiments.
In the embodiment, the first camera and the second camera are used for respectively acquiring and storing the image data of the image to be zoomed, calling the corresponding image data according to the zooming area and the zooming proportion of the image zooming instruction, considering the zooming speed and the zooming definition and providing more image details; and the data to be zoomed of different targets and different view fields can be zoomed flexibly, the image zooming quality is ensured comprehensively, and the applicability of image zooming is enhanced.
The embodiment of the application also provides an image zooming device. Fig. 6 is a schematic structural diagram of an image scaling apparatus according to an embodiment. As shown in fig. 6, the image scaling apparatus includes: an instruction fetch module 310, a data call module 320, and a transport module scaling module 330.
An instruction obtaining module 310 configured to obtain an image scaling instruction, where the image scaling instruction includes a scaling ratio of an image to be scaled;
a data calling module 320 configured to call corresponding image data according to the image scaling instruction, where the image data includes main image data acquired by a first camera and tele image data acquired by a second camera, and a focal length of the first camera is smaller than a focal length of the second camera;
a scaling module 330 configured to generate a target image based on the scaling and the invoked image data.
The image zooming apparatus of the embodiment can give consideration to the zooming quality and speed, improve the zooming definition and enhance the image zooming applicability by calling the corresponding main image data and/or tele image data according to the zooming scale
In one embodiment, before the obtaining of the image scaling instruction, the method further comprises:
the image data acquisition module is arranged to acquire main image data of the image to be zoomed through the first camera before acquiring the image zooming instruction; acquiring tele-chart data of at least one target in the image to be zoomed through a second camera; and storing the main image data and each long-focus image data in an associated manner.
In an embodiment, the image zooming instruction further comprises a zooming area, and the zooming area comprises at least one of a first area and a second area, wherein the first area is a zooming area belonging to a preset area, and the second area is a zooming area not belonging to the preset area;
the data call module 320 includes:
the first calling unit is used for calling the image data corresponding to the first area according to the scaling for the first area;
and the second calling unit is used for calling the main image data corresponding to the second area.
In an embodiment, the first invoking unit is specifically configured to:
for a first area, calling main image data corresponding to the first area under the condition that the scaling ratio is smaller than or equal to a preset ratio; and calling the tele-chart data corresponding to each target in the first area under the condition that the scaling is larger than a preset scale.
In an embodiment, the scaling module 330 is specifically configured to:
under the condition that the zooming area comprises a first area, digitally interpolating the called main image data or zooming the called tele image data according to the zooming proportion aiming at the first area to obtain the target image;
under the condition that the zooming area comprises a second area, carrying out digital interpolation on the called main image data according to the zooming proportion aiming at the second area to obtain the target image;
and under the condition that the zooming area comprises a first area and a second area, carrying out digital interpolation on the called main image data or zooming on the called tele-image data according to the zooming proportion aiming at the first area to obtain a first image, carrying out zooming on the called tele-image data according to the zooming proportion aiming at the second area to obtain a second image, and splicing the first image and the second image to obtain the target image.
In one embodiment, the method further comprises:
and the calibration module is set to determine the preset area according to the calibration parameters of the first camera and the second camera before an image scaling instruction is acquired.
In an embodiment, the image to be zoomed is a panoramic image;
the image data acquisition module is further configured to:
before an image zooming instruction is acquired, acquiring a main image of the image to be zoomed under multiple fields of view through a first camera and synthesizing the main image data;
acquiring a tele-chart image of at least one target in the image to be zoomed under multiple fields of view through a second camera and synthesizing tele-chart data of the target;
and storing the main image data and each long-focus image data in an associated manner.
The image scaling apparatus proposed by the present embodiment and the image scaling method proposed by the above embodiments belong to the same inventive concept, and technical details that are not described in detail in the present embodiment can be referred to any of the above embodiments, and the present embodiment has the same beneficial effects as performing the image scaling method.
The embodiment of the application also provides a terminal. The image scaling method may be performed by an image scaling device, which may be implemented in software and/or hardware, and integrated in the terminal. The terminal includes but is not limited to: desktop computers, notebook computers, smart phones, tablet computers and other intelligent terminals.
Fig. 7 is a schematic hardware structure diagram of a terminal according to an embodiment. As shown in fig. 7, the terminal provided in this embodiment includes: a processor 410 and a storage 420. The number of the processors in the terminal may be one or more, fig. 7 illustrates one processor 410, the processor 410 and the storage device 420 in the apparatus may be connected by a bus or in other manners, and fig. 7 illustrates the connection by a bus. Further comprising: the first camera 430 is used for acquiring main image data of an image to be zoomed; the second camera 440 is used for acquiring tele image data of the image to be zoomed; the focal length of the first camera 430 is smaller than that of the second camera 430.
The one or more programs are executed by the one or more processors 410, so that the one or more processors implement the image scaling method according to any of the embodiments described above.
The storage device 420 in the terminal, as a computer-readable storage medium, can be used for storing one or more programs, which may be software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the image scaling method in the embodiment of the present invention (for example, the modules in the image scaling device shown in fig. 6, including the instruction obtaining module 310, the data calling module 320, and the transmission module scaling module 330). The processor 410 executes various functional applications and data processing of the terminal by running software programs, instructions and modules stored in the storage device 420, that is, implements the image scaling method in the above-described method embodiments.
The storage device 420 mainly includes a storage program area and a storage data area, wherein the storage program area can store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of the apparatus, etc. (such as the image scaling instruction, the image data, etc. in the above-described embodiments). Further, the storage 420 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the storage 420 may further include memory located remotely from the processor 410, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
And, when one or more programs included in the above terminal are executed by the one or more processors 410, the following operations are implemented: acquiring an image scaling instruction, wherein the image scaling instruction comprises the scaling of an image to be scaled; calling corresponding image data according to the image zooming instruction, wherein the image data comprises main image data acquired by a first camera and tele image data acquired by a second camera, and the focal length of the first camera is smaller than that of the second camera; and generating a target image according to the scaling and the called image data.
The terminal proposed by the present embodiment and the image scaling method proposed by the above embodiment belong to the same inventive concept, and details of the technology that are not described in detail in the present embodiment can be referred to any of the above embodiments, and the present embodiment has the same beneficial effects as performing the image scaling method.
Embodiments of the present application also provide a storage medium containing computer-executable instructions for performing a method of image scaling when executed by a computer processor.
Through the above description of the embodiments, those skilled in the art will appreciate that the present application can be implemented by software, general hardware, or hardware. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, and the computer software product may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes a plurality of instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the method according to any embodiment of the present application.
The above description is only exemplary embodiments of the present application, and is not intended to limit the scope of the present application.
Any logic flow block diagrams in the figures of this application may represent program steps, or may represent interconnected logic circuits, modules, and functions, or may represent a combination of program steps and logic circuits, modules, and functions. The computer program may be stored on a memory. The memory may be of any type suitable to the local technical environment and may be implemented using any suitable data storage technology, such as, but not limited to, Read Only Memory (ROM), Random Access Memory (RAM), optical storage devices and systems (digital versatile disks, DVDs, or CD discs), etc. The computer readable medium may include a non-transitory storage medium. The data processor may be of any type suitable to the local technical environment, such as but not limited to general purpose computers, special purpose computers, microprocessors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), programmable logic devices (FGPAs), and processors based on a multi-core processor architecture.
The foregoing has provided by way of exemplary and non-limiting examples a detailed description of exemplary embodiments of the present application. Various modifications and adaptations to the foregoing embodiments may become apparent to those skilled in the relevant arts in view of the following drawings and the appended claims without departing from the scope of the invention. Therefore, the proper scope of the invention is to be determined according to the claims.

Claims (10)

1. An image scaling method, comprising:
acquiring an image scaling instruction, wherein the image scaling instruction comprises the scaling of an image to be scaled;
calling corresponding image data according to the image zooming instruction, wherein the image data comprises main image data acquired by a first camera and tele image data acquired by a second camera, and the focal length of the first camera is smaller than that of the second camera; wherein the calling the corresponding image data according to the image scaling instruction comprises: calling main image data corresponding to the image to be zoomed under the condition that the zoom ratio is within a preset zoom ratio range; calling the tele-chart data corresponding to the image to be zoomed under the condition that the zoom scale is not within the preset zoom scale range; or; calling main image data corresponding to the image to be zoomed under the condition that the zooming ratio is smaller than a certain threshold value; calling the tele-chart data corresponding to the image to be zoomed under the condition that the zooming ratio is larger than a certain threshold value;
generating a target image according to the scaling and the called image data; generating a target image according to the scaling and the called image data, comprising: based on the recalled primary and/or tele image data, the primary and/or tele image data is scaled to generate a target image.
2. The method of claim 1, prior to obtaining the image scaling instruction, further comprising:
acquiring main image data of the image to be zoomed through a first camera;
acquiring tele-chart data of at least one target in the image to be zoomed through a second camera;
and storing the main image data and each long-focus image data in an associated manner.
3. The method according to claim 1, wherein the image zoom instruction further comprises a zoom region comprising at least one of a first region and a second region, wherein the first region is a zoom region belonging to a preset region, and the second region is a zoom region not belonging to the preset region;
the calling the corresponding image data according to the image scaling instruction comprises:
for a first area, calling image data corresponding to the first area according to a scaling;
and calling main graph data corresponding to the second area.
4. The method of claim 3, wherein for the first region, invoking the corresponding image data according to the scaling comprises:
for a first area, calling main image data corresponding to the first area under the condition that the scaling ratio is smaller than or equal to a preset ratio; and calling the tele-chart data corresponding to each target in the first area under the condition that the scaling is larger than a preset scale.
5. The method of claim 3, wherein generating a target image from the scaled and recalled image data comprises:
under the condition that the zooming area comprises a first area, digitally interpolating the called main image data or zooming the called tele image data according to the zooming proportion aiming at the first area to obtain the target image;
under the condition that the zooming area comprises a second area, carrying out digital interpolation on the called main image data according to the zooming proportion aiming at the second area to obtain the target image;
and under the condition that the zooming area comprises a first area and a second area, carrying out digital interpolation on the called main image data or zooming on the called tele-image data according to the zooming proportion aiming at the first area to obtain a first image, carrying out zooming on the called tele-image data according to the zooming proportion aiming at the second area to obtain a second image, and splicing the first image and the second image to obtain the target image.
6. The method of any of claims 3-5, further comprising, prior to obtaining the image scaling instruction:
and determining the preset area according to the calibration parameters of the first camera and the second camera.
7. The method of claim 1, wherein the image to be zoomed is a panoramic image;
before the image zooming instruction is acquired, the method further comprises the following steps:
acquiring a main image of the image to be zoomed under multiple fields of view through a first camera and synthesizing the main image data;
acquiring a tele-chart image of at least one target in the image to be zoomed under multiple fields of view through a second camera and synthesizing tele-chart data of the target;
and storing the main image data and each long-focus image data in an associated manner.
8. An image scaling apparatus, comprising:
the instruction acquisition module is used for acquiring an image scaling instruction, wherein the image scaling instruction comprises the scaling of an image to be scaled;
the data calling module is used for calling corresponding image data according to the image zooming instruction, wherein the image data comprises main image data acquired by a first camera and tele image data acquired by a second camera, and the focal length of the first camera is smaller than that of the second camera; wherein the calling the corresponding image data according to the image scaling instruction comprises: calling main image data corresponding to the image to be zoomed under the condition that the zoom ratio is within a preset zoom ratio range; calling the tele-chart data corresponding to the image to be zoomed under the condition that the zoom scale is not within the preset zoom scale range; or; calling main image data corresponding to the image to be zoomed under the condition that the zooming ratio is smaller than a certain threshold value; calling the tele-chart data corresponding to the image to be zoomed under the condition that the zooming ratio is larger than a certain threshold value;
a scaling module configured to generate a target image according to the scaling and the called image data; generating a target image according to the scaling and the called image data, comprising: based on the recalled primary and/or tele image data, the primary and/or tele image data is scaled to generate a target image.
9. A terminal, comprising:
one or more processors;
storage means for storing one or more programs;
the first camera is used for acquiring main image data of an image to be zoomed;
the second camera is used for acquiring the tele image data of the image to be zoomed;
the focal length of the first camera is smaller than that of the second camera;
when executed by the one or more processors, cause the one or more processors to implement the image scaling method 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 image scaling method according to any one of claims 1 to 7.
CN201911184398.8A 2019-11-27 2019-11-27 Image scaling method, device, terminal and storage medium Active CN112598571B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911184398.8A CN112598571B (en) 2019-11-27 2019-11-27 Image scaling method, device, terminal and storage medium
PCT/CN2020/101687 WO2021103574A1 (en) 2019-11-27 2020-07-13 Image scaling method and apparatus, terminal, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911184398.8A CN112598571B (en) 2019-11-27 2019-11-27 Image scaling method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN112598571A CN112598571A (en) 2021-04-02
CN112598571B true CN112598571B (en) 2021-10-08

Family

ID=75180228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911184398.8A Active CN112598571B (en) 2019-11-27 2019-11-27 Image scaling method, device, terminal and storage medium

Country Status (2)

Country Link
CN (1) CN112598571B (en)
WO (1) WO2021103574A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113364976B (en) * 2021-05-10 2022-07-15 荣耀终端有限公司 Image display method and electronic equipment
CN113781373A (en) * 2021-08-26 2021-12-10 云从科技集团股份有限公司 Image fusion method, device and computer storage medium

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5657402A (en) * 1991-11-01 1997-08-12 Massachusetts Institute Of Technology Method of creating a high resolution still image using a plurality of images and apparatus for practice of the method
CN106161940B (en) * 2016-07-29 2019-02-15 维沃移动通信有限公司 A kind of image processing method and mobile terminal
CN106791377B (en) * 2016-11-29 2019-09-27 Oppo广东移动通信有限公司 Control method, control device and electronic device
CN106851130A (en) * 2016-12-13 2017-06-13 北京搜狐新媒体信息技术有限公司 A kind of video-splicing method and device
CN106791400B (en) * 2016-12-23 2019-08-20 维沃移动通信有限公司 A kind of image display method and mobile terminal
CN107194870B (en) * 2017-05-24 2020-07-28 北京大学深圳研究生院 Image scene reconstruction method based on salient object detection
KR101966423B1 (en) * 2017-05-31 2019-04-05 주식회사 시메이션 Method for image matching and apparatus for executing the method
CN107277371A (en) * 2017-07-27 2017-10-20 青岛海信移动通信技术股份有限公司 A kind of method and device in mobile terminal amplification picture region
CN107529020B (en) * 2017-09-11 2020-10-13 Oppo广东移动通信有限公司 Image processing method and apparatus, electronic apparatus, and computer-readable storage medium
CN107657629A (en) * 2017-10-27 2018-02-02 广东工业大学 The tracking and tracking system of a kind of target
US10580117B2 (en) * 2017-11-20 2020-03-03 Comcast Cable Communications, Llc Method to generate additional level of detail when zooming in on an image
CN108184066A (en) * 2018-01-10 2018-06-19 上海展扬通信技术有限公司 Shooting processing method, capture apparatus and the readable storage medium storing program for executing of photo
CN108377342B (en) * 2018-05-22 2021-04-20 Oppo广东移动通信有限公司 Double-camera shooting method and device, storage medium and terminal
CN110099213A (en) * 2019-04-26 2019-08-06 维沃移动通信(杭州)有限公司 A kind of image display control method and terminal
CN112738397A (en) * 2020-12-29 2021-04-30 维沃移动通信(杭州)有限公司 Shooting method, shooting device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN112598571A (en) 2021-04-02
WO2021103574A1 (en) 2021-06-03

Similar Documents

Publication Publication Date Title
CN110622497B (en) Device with cameras having different focal lengths and method of implementing a camera
KR102480245B1 (en) Automated generation of panning shots
EP3457683B1 (en) Dynamic generation of image of a scene based on removal of undesired object present in the scene
CN108833785B (en) Fusion method and device of multi-view images, computer equipment and storage medium
CN110324532B (en) Image blurring method and device, storage medium and electronic equipment
CN109474780B (en) Method and device for image processing
CN111915483B (en) Image stitching method, device, computer equipment and storage medium
CN112367459B (en) Image processing method, electronic device, and non-volatile computer-readable storage medium
WO2022161260A1 (en) Focusing method and apparatus, electronic device, and medium
WO2022105740A1 (en) Video processing method and apparatus, readable medium, and electronic device
CN110111241B (en) Method and apparatus for generating dynamic image
CN112598571B (en) Image scaling method, device, terminal and storage medium
CN114071010B (en) Shooting method and equipment
WO2019006762A1 (en) Image capturing apparatus and method
CN111654637B (en) Focusing method, focusing device and terminal equipment
CN110717452B (en) Image recognition method, device, terminal and computer readable storage medium
CN110266926B (en) Image processing method, image processing device, mobile terminal and storage medium
CN111201773A (en) Photographing method and device, mobile terminal and computer readable storage medium
WO2023142732A1 (en) Image processing method and apparatus, and electronic device
CN111461950A (en) Image processing method and device
CN114390206A (en) Shooting method and device and electronic equipment
US9723216B2 (en) Method and system for generating an image including optically zoomed and digitally zoomed regions
CN111325148A (en) Method, device and equipment for processing remote sensing image and storage medium
CN115086558B (en) Focusing method, image pickup apparatus, terminal apparatus, and storage medium
CN113766090B (en) Image processing method, terminal 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