CN116703718B - Image amplification method and electronic equipment - Google Patents

Image amplification method and electronic equipment Download PDF

Info

Publication number
CN116703718B
CN116703718B CN202211097599.6A CN202211097599A CN116703718B CN 116703718 B CN116703718 B CN 116703718B CN 202211097599 A CN202211097599 A CN 202211097599A CN 116703718 B CN116703718 B CN 116703718B
Authority
CN
China
Prior art keywords
magnification
target
preset
interval
image
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
CN202211097599.6A
Other languages
Chinese (zh)
Other versions
CN116703718A (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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211097599.6A priority Critical patent/CN116703718B/en
Publication of CN116703718A publication Critical patent/CN116703718A/en
Application granted granted Critical
Publication of CN116703718B publication Critical patent/CN116703718B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/7243User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages
    • H04M1/72439User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages for image or video messaging

Abstract

The application discloses an image amplifying method and electronic equipment, wherein the method comprises the following steps: receiving a first initial magnification factor which is sent by an application program and used for amplifying an image; determining a capture distance, the capture distance being a distance between the electronic device and a capture object in the image; determining a first target magnification based on the first initial magnification and the capture distance; the image is magnified based on a first target magnification. By adopting the method, the efficiency of the image amplifying process can be improved, so that the scanning speed is improved.

Description

Image amplification method and electronic equipment
Technical Field
The application relates to the technical field of terminals, in particular to an image amplifying method and electronic equipment.
Background
Along with the gradual powerful functions of the mobile phone, the functions of code scanning payment, code scanning bill, document scanning and the like can be realized through a camera in the mobile phone. Taking code scanning payment as an example, a user uses a mobile phone to scan a two-dimensional code provided by a merchant to realize payment. In the process of scanning the two-dimension code, the mobile phone can not recognize the two-dimension code due to the fact that the distance between the mobile phone and the two-dimension code is too far, and therefore the mobile phone is required to scan the two-dimension code after amplifying the two-dimension code.
When the mobile phone detects that the two-dimension code exists, but the size is too small to be identified, an application program package issues a magnification factor to enlarge the picture of the two-dimension code. If the mobile phone still cannot recognize the two-dimensional code after the two-dimensional code is amplified according to the transmitted amplification factor, the application program package can issue a second larger multiple after a period of time, so that the two-dimensional code picture is amplified again until the two-dimensional code picture can be recognized. However, in the method for amplifying the two-dimensional code through multiple times of issuing, the efficiency of the amplifying process is low due to the time interval between each time of issuing the multiple times, so that the code scanning speed is affected, and the code scanning performance is further deteriorated.
Disclosure of Invention
The embodiment of the application provides an image amplifying method and electronic equipment, which can improve the efficiency of an amplifying process, thereby improving the scanning speed.
In a first aspect, an embodiment of the present application provides an image magnification method, including: receiving a first initial magnification factor which is sent by an application program and used for amplifying an image; determining a capture distance, the capture distance being a distance between the electronic device and a capture object in the image; determining a first target magnification based on the first initial magnification and the capture distance; the image is magnified based on the first target magnification.
In general, the electronic device directly amplifies the image according to the amplification factor sent by the application program, and the amplification mode needs the application program to send the amplification factor for multiple times to achieve the expected amplification effect. Based on the method described in the first aspect, a first target magnification is determined by the first initial magnification and the capture distance, and then the image is magnified based on the first target magnification. The first target magnification is determined based on the capture distance, so that the obtained first target magnification is more accurate, the expected amplification effect can be achieved after fewer times of amplification, the efficiency of the amplification process is improved, and the scanning speed is improved.
In one possible embodiment, the capturing distance is determined by: determining a target preset magnification interval in which the first initial magnification is located from a plurality of preset magnification intervals; if the target preset magnification interval is not a first preset magnification interval in the preset magnification intervals, determining a capturing distance, wherein the first preset magnification interval is the largest interval in the preset magnification intervals; the method further comprises the steps of: and if the target preset magnification interval is the first preset magnification interval, amplifying the image based on the first initial magnification.
Based on the mode, because the first preset magnification interval is the maximum interval, when the first initial magnification is located in the first preset magnification interval, the image is directly magnified according to the first initial magnification without calculating the first target magnification, and power consumption is saved.
In one possible embodiment, the first target magnification is determined based on the first initial magnification and the capture distance, by: determining a target preset distance interval in which the capturing distance is located from a plurality of preset distance intervals; and determining the first target magnification based on the target preset magnification interval, the target preset distance interval and the first initial magnification.
Based on this approach, the first target magnification can be determined more accurately.
In one possible embodiment, the first target magnification is determined based on the target preset magnification interval, the target preset distance interval, and the first initial magnification, which is specifically implemented as follows: if the target preset magnification interval is a second preset magnification interval, and the target preset distance interval is any one of a first preset distance interval and a second preset distance interval, determining the first initial magnification as the first target magnification, wherein the second preset magnification interval is a second large interval in a plurality of preset magnification intervals, the first preset distance interval is a smallest interval in the plurality of preset distance intervals, and the second preset distance interval is a second small interval in the plurality of preset distance intervals; if the target preset magnification interval is a second preset magnification interval and the target preset distance interval is not any one of the first preset distance interval and the second preset distance interval, determining a first target magnification based on the target parameter set and the first initial magnification; if the target preset magnification interval is smaller than the second preset magnification interval and the target preset distance interval is the first preset distance interval, determining the first initial magnification as the first target magnification; if the target preset magnification interval is smaller than the second preset magnification interval and the target preset distance interval is not the first preset distance interval, determining a first target magnification based on the target parameter set and the first initial magnification; the target parameter sets corresponding to the preset magnification interval and the preset distance interval of different combinations are different.
Based on the mode, the rule for determining the first target magnification is different for different target preset magnification intervals and target preset distance intervals, so that the first target magnification can be determined more accurately.
In one possible embodiment, the image is enlarged based on the first target magnification, which is specifically implemented as follows: determining a first amplification step length based on a first target amplification factor, a first initial amplification factor and a preset amplification frequency, wherein the first amplification step length is a difference value between two adjacent amplification factors; and performing smooth amplification processing on the image based on the first amplification step.
Based on this approach, stepwise enlargement of the image can be achieved.
In one possible embodiment, the first amplification step is determined based on the first target amplification factor, the first initial amplification factor and the preset amplification times, and the specific implementation manner is as follows: if the difference between the first target magnification and the first initial magnification meets a first condition, determining a first amplification step length based on the first target magnification, the first initial magnification and a preset amplification frequency; the method further comprises the steps of: if the difference between the first target magnification and the first initial magnification does not meet the first condition, the image is magnified to the first target magnification through one magnification treatment.
Based on the mode, the image is amplified step by step under the condition that the difference between the first target magnification and the first initial magnification is large, and the image is directly amplified under the condition that the difference between the first target magnification and the first initial magnification is not large, so that the amplification efficiency is improved.
In one possible embodiment, the method further comprises: if the first target magnification is larger than the first threshold and smaller than the second threshold, updating the first target magnification to the second threshold, and amplifying the image to the first target magnification through one amplification treatment.
Based on the mode, for the condition that the first target magnification is smaller, the second threshold is directly used as the first target magnification, and the image is directly magnified, so that invalid magnification caused by too small first target magnification can be avoided, and the magnification efficiency and accuracy are improved.
In one possible embodiment, the method further comprises: receiving a second initial magnification factor which is sent by an application program and used for amplifying the image in the process of carrying out smooth amplification processing on the image based on the first amplification step length; determining a second target magnification based on the second initial magnification and the capture distance; determining a second amplification step length based on the second target amplification factor, the current amplification factor of the image and the preset amplification times, wherein the second amplification step length is the difference between the adjacent amplification factors; and performing smooth amplification processing on the image based on the second amplification step.
In one possible embodiment, the second magnification step is determined based on the second target magnification, the current magnification of the image, and the preset magnification times, and the specific implementation manner is as follows: if the second target magnification is larger than the current magnification of the image, determining a second magnification step length based on the second target magnification, the current magnification of the image and the preset magnification times; the method further comprises the steps of: and if the second target magnification is smaller than the current magnification of the image, updating the second target magnification to the current magnification of the image.
In a second aspect, an embodiment of the present application provides an image magnification device, including an acquisition unit and a processing unit, where: the acquisition unit is used for receiving a first initial magnification factor which is sent by an application program and used for amplifying the image; the processing unit is used for determining a capturing distance, wherein the capturing distance is the distance between the electronic equipment and a capturing object in the image; the processing unit is further used for determining a first target magnification based on the first initial magnification and the capturing distance; and the processing unit is also used for amplifying the image based on the first target magnification.
In a possible implementation manner, the processing unit is further configured to determine a target preset magnification interval in which the first initial magnification is located from a plurality of preset magnification intervals; if the target preset magnification interval is not a first preset magnification interval of the preset magnification intervals, the processing unit is further configured to determine a capturing distance, where the first preset magnification interval is a maximum interval of the preset magnification intervals; if the target preset magnification interval is the first preset magnification interval, the processing unit is further configured to amplify the image based on the first initial magnification.
In a possible implementation manner, the processing unit is further configured to determine a target preset distance interval in which the capturing distance is located from a plurality of preset distance intervals; the processing unit is further used for determining a first target magnification based on the target preset magnification interval, the target preset distance interval and the first initial magnification.
In one possible implementation manner, if the target preset magnification interval is a second preset magnification interval, and the target preset distance interval is any one of the first preset distance interval and the second preset distance interval, the processing unit is further configured to determine the first initial magnification as the first target magnification, the second preset magnification interval is a second large interval in the multiple preset magnification intervals, the first preset distance interval is a smallest interval in the multiple preset distance intervals, and the second preset distance interval is a second small interval in the multiple preset distance intervals; if the target preset magnification interval is a second preset magnification interval and the target preset distance interval is not any one of the first preset distance interval and the second preset distance interval, the processing unit is further configured to determine a first target magnification based on the target parameter set and the first initial magnification; if the target preset magnification interval is smaller than the second preset magnification interval and the target preset distance interval is the first preset distance interval, the processing unit is further used for determining the first initial magnification as the first target magnification; if the target preset magnification interval is smaller than the second preset magnification interval and the target preset distance interval is not the first preset distance interval, the processing unit is further used for determining a first target magnification based on the target parameter set and the first initial magnification; the target parameter sets corresponding to the preset magnification interval and the preset distance interval of different combinations are different.
In one possible implementation manner, the processing unit is further configured to determine a first amplification step length based on the first target amplification factor, the first initial amplification factor, and the preset amplification times, where the first amplification step length is a difference between two adjacent amplification factors; and the processing unit is also used for carrying out smooth amplification processing on the image based on the first amplification step length.
In one possible implementation manner, if the difference between the first target magnification and the first initial magnification meets the first condition, the processing unit is further configured to determine a first amplification step size based on the first target magnification, the first initial magnification, and the preset amplification times; and if the difference between the first target magnification and the first initial magnification does not meet the first condition, the processing unit is further configured to amplify the image to the first target magnification through one amplification process.
In one possible implementation, if the first target magnification is greater than the first threshold and less than the second threshold, the processing unit is further configured to update the first target magnification to the second threshold, and zoom in the image to the first target magnification through a single zoom-in process.
In one possible implementation manner, during the process of performing the smooth amplification processing on the image based on the first amplification step, the obtaining unit is further configured to receive a second initial amplification factor sent by the application program and used for amplifying the image; the processing unit is further used for determining a second target magnification based on the second initial magnification and the capture distance; the processing unit is further used for determining a second amplification step length based on the second target amplification factor, the current amplification factor of the image and the preset amplification times, wherein the second amplification step length is the difference between the adjacent amplification factors; and the processing unit is also used for carrying out smooth amplification processing on the image based on the second amplification step length.
In one possible implementation, if the second target magnification is greater than the current magnification of the image, the processing unit is further configured to determine a second magnification step based on the second target magnification, the current magnification of the image, and the preset magnification times; and if the second target magnification is smaller than the current magnification of the image, the processing unit is further used for updating the second target magnification to the current magnification of the image.
In a third aspect, embodiments of the present application provide an electronic device including a memory and one or more processors; the memory is coupled to the one or more processors for storing computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform the method as described in the first aspect or any one of the possible implementations of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform a method as described in the first aspect or any one of the possible implementations of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product for, when run on an electronic device, causing the electronic device to perform a method as described in the first aspect or any one of the possible implementations of the first aspect.
Drawings
Fig. 1 is a schematic hardware structure of an electronic device according to an embodiment of the present application;
fig. 2 is an application scenario schematic diagram of an image magnification method provided in an embodiment of the present application;
fig. 3 is a schematic software structure of an electronic device according to an embodiment of the present application;
fig. 4 is a schematic flow chart of an image zooming method according to an embodiment of the present application;
FIG. 5 is a schematic illustration of one embodiment provided by embodiments of the present application;
FIG. 6 is a schematic diagram of another embodiment provided by an embodiment of the present application;
fig. 7 is a schematic view of yet another embodiment provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and thoroughly described below with reference to the accompanying drawings. Wherein, in the description of the embodiments of the present application, "/" means or is meant unless otherwise indicated, for example, a/B may represent a or B; the text "and/or" is merely an association relation describing the associated object, and indicates that three relations may exist, for example, a and/or B may indicate: the three cases where a exists alone, a and B exist together, and B exists alone, and in addition, in the description of the embodiments of the present application, "plural" means two or more than two.
The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
In order to improve the efficiency of the amplifying process and thus improve the scanning speed, the application provides an image amplifying method and electronic equipment. The electronic device may be a terminal device with a photographing or shooting function, such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, a smart watch, etc., but is not limited thereto.
Referring to fig. 1, fig. 1 is a schematic hardware structure of an electronic device according to the present application. It should be noted that, in specific applications, the electronic device may have more or fewer components than those shown in fig. 1, may combine two or more components, or may have different component configurations. The various components shown in fig. 1 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
As shown in fig. 1, the electronic device 100 may include: processor 110, memory 120, display 130, camera 140.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural-Network Processor (NPU), etc. The different processing units may be separate devices or may be integrated in one or more processors.
In some embodiments, a memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it may be called directly from memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
Memory 120 may include one or more random access memories (random access memory, RAM) and one or more non-volatile memories (NVM). Random access memory may include static random-access memory (SRAM), dynamic random-access memory (dynamic random access memory, DRAM), synchronous dynamic random-access memory (synchronous dynamic random access memory, SDRAM), double data rate synchronous dynamic random-access memory (double data rate synchronous dynamic random access memory, DDR SDRAM), etc., such as fifth generation DDR SDRAM is commonly referred to as DDR5 SDRAM; the nonvolatile memory may include a disk storage device and a flash memory (flash memory).
The memory 120 may have instructions stored thereon that can be executed on the processor 110 to cause the electronic device to perform the methods described in the method embodiments described below.
The display screen 130 is used to display images, videos, operation pages, and the like. The display 130 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), miniled, micrOLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, electronic device 100 may include 1 or N display screens 130, N being a positive integer greater than 1.
The camera 140 is used to capture images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element, or image sensor, may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal and transmits the converted electrical signal to the processor 110 so that the processor 110 can process the electrical signal. In some embodiments, the electronic device 100 may include 1 or N cameras 140, N being a positive integer greater than 1.
In one possible embodiment, the electronic device 100 may implement functions of scanning two-dimensional codes, scanning documents, and the like through the camera 140.
For example, referring to fig. 2, fig. 2 shows that when the electronic device 100 recognizes the two-dimensional code through the camera 140, the two-dimensional code scanned by the camera 140 is shown as 201 in fig. 2 because the distance between the two-dimensional code and the electronic device 100 is too long, and at this time, the two-dimensional code image is too small, and the electronic device 100 cannot recognize the two-dimensional code. The electronic device 100 amplifies the two-dimensional code image by using the image amplifying method provided by the application to obtain an image marked as 202 in fig. 2, where the amplified two-dimensional code image is enough to be recognized by the electronic device 100.
Referring to fig. 3, fig. 3 is a schematic software structure of an electronic device according to the present application. The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages. As shown in fig. 3, the application package may include applications (also referred to as applications) such as cameras, gallery, calendar, phone calls, maps, navigation, WLAN, bluetooth, music, video, short messages, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions. As shown in FIG. 3, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like. Wherein the window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like. The content provider is used to store and retrieve data and make such data accessible to applications. Such data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc. The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture. The telephony manager is used to provide the communication functions of the electronic device 100. Such as the management of call status (including on, hung-up, etc.). The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like. The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification presented in the form of a chart or scroll bar text in the system top status bar, such as a notification of a background running application, or a notification presented on a screen in the form of a dialog interface. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android runtimes include core libraries and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), two-dimensional graphics engines (e.g., SGL), etc. The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications. Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio video encoding formats, such as: MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc. The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like. The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
An image enlarging method provided in the embodiments of the present application is described in further detail below.
Referring to fig. 4, fig. 4 is a flowchart of an image zooming method according to an embodiment of the present application, and the method includes steps 401 to 404. The method shown in fig. 4 may be performed by an electronic device, or a chip in an electronic device. The following description will take an electronic device as an example of an execution subject of the method. Wherein:
401. and receiving a first initial magnification factor which is sent by the application program and used for amplifying the image.
The application programs comprise application programs of the electronic device and third-party application programs downloaded from an application market. The first initial magnification may be used to instruct a camera in the electronic device to zoom in on the image. The image may be a two-dimensional code, text, or the like, and is not limited thereto.
Taking the system of the electronic device as an android system as an example, the working flow of the camera of the electronic device is further explained. For a camera in an android device, it generally includes three layers: an application layer, a camera architecture layer, and a camera hardware abstraction layer. The application layer can operate and transmit data to the camera service of the camera architecture layer through the universal interface of the camera application provided by the android, and the camera architecture layer comprises the camera service which is used for accepting interaction between the application layer and the camera hardware abstraction layer. The camera hardware abstraction layer is an interface layer between the kernel and the camera circuitry.
For example, when an application in an electronic device needs to use a camera of the electronic device, the application opens camera hardware by invoking a corresponding interface to inform a camera service to a camera hardware abstraction layer. After the camera is successfully turned on, the camera service will continually send a capture request to the camera hardware abstraction layer, which can inform the camera hardware to obtain the relevant configuration, which is typically set by the application. The relevant configuration includes: automatic exposure settings, automatic focus settings, automatic white balance settings, and the like.
In one possible embodiment, when the application program needs to scan using the camera of the electronic device, a capture request sent by the application program is received, where the capture request includes a first initial magnification and an associated configuration sent by the application program for magnifying the image.
402. A capture distance is determined, the capture distance being a distance between the electronic device and a capture object in the image.
In one possible embodiment, the capture distance is determined, in particular: acquiring an automatic focus value (AFcode); based on the auto-focus value, a capture distance is determined.
Optionally, the method of determining the capturing distance may be a laser focusing determination method, where the laser focusing determination method mainly includes that after infrared rays are sent to the image by the electronic device, the image is reflected back to the electronic device, and the electronic device calculates the distance between the electronic device and the image according to the time difference of receiving the infrared rays. It should be noted that the above-mentioned laser focusing determination method is merely an example, and the capturing distance determination method may also be other manners, which are not limited herein.
Optionally, the algorithm for obtaining the auto-focus value may be as follows:
wherein pCamera3CaptureResult- > prsultmetadata represents the processed photo parameter information set sent to the application, such as exposure time, camera motor status, etc. The ANDROID_LENS_FOCUS_DISANCE represents a FOCUS DISTANCE parameter information identification number, the ANDROID_LENS_STATE represents a camera motor STATE parameter information identification number, the DISTANCE represents a memory address storing FOCUS DISTANCE information obtained from a photo parameter information set, the m_lastFocus DISTANCE is a capture DISTANCE to be finally obtained and stored, the STATE represents a memory address storing camera motor STATE information obtained from the photo parameter information set, and the g_lastAFState is camera motor STATE information to be finally obtained and stored.
In one possible embodiment, the capture distance is determined, in particular: determining a target preset magnification interval in which the first initial magnification is located from a plurality of preset magnification intervals; if the target preset magnification interval is not a first preset magnification interval in the preset magnification intervals, determining a capturing distance, wherein the first preset magnification interval is the largest interval in the preset magnification intervals; the method further comprises the steps of: and if the target preset magnification interval is the first preset magnification interval, amplifying the image based on the first initial magnification.
The multiple preset amplification factor intervals are multiple intervals divided according to different amplification factors, and if the multiple preset amplification factor intervals are: 1x-2x preset magnification interval, 2x-3x preset magnification interval, 3x-4x preset magnification interval, and more than 4x preset magnification interval. 1x in the above represents one time, 2x represents two times, 3x and 4x are identically represented by 3 times and 4 times, and the representation is used later to represent a multiple for convenience of description. The target preset magnification interval is an interval in which the first initial magnification is located, for example, four intervals in the example, the first initial magnification is 2.5x, the first initial magnification is located in an interval of 2x-3x preset magnification, and the interval of 2x-3x preset magnification is the target preset magnification interval. The first preset magnification interval is the interval with the largest magnification among the preset magnification intervals, such as four intervals in the example, and the first preset magnification interval is the preset magnification interval of more than 4 x.
Because the first preset magnification interval is the maximum interval, when the first initial magnification is located in the first preset magnification interval, the image is directly magnified according to the first initial magnification without calculating the first target magnification, and the power consumption is saved.
403. A first target magnification is determined based on the first initial magnification and the capture distance.
In a possible embodiment, the first target magnification is determined based on the first initial magnification and the capture distance, in particular: determining a target preset distance interval in which the capturing distance is located from a plurality of preset distance intervals; and determining the first target magnification based on the target preset magnification interval, the target preset distance interval and the first initial magnification.
The preset distance intervals are a plurality of intervals divided according to different distances, and if the preset distance intervals are: a preset distance interval of 0-30 cm, a preset distance interval of 30 cm-1 m and a preset example interval of more than 1 m. The target preset distance interval is an interval in which the capturing distance is located, for example, three intervals in the above example, the capturing distance is 25 cm, the capturing distance is located in a preset distance interval of 0-30 cm, and the preset distance interval of 0-30 cm is the target preset distance interval.
Based on this approach, the first target magnification can be determined more accurately.
In one possible embodiment, determining the first target magnification based on the target preset magnification interval, the target preset distance interval, the first initial magnification comprises: if the target preset magnification interval is a second preset magnification interval, and the target preset distance interval is any one of a first preset distance interval and a second preset distance interval, determining the first initial magnification as the first target magnification, wherein the second preset magnification interval is a second large interval in a plurality of preset magnification intervals, the first preset distance interval is a smallest interval in the plurality of preset distance intervals, and the second preset distance interval is a second small interval in the plurality of preset distance intervals; if the target preset magnification interval is a second preset magnification interval and the target preset distance interval is not any one of the first preset distance interval and the second preset distance interval, determining a first target magnification based on the target parameter set and the first initial magnification; if the target preset magnification interval is smaller than the second preset magnification interval and the target preset distance interval is the first preset distance interval, determining the first initial magnification as the first target magnification; if the target preset magnification interval is smaller than the second preset magnification interval and the target preset distance interval is not the first preset distance interval, determining a first target magnification based on the target parameter set and the first initial magnification; the target parameter sets corresponding to the preset magnification interval and the preset distance interval of different combinations are different.
The first preset distance interval is the smallest interval in the preset distance intervals, and the second preset distance interval is the second small interval in the preset distance intervals. For example, the plurality of preset distance intervals are: the device comprises a preset distance interval of 0 cm-30 cm, a preset distance interval of 30 cm-1 m, a preset distance interval of more than 1 m and a preset distance interval of less than 0 cm, wherein the first preset distance interval is a preset distance interval of less than 0 cm, and the second preset distance interval is a preset distance interval of 0 cm-30 cm. When the capturing distance is within the first preset distance range, it is determined that the capturing distance is within the first preset distance range, because the capturing distance is not represented as a negative number and the capturing distance is not determined as an abnormal value so that the capturing distance is not broken down by the abnormal value.
The second preset magnification interval is a maximum interval except the first preset magnification interval, for example, the plurality of preset magnification intervals are: 1x-2x preset magnification interval, 2x-3x preset magnification interval, 3x-4x preset magnification interval and more than 4x preset magnification interval, wherein the first preset magnification interval is more than 4x preset magnification interval, and the second preset magnification interval is 3x-4x preset magnification interval.
The target parameter sets are preset parameter sets, and the target parameter sets corresponding to the preset magnification intervals and the preset distance intervals of different combinations are different.
Illustratively, the plurality of preset magnification intervals are: 1x-2x preset magnification interval, 2x-3x preset magnification interval, 3x-4x preset magnification interval, and more than 4x preset magnification interval. The first preset magnification interval is greater than 4x preset magnification interval. The second preset magnification interval is a 3x-4x preset magnification interval, and the 2x-3x preset magnification interval and the 1x-2x preset magnification interval are two intervals smaller than the second preset magnification interval. The plurality of preset distance intervals are as follows: the device comprises a preset distance interval of 0 cm-30 cm, a preset distance interval of 30 cm-1 m, a preset distance interval of more than 1 m and a preset distance interval of less than 0 cm, wherein the preset distance interval of less than 0 cm is a first preset example interval, and the preset distance interval of 30 cm-1 m is a second preset example interval. The target parameter sets corresponding to each preset magnification interval and each preset distance interval are as follows:
when the target preset magnification interval is 1x-2x preset magnification interval, if the target preset distance interval is 0 cm-30 cm preset distance interval, the first target magnification is as follows: a first initial magnification +0.2f; if the target preset distance interval is 30 cm-1 m preset distance interval, the first target magnification is as follows: first initial magnification 1.25; if the target preset distance interval is greater than 1 meter preset distance interval, the first target magnification is as follows: first initial magnification 1.5; if the target preset distance interval is smaller than 0 cm, the first target magnification is a first initial magnification.
When the target preset magnification interval is 2x-3x preset magnification interval, if the target preset distance interval is 0 cm-30 cm preset distance interval, the first target magnification is as follows: (first initial magnification-2.0) 0.8+2.2f; if the target preset distance interval is 30 cm-1 m preset distance interval, the first target magnification is as follows: (first initial magnification-2.0) +2.5f; if the target preset distance interval is greater than 1 meter preset distance interval, the first target magnification is as follows: (first initial magnification-2.0) ×0.75+3.0f; if the target preset distance interval is smaller than 0 cm, the first target magnification is a first initial magnification.
When the target preset magnification interval is 3x-4x preset magnification interval, if the target preset distance interval is 0 cm-30 cm preset distance interval, the first target magnification is as follows: first initial magnification. If the target preset distance interval is 30 cm-1 m preset distance interval, the first target magnification is as follows: (first initial magnification-3.0) 0.5f+3.5f; if the target preset distance interval is greater than 1 meter preset distance interval, the first target magnification is as follows: (first initial magnification-3.0) 0.25f+3.75f; if the target preset distance interval is smaller than 0 cm, the first target magnification is a first initial magnification.
As can be seen from fig. 5, when the first initial magnification is the same, the farther the capturing distance is, the larger the corresponding first target magnification is, so that the image can be more efficiently amplified, and the scanning efficiency is improved.
Aiming at different target preset magnification intervals and target preset distance intervals, the rule for determining the first target magnification is different, so that the first target magnification can be determined more accurately.
In one possible embodiment, the algorithm for determining the first target magnification based on the target preset magnification interval, the target preset distance interval, and the first initial magnification may be as follows:
/>
wherein oriZoomRatio represents a first initial magnification, m_targetSoanZoomRatio represents a first target magnification, m_lastFocus distance represents a capture distance, g_lastAFState represents a motor state that represents a camera completed focusing when 1 time, and a camera completed focusing when 0 time.
404. The image is magnified based on the first target magnification.
In a possible embodiment, the image is magnified based on the first target magnification, in particular: determining a first amplification step length based on a first target amplification factor, a first initial amplification factor and a preset amplification frequency, wherein the first amplification step length is a difference value between two adjacent amplification factors; and performing smooth amplification processing on the image based on the first amplification step.
Wherein the first amplification step is a parameter that needs to be added for each frame iteration. For example, at a first frame iteration, the first initial magnification is added to the first magnification step to obtain a magnification corresponding to the first frame.
Based on this approach, stepwise enlargement of the image can be achieved.
In one possible embodiment, the formula for determining the first amplification step based on the first target amplification factor, the first initial amplification factor, and the preset number of amplification times is: first amplification step= (first target magnification-first initial magnification)/preset number of amplification times.
For example, the first initial magnification is 2x, by determining the first target magnification in step 403, the first target magnification is 3x, the preset magnification is 5, and according to the above formula for determining the first magnification step, the first magnification step is (3 x-2 x)/5=0.2.
In a possible embodiment, the first amplification step is determined based on the first target amplification factor, the first initial amplification factor and the preset number of amplification times, specifically: if the difference between the first target magnification and the first initial magnification meets a first condition, determining a first amplification step length based on the first target magnification, the first initial magnification and a preset amplification frequency; the method further comprises the steps of: if the difference between the first target magnification and the first initial magnification does not meet the first condition, the image is magnified to the first target magnification through one magnification treatment.
The first amplification step is used for performing a smooth amplification process so that the amplification process is not too abrupt, especially for times that require amplification to be large. However, when the magnification is small, the efficiency of the amplification is reduced by performing the smoothing amplification treatment, so when the magnification is small, the amplification is performed directly. The first condition is used for judging whether the amplification factor is larger or smaller, and if the difference between the first target amplification factor and the first initial amplification factor meets the first condition, the amplification factor at the moment is considered to be larger, and subsequent smooth amplification treatment is needed; if the difference between the first target magnification and the first initial magnification does not meet the first condition, the magnification is considered to be smaller at the moment, and the direct magnification is needed. Wherein the first condition may be an interval.
In one possible embodiment, the algorithm for determining whether the smoothing amplification process is required is as follows:
in the above algorithm, m_targetscanzoom ratio represents a first target magnification, m_currscanzoom ratio represents a first initial magnification, m_zoomtype represents whether a smooth amplification process is required, and when m_zoomtype is 1, the smooth amplification process is required at this time, that is, a first amplification step needs to be determined; when m_zomtype is 0, the image is directly amplified to the first target magnification without performing smooth amplification processing, that is, without determining the first amplification step.
In one possible embodiment, if the first target magnification is greater than the first threshold and less than the second threshold, the first target magnification is updated to the second threshold and the image is magnified to the first target magnification by a single magnification process.
The first threshold and the second threshold are preset thresholds, when the first target magnification is larger than the first threshold and smaller than the second threshold, the first target magnification is smaller and smooth magnification is not performed, so that the magnification efficiency is improved, the first target magnification is updated to be the second threshold, and the image is directly magnified to the first target magnification.
Illustratively, the first threshold is 0.9x, the second threshold is 1.2x, and the first target magnification is 1.1x, where the first target magnification is greater than the first threshold and less than the second threshold. The first target magnification is updated to 1.2x and the image is magnified to 1.2x.
In one possible embodiment, the algorithm for updating the second threshold is as follows:
if(0.9<m_targetScanZoomRatio&&m_targetScanZoomRatio<1.2){
m_zoomType=0;
m_targetScanZoomRatio=1.2
}
wherein, 0.9 is a first threshold, 1.2 is a second threshold, m_targetscanzoom ratio is a first target magnification, m_zoomtype represents whether smooth amplification is needed, and when m_zoomtype is 0, it means that smooth amplification is not needed.
In one possible embodiment, the image is smoothly magnified based on the first magnification step, specifically: determining effective magnification corresponding to the ith frame based on the first magnification step length; and amplifying the image to the effective amplification factor corresponding to the ith frame, wherein i is an integer which is more than 0 and less than or equal to the preset amplification times.
For example, the above smoothing and amplifying process is further explained below with reference to fig. 6, where the two-dimensional code marked 601 in fig. 6 is an original image corresponding to the first frame, the two-dimensional code marked 602 in fig. 6 is an image corresponding to the second frame, the two-dimensional code marked 603 in fig. 6 is an image corresponding to the third frame, and the two-dimensional code marked 604 in fig. 6 is an image corresponding to the fourth frame. The preset amplification times are 3, the first amplification step length is 0.5, the first initial amplification factor is 2x, and the first target amplification factor is 3.5x. The effective magnification corresponding to the second frame is 2x+0.5=2.5x, and after the image 601 of the first frame is magnified to 2.5x, an image 602 of the second frame is obtained; the effective magnification corresponding to the third frame is 2.5x+0.5=3x, and after the image 601 of the first frame is magnified to 3.0x, an image 603 of the third frame is obtained. The effective magnification corresponding to the fourth frame is 3.0x+0.5=3.5 x, and the image 601 of the first frame is magnified to 3.5x, so as to obtain an image 604 of the fourth frame. Thus, the smooth magnification processing is completed, and the graph is magnified to the first target magnification.
In the smoothing amplification process, since the image needs to be captured for multiple times to obtain the image of multiple frames so as to achieve the purpose of dynamic amplification, the amplification of each frame needs to be completed based on relevant configuration, such as automatic exposure setting, automatic focusing setting, automatic white balance setting, and the like, so that the obtained relevant configuration needs to be stored in a configuration buffer area for each amplification during the smoothing amplification process.
In one possible embodiment, the algorithm for saving the relevant configuration is as follows:
/>
wherein, pMatadata is the related configuration described above.
Another embodiment provided in the present application is explained below with reference to fig. 7, and the execution body under this embodiment is an electronic device. As shown in fig. 7, this embodiment includes steps 701-709, wherein:
701. and receiving a first initial magnification factor which is sent by the application program and used for amplifying the image.
702. A capture distance is determined, the capture distance being a distance between the electronic device and a capture object in the image.
703. A first target magnification is determined based on the first initial magnification and the capture distance.
704. And determining a first amplification step length based on the first target amplification factor, the first initial amplification factor and the preset amplification times, wherein the first amplification step length is the difference between the adjacent amplification factors.
705. And performing smooth amplification processing on the image based on the first amplification step.
The steps 701 to 705 may be referred to the descriptions of the steps 401 to 404, and are not described herein.
706. And receiving a second initial magnification factor which is sent by the application program and is used for amplifying the image in the process of carrying out smooth amplification processing on the image based on the first amplification step length.
The first amplifying step and the smoothing amplifying process can be referred to the description in step 404, and are not described herein. The second initial magnification is a different value than the first initial magnification, and the second initial magnification may be greater than the first initial magnification or less than the first initial magnification.
Illustratively, as further explained below in connection with fig. 6, when the original image 601 is smoothly magnified based on the first magnification step, if the second initial magnification is received while being magnified to the image 603 corresponding to the third frame, the image 604 corresponding to the fourth frame is not magnified based on the first magnification step.
707. A second target magnification is determined based on the second initial magnification and the capture distance.
The principle of determining the second target magnification based on the second initial magnification and the capturing distance is the same as that of determining the first target magnification based on the first initial magnification and the capturing distance in step 403, and will not be described herein.
708. And determining a second amplification step length based on the second target amplification factor, the current amplification factor of the image and the preset amplification times, wherein the second amplification step length is the difference between the adjacent amplification factors.
The second amplification step may be the same as the first amplification step or may be different from the first amplification step. The second amplification step is a parameter that needs to be added for each frame iteration. The current magnification of the image is the magnification of the image by the current frame, for example, the image is magnified by 2.4x in the 6 th frame, before the magnification of the 7 th frame is started, the second initial magnification parameter is received, the second magnification step length needs to be calculated, and at this time, the effective 2.4x of the 6 th frame is the current magnification of the image. And the magnification of the 7 th frame is the magnification of the 6 th frame added to the second magnification step.
In one possible embodiment, the formula for determining the second magnification step based on the second target magnification, the current magnification of the image, and the preset number of magnifications is: second magnification step= (second target magnification-current magnification of image)/preset magnification times.
For example, when the image is smoothly magnified based on the first target magnification to the 3 rd frame, the image is magnified by 2.4x, the second initial magnification parameter is received, the second target magnification is obtained to be 3.5x based on the second initial magnification, the preset magnification number is 5, and at this time, the second magnification step= (3.5 x-2.4 x)/5=0.2.
In one possible embodiment, determining the second magnification step based on the second target magnification, the current magnification of the image, and the preset number of magnifications includes: if the second target magnification is larger than the current magnification of the image, determining a second magnification step length based on the second target magnification, the current magnification of the image and the preset magnification times; the method further comprises the steps of: and if the second target magnification is smaller than the current magnification of the image, updating the second target magnification to the current magnification of the image.
The second amplification step is used for performing a smooth amplification process so that the amplification process is not too abrupt, especially for times that require amplification to be large. However, if the second target magnification is smaller than the current magnification of the image, the second target magnification is directly updated to the current magnification of the image, thereby ensuring the efficiency of the magnification. If the second target magnification is equal to the current magnification of the image, the second target magnification is updated to the current magnification of the image.
The second target magnification is 3.5x, the current magnification of the image is 3x, and the preset magnification is 5. At this time, the second target magnification (3.5 x) is larger than the current magnification (3 x) of the image, and the second magnification step is calculated as (3.5 x-3 x)/5=0.1.
The second target magnification is 2.8x, the current magnification of the image is 3x, and the preset magnification is 5. At this time, the second target magnification (2.8 x) is smaller than the current magnification (3 x) of the image, and the second target magnification is updated from 2.8x to 3x. After the update, since the image has been enlarged to the second target magnification, the enlargement of the image is stopped, and the enlargement of the image based on the second target magnification is completed.
In one possible embodiment, if the second target magnification is greater than the current magnification of the image, determining the second magnification step based on the second target magnification, the current magnification of the image, and the preset magnification times is specifically: if the second target magnification is larger than the current magnification of the image and the difference between the second target magnification and the current magnification of the image meets the first condition, determining a second amplification step based on the second target magnification, the current magnification of the image and the preset amplification times. The method further comprises the steps of: if the second target magnification is larger than the current magnification of the image and the difference between the second target magnification and the current magnification of the image does not meet the first condition, the image is magnified to the second target magnification through one-time magnification treatment.
The first condition may be referred to the description in step 404, and will not be described herein.
In one possible embodiment, the algorithm for determining whether the second step size needs to be determined is as follows:
in the above algorithm, m_targetscanzoom ratio represents a second target magnification, m_currscanzoom ratio represents a current magnification of the image, m_zomtype represents whether smoothing amplification is needed, and when m_zomtype is 1, the smoothing amplification is needed at this time, that is, a second amplification step needs to be determined; when m_zomtype is 0, the smooth amplification process is not needed, that is, the second amplification step is not needed to be determined, and the image is directly amplified to the second target amplification factor.
709. And performing smooth amplification processing on the image based on the second amplification step.
And performing smooth amplification processing on the image based on the second amplification step length so as to amplify the image to a second target amplification factor. The smoothing amplification process may be described in step 404, and is not described herein.
It should be noted that, the number of initial amplification factors received subsequently is not limited, and the third initial amplification factor, the fourth initial amplification factor, and the like can be received subsequently. In the process of the smooth amplification, the processing manner of receiving the new initial amplification factor is the same as described above, and a detailed description is omitted here.
The above embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (9)

1. An image magnification method, wherein the method is applied to an electronic device, the method comprising:
receiving a first initial magnification factor which is sent by an application program and used for amplifying an image;
determining a capture distance, the capture distance being a distance between the electronic device and a capture object in the image;
determining a target preset distance interval in which the capturing distance is located from a plurality of preset distance intervals;
if the target preset amplification factor interval is a second preset amplification factor interval, and the target preset distance interval is any one of a first preset distance interval and a second preset distance interval, determining the first initial amplification factor as a first target amplification factor, wherein the second preset amplification factor interval is a second large interval in the preset amplification factor intervals, the first preset distance interval is a smallest interval in the preset distance intervals, the second preset distance interval is a second small interval in the preset distance intervals, and the target preset amplification factor interval is an amplification factor interval in which the first initial amplification factor is located;
If the target preset magnification interval is the second preset magnification interval and the target preset distance interval is not any one of the first preset distance interval and the second preset distance interval, determining a first target magnification based on a target parameter set and the first initial magnification, wherein the preset magnification intervals and the target parameter sets corresponding to the preset distance intervals of different combinations are different;
if the target preset magnification interval is smaller than the second preset magnification interval and the target preset distance interval is the first preset distance interval, determining the first initial magnification as a first target magnification;
if the target preset magnification interval is smaller than the second preset magnification interval and the target preset distance interval is not the first preset distance interval, determining a first target magnification based on the target parameter set and the first initial magnification;
the image is magnified based on the first target magnification.
2. The method of claim 1, wherein the determining the capture distance comprises:
Determining a target preset magnification interval in which the first initial magnification is located from a plurality of preset magnification intervals;
if the target preset magnification interval is not a first preset magnification interval in the preset magnification intervals, determining a capturing distance, wherein the first preset magnification interval is the largest interval in the preset magnification intervals;
the method further comprises the steps of: and if the target preset magnification interval is the first preset magnification interval, amplifying the image based on the first initial magnification.
3. The method of claim 1, wherein the magnifying the image based on the first target magnification comprises:
determining a first amplification step length based on the first target amplification factor, the first initial amplification factor and a preset amplification frequency, wherein the first amplification step length is a difference value between two adjacent amplification factors;
and carrying out smooth amplification processing on the image based on the first amplification step length.
4. The method of claim 3, wherein the determining a first magnification step based on the first target magnification, the first initial magnification, and a preset number of magnifications comprises:
If the difference between the first target magnification and the first initial magnification meets a first condition, determining a first amplification step length based on the first target magnification, the first initial magnification and a preset amplification frequency;
the method further comprises the steps of:
and if the difference between the first target magnification and the first initial magnification does not meet a first condition, amplifying the image to the first target magnification through one-time amplification processing.
5. The method according to claim 4, wherein the method further comprises:
if the first target magnification is larger than a first threshold and smaller than a second threshold, updating the first target magnification to the second threshold, and amplifying the image to the first target magnification through one amplification treatment.
6. The method according to any one of claims 3 to 5, further comprising:
receiving a second initial magnification factor which is sent by the application program and is used for amplifying the image in the process of carrying out smooth amplification processing on the image based on the first amplification step length;
Determining a second target magnification based on the second initial magnification and the capture distance;
determining a second amplification step length based on the second target amplification factor, the current amplification factor of the image and the preset amplification times, wherein the second amplification step length is a difference value between two adjacent amplification factors;
and carrying out smooth amplification processing on the image based on the second amplification step length.
7. The method of claim 6, wherein the determining a second magnification step based on the second target magnification, the current magnification of the image, and the preset number of magnifications comprises:
if the second target magnification is larger than the current magnification of the image, determining a second magnification step based on the second target magnification, the current magnification of the image and the preset magnification times;
the method further comprises the steps of:
and if the second target magnification is smaller than the current magnification of the image, updating the second target magnification to be the current magnification of the image.
8. An electronic device comprising a transceiver, a processor and a memory, the memory for storing a computer program, the processor invoking the computer program for performing the method of any of claims 1-7.
9. A computer readable storage medium comprising computer instructions which, when run on a computer, cause the computer to perform the method of any of claims 1-7.
CN202211097599.6A 2022-09-08 2022-09-08 Image amplification method and electronic equipment Active CN116703718B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211097599.6A CN116703718B (en) 2022-09-08 2022-09-08 Image amplification method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211097599.6A CN116703718B (en) 2022-09-08 2022-09-08 Image amplification method and electronic equipment

Publications (2)

Publication Number Publication Date
CN116703718A CN116703718A (en) 2023-09-05
CN116703718B true CN116703718B (en) 2024-03-22

Family

ID=87843952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211097599.6A Active CN116703718B (en) 2022-09-08 2022-09-08 Image amplification method and electronic equipment

Country Status (1)

Country Link
CN (1) CN116703718B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102833486A (en) * 2012-07-05 2012-12-19 深圳泰山在线科技有限公司 Method and device for real-time adjusting face display scale in video image
CN107633398A (en) * 2017-08-24 2018-01-26 阿里巴巴集团控股有限公司 Method for displaying image and device and electronic equipment
CN108134903A (en) * 2017-12-25 2018-06-08 广东欧珀移动通信有限公司 Image pickup method and Related product
CN109145676A (en) * 2018-07-27 2019-01-04 华勤通讯技术有限公司 The recognition methods of subway gate barcode scanning and mobile terminal
CN109214225A (en) * 2018-07-04 2019-01-15 青岛海信移动通信技术股份有限公司 A kind of scan method, device, mobile terminal and the storage medium of figure bar code
KR20190021153A (en) * 2017-08-22 2019-03-05 삼성전자주식회사 Electronic device providing switching between signals output from concurrently operable image sensors
CN110248081A (en) * 2018-10-12 2019-09-17 华为技术有限公司 Image capture method and electronic equipment
CN110363709A (en) * 2019-07-23 2019-10-22 腾讯科技(深圳)有限公司 A kind of image processing method, image presentation method, model training method and device
WO2021036906A1 (en) * 2019-08-27 2021-03-04 华为技术有限公司 Picture processing method and apparatus
WO2021104227A1 (en) * 2019-11-28 2021-06-03 维沃移动通信有限公司 Photographing method and electronic device
CN113238700A (en) * 2021-06-03 2021-08-10 艾视雅健康科技(苏州)有限公司 Head-mounted electronic auxiliary vision equipment and automatic image amplification method thereof
CN113473010A (en) * 2021-06-29 2021-10-01 浙江大华技术股份有限公司 Snapshot method and device, storage medium and electronic device
CN113643024A (en) * 2021-07-06 2021-11-12 阿里巴巴新加坡控股有限公司 Graphic code processing method and device and electronic equipment
CN114095644A (en) * 2020-08-24 2022-02-25 武汉Tcl集团工业研究院有限公司 Image correction method and computer equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100689384B1 (en) * 2005-03-21 2007-03-02 삼성전자주식회사 Mobile communication terminal having camera function and method thereof
TWI468772B (en) * 2013-05-27 2015-01-11 Hon Hai Prec Ind Co Ltd Device and method for taking photographs
CN106778440B (en) * 2016-12-21 2020-04-21 腾讯科技(深圳)有限公司 Two-dimensional code identification method and device
KR102043357B1 (en) * 2017-10-18 2019-11-12 오스템임플란트 주식회사 A method for changing a scale of an image and an apparatus for the same
CN110944114B (en) * 2019-11-28 2021-06-08 维沃移动通信有限公司 Photographing method and electronic equipment

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102833486A (en) * 2012-07-05 2012-12-19 深圳泰山在线科技有限公司 Method and device for real-time adjusting face display scale in video image
KR20190021153A (en) * 2017-08-22 2019-03-05 삼성전자주식회사 Electronic device providing switching between signals output from concurrently operable image sensors
CN107633398A (en) * 2017-08-24 2018-01-26 阿里巴巴集团控股有限公司 Method for displaying image and device and electronic equipment
CN108134903A (en) * 2017-12-25 2018-06-08 广东欧珀移动通信有限公司 Image pickup method and Related product
CN109214225A (en) * 2018-07-04 2019-01-15 青岛海信移动通信技术股份有限公司 A kind of scan method, device, mobile terminal and the storage medium of figure bar code
CN109145676A (en) * 2018-07-27 2019-01-04 华勤通讯技术有限公司 The recognition methods of subway gate barcode scanning and mobile terminal
CN110248081A (en) * 2018-10-12 2019-09-17 华为技术有限公司 Image capture method and electronic equipment
CN110363709A (en) * 2019-07-23 2019-10-22 腾讯科技(深圳)有限公司 A kind of image processing method, image presentation method, model training method and device
WO2021036906A1 (en) * 2019-08-27 2021-03-04 华为技术有限公司 Picture processing method and apparatus
WO2021104227A1 (en) * 2019-11-28 2021-06-03 维沃移动通信有限公司 Photographing method and electronic device
CN114095644A (en) * 2020-08-24 2022-02-25 武汉Tcl集团工业研究院有限公司 Image correction method and computer equipment
CN113238700A (en) * 2021-06-03 2021-08-10 艾视雅健康科技(苏州)有限公司 Head-mounted electronic auxiliary vision equipment and automatic image amplification method thereof
CN113473010A (en) * 2021-06-29 2021-10-01 浙江大华技术股份有限公司 Snapshot method and device, storage medium and electronic device
CN113643024A (en) * 2021-07-06 2021-11-12 阿里巴巴新加坡控股有限公司 Graphic code processing method and device and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种实现数字图象二倍放大的方法及其程序;张小星;;西安工业大学学报(第Z1期);16-2016-20 *
基于VFW的CCD图像捕捉技术研究;左宁;高慧莹;;电子工业专用设备(第06期);64-68 *

Also Published As

Publication number Publication date
CN116703718A (en) 2023-09-05

Similar Documents

Publication Publication Date Title
US11348201B2 (en) Electronic device having rollable display and method of controlling the same
JP2023501663A (en) Filming method and electronic device
US20230110064A1 (en) Data sharing method, graphical user interface, electronic device, and system
US20220269720A1 (en) Image Display Method and Electronic Device
US20160037067A1 (en) Method for generating image and electronic device thereof
WO2021147482A1 (en) Telephoto photographing method and electronic device
US11914850B2 (en) User profile picture generation method and electronic device
WO2021244295A1 (en) Method and device for recording video
KR20220082926A (en) Video shooting method and electronic device
WO2017173585A1 (en) Photographing method and terminal
WO2021185232A1 (en) Barcode identification method, and related device
CN116703718B (en) Image amplification method and electronic equipment
CN115640083A (en) Screen refreshing method and equipment capable of improving dynamic performance
CN115442517B (en) Image processing method, electronic device, and computer-readable storage medium
CN108124098B (en) Electronic device and method for auto-focusing
US20230014272A1 (en) Image processing method and apparatus
CN116708958A (en) Motor control method and electronic equipment
CN112311985B (en) Multi-shooting processing method and device and storage medium
CN115225822B (en) Data processing method and electronic equipment
CN116204254A (en) Annotating page generation method, electronic equipment and storage medium
CN116306733B (en) Method for amplifying two-dimensional code and electronic equipment
CN116055871B (en) Video processing method and related equipment thereof
WO2023160230A1 (en) Photographing method and related device
WO2024051684A1 (en) Voltage adjustment method and related apparatus
WO2022206600A1 (en) Screen projection method and system, and related apparatus

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