CN110049234B - Imaging method, mobile terminal and storage medium - Google Patents

Imaging method, mobile terminal and storage medium Download PDF

Info

Publication number
CN110049234B
CN110049234B CN201910164680.3A CN201910164680A CN110049234B CN 110049234 B CN110049234 B CN 110049234B CN 201910164680 A CN201910164680 A CN 201910164680A CN 110049234 B CN110049234 B CN 110049234B
Authority
CN
China
Prior art keywords
imaging
focal length
shot
shot object
acquiring
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
CN201910164680.3A
Other languages
Chinese (zh)
Other versions
CN110049234A (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.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201910164680.3A priority Critical patent/CN110049234B/en
Publication of CN110049234A publication Critical patent/CN110049234A/en
Application granted granted Critical
Publication of CN110049234B publication Critical patent/CN110049234B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Studio Devices (AREA)

Abstract

The invention discloses an imaging method, which is applied to a mobile terminal and comprises the following steps: imaging a shot object and acquiring a current focal length; acquiring an imaging ratio of the shot object during imaging according to the focal length and a first object distance corresponding to the shot object; judging whether the imaging size of the shot object changes or not; if yes, acquiring a second distance corresponding to the shot object; adjusting the focal length according to the second object distance and the imaging ratio; and imaging the shot object according to the adjusted focal length. In addition, the invention also provides a terminal device and a storage medium, and by applying the embodiment of the invention, the problem that the change of the imaging size influences the watching in the prior art, so that the user experience is poor is solved, and the user experience is improved.

Description

Imaging method, mobile terminal and storage medium
Technical Field
The present invention relates to the field of mobile terminals, and in particular, to an imaging method, a mobile terminal, and a storage medium.
Background
The mobile terminal or called mobile communication terminal refers to a computer device which can be used in moving, and broadly includes a mobile phone, a notebook, a POS machine and even a vehicle-mounted computer, and the narrow mobile terminal refers to a mobile phone or a smart phone with multiple application functions, and a camera for acquiring images is installed in the mobile terminal and is used for acquiring viewfinding within the range of the mobile terminal.
When an object or a person in the viewing range of the camera moves, the object or the person in the viewing range may be far away from or close to the camera, and the size of the object or the person imaged in the viewing range may change. For example, in the case of a constant focal length, the size of the image becomes smaller when the person is far away from the camera, and the size of the image becomes larger when the person is close to the camera.
Therefore, in the conventional method, when a file or a person image is shot, the change of the imaging size caused by the change of the distance from a shot object affects the watching, so that the user experience is poor.
Disclosure of Invention
The invention mainly aims to provide an imaging method, a mobile terminal and a storage medium, and aims to solve the problem that in the prior art, the change of an imaging size influences watching to cause poor user experience.
In order to achieve the above object, the present invention provides an imaging method applied to a mobile terminal, the method including:
imaging a shot object and acquiring a current focal length;
acquiring an imaging ratio of the shot object during imaging according to the focal length and a first object distance corresponding to the shot object;
judging whether the imaging size of the shot object changes or not;
if yes, acquiring a second distance corresponding to the shot object;
adjusting the focal length according to the second object distance and the imaging ratio;
and imaging the shot object according to the adjusted focal length.
In a preferred embodiment of the present invention, the formula for obtaining the imaging ratio of the object is specifically expressed as:
k=f/(f-u)
wherein k is the imaging ratio, f is the focal length, and u is the first object distance.
In a preferred embodiment of the present invention, the step of determining whether or not the imaging size of the subject has changed includes:
judging whether the imaging ratio of the shot object changes or not;
if yes, determining that the imaging size of the shot object changes; otherwise, determining that the imaging size of the shot object is not changed.
In a preferred embodiment of the present invention, the adjusting the focal length according to the second object distance and the imaging ratio includes:
acquiring any one focal length value in the focal length adjusting process, and calculating the current imaging ratio of the shot object according to the any one focal length value and the second distance;
calculating a difference between a current imaging ratio and the imaging ratio;
judging whether the difference value is within a preset range;
if so, taking the focal length value as the adjusted focal length, otherwise, continuing to perform focal length adjustment until the difference value is within the preset range.
In a preferred embodiment of the present invention, before the step of imaging the object to be photographed and acquiring the current focal length, the method further includes:
acquiring a selection instruction sent by a user aiming at a target object;
and taking the target object corresponding to the selection instruction as the shot object.
In a preferred embodiment of the present invention, the step of obtaining the target object selection instruction of the user includes:
determining the current view-finding range of the camera;
receiving a sliding instruction of a user in the view finding range;
judging whether the sliding instruction is a closed area;
and if so, determining that the sliding instruction is a target object selection instruction.
In a preferred embodiment of the present invention, the method further comprises:
and identifying the object in the closed area, and taking the identified object as a target object.
In a preferred embodiment of the present invention, the step of identifying the object in the closed region and using the identified object as the target object includes:
identifying the objects in the closed area, and judging whether the identified objects are in at least two categories;
if yes, determining the category with the highest priority level in the at least two categories according to the preset priority level;
and taking the object corresponding to the category with the highest priority as the target object.
In addition, the invention also provides a mobile terminal, which comprises a processor and a memory connected with the processor through a communication bus; wherein the content of the first and second substances,
the memory is used for storing an imaging program;
the processor is configured to execute the imaging program to implement the steps of:
imaging a shot object and acquiring a current focal length;
acquiring an imaging ratio of the shot object according to the focal length and a first object distance corresponding to the shot object;
judging whether the imaging size of the shot object changes or not;
if yes, acquiring a second distance corresponding to the shot object;
adjusting the focal length according to the second object distance and the imaging ratio;
imaging the shot object according to the adjusted focal length;
and the steps of the imaging method of any one of the above.
To achieve the above object, the present invention proposes a storage medium storing one or more programs, the one or more programs being executable by one or more processors to cause the one or more processors to perform the steps of:
imaging a shot object and acquiring a current focal length;
acquiring an imaging ratio of the shot object according to the focal length and a first object distance corresponding to the shot object;
judging whether the imaging size of the shot object changes or not;
if yes, acquiring a second distance corresponding to the shot object;
adjusting the focal length according to the second object distance and the imaging ratio;
imaging the shot object according to the adjusted focal length;
and the steps of the imaging method of any one of the above.
Therefore, compared with the prior art, the imaging method, the mobile terminal and the storage medium provided by the invention have the advantages that the shot object is imaged, and the current focal length is obtained; then, acquiring the imaging ratio of the shot object during imaging; in the shooting process, judging whether the imaging size of the shot object changes or not; if so, acquiring a second distance corresponding to the shot object after the shot object moves; adjusting the focal length again according to the second object distance and the imaging ratio; and imaging the moved shot object according to the adjusted focal length. After the imaging size of the object is changed, the focal length is adjusted in time according to the moved second object distance so as to keep the imaging ratio within a certain range, thereby ensuring the imaging effect. Therefore, the embodiment of the invention solves the problem that the change of the imaging size influences the watching in the prior art, which causes poor user experience, and improves the user experience.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of an optional mobile terminal in implementing various embodiments of the present invention;
FIG. 2 is a diagram of a wireless communication system for the mobile terminal shown in FIG. 1;
FIG. 3 is a schematic flow chart of an alternative imaging method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative application scenario of the imaging method according to the embodiment of the present invention;
fig. 5 is a schematic view of another alternative application scenario of the imaging method according to the embodiment of the present invention.
Reference numerals:
Figure BDA0001985905680000041
Figure BDA0001985905680000051
the objects, features and advantages of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000(Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex Long Term Evolution), and TDD-LTE (Time Division duplex Long Term Evolution).
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal receiving sound, an information receiving sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 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 volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving GateWay) 2034, a PGW (PDN GateWay) 2035, and a PCRF (Policy and Charging Rules Function) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and communication network system, the present invention provides various embodiments of the method.
In order to solve the problems in the prior art, embodiments of the present invention provide an imaging method, a mobile terminal, and a storage medium, and the following describes technical solutions of the present invention in detail with reference to the accompanying drawings and specific embodiments.
Fig. 3 is a schematic structural diagram of an optional implementation of the imaging method provided in the embodiment of the present invention, and as shown in fig. 3, the imaging method includes the following steps:
and S301, imaging the shot object and acquiring the current focal length.
It can be understood that the mobile terminal is provided with a camera, the mobile terminal comprises a front camera and a rear camera, and the rear camera can be a plurality of cameras in some products. When a user starts a camera on the mobile terminal, the mobile terminal acquires an image shooting instruction.
It should be noted that the focal length is a measure for measuring the light convergence or divergence in an optical system, and refers to the distance from the optical center of the lens to the focal point of the light convergence when parallel light is incident.
As will be appreciated by those skilled in the art, the focal length, i.e., the focal length, is the focal length. If the focal length f is 8-24mm, it means that the focal length of the camera is 8-24 mm.
For example, the mobile terminal turns on a photographing function on camera application software, the camera is turned on, the current viewing range of the camera is displayed on a display interface corresponding to the mobile terminal, the viewing range is displayed, and then the object to be photographed is included in the viewing range.
In the implementation manner of the embodiment of the invention, when the shooting instruction is received, the shot object is imaged, and the focal length corresponding to one camera is obtained during imaging, so that the focal length value corresponding to the current shooting can be obtained during shooting.
S302, acquiring an imaging ratio of the shot object during imaging according to the focal length and a first object distance corresponding to the shot object.
The size of the object after imaging is a ratio of the size of the object after imaging to the size before imaging, since the distance between the object and the camera and the focal length corresponding to the object when the object is imaged are included, the imaging ratio of the object is defined as the ratio of the size after imaging to the size before imaging.
In one implementation of the present invention, after the object is imaged, the height a 'B' of the image of the object and the actual height AB of the object are measured, and the imaging ratio k is obtained as: k is a 'B'/AB is v/u, where v is the image distance, u is the object distance, and v is the distance between the image and the plane mirror (or optical center of the lens).
It will be understood by those skilled in the art that the imaging ratio k can also be expressed as k ═ f/(f-u), where u is the object distance and f is the focal length corresponding to the current imaging ratio, according to the imaging principle of the object. The imaging ratio is always copy for the mobile terminal, and the imaging is an inverted real image.
Illustratively, the first object distance corresponding to the object is 5m, the image height a 'B' imaged by the object is 3cm, the actual height of the object is 10m, and then the imaging ratio k is 3cm/1m — 0.003, and f — 15 mm.
In an actual execution process, step S101 and step S102 may be executed simultaneously, or step S101 may be executed first and then step S102 may be executed, or step S102 may be executed first and then step S101 is executed, and the embodiment of the present invention is not limited in this respect.
S303, judging whether the imaging size of the shot object is changed, if so, executing S304.
As will be understood by those skilled in the art, in the case that the size of the object itself is not changed, it can be derived from the size of the object after imaging, and when the distance of the object changes, the corresponding imaging ratio changes, so that the size after imaging also changes. Therefore, the invention judges whether the object moves or not by judging whether the imaging size of the object changes or not, thereby improving the flexibility and reliability of judging the relative distance between the object and the camera.
Illustratively, when the image height a 'B' imaged by the object changes from 3cm to 2.5cm, the imaging size of the object to be shot changes.
In the embodiment of the invention, the mobile terminal uses the corresponding coordinates of the mobile terminal, for example, the whole display screen as a coordinate system, so that when an image is displayed, the imaging size of the shot object can be obtained according to the coordinate position of the shot object after imaging.
It should be noted that, according to the imaging ratio formula of the object to be photographed, when the relative distance between the object to be photographed and the camera changes, the object distance u changes, the size of the object to be photographed itself does not change, and the focal length does not change, the imaging ratio changes, and the imaging size viewed by the user through the display screen changes.
It can be understood that the size of the object to be photographed changes when the object distance of the object to be photographed does not change and the focal length changes. For example, when the user performs focus adjustment, the imaging size of the subject also changes.
And S304, acquiring a second distance corresponding to the shot object.
When the imaging size of the object to be photographed is changed, the size after imaging is obtained again from the coordinate position where the object to be photographed is located after imaging, and then the current imaging ratio is obtained according to the ratio of the changed imaging size to the actual size of the object to be photographed. According to the relationship between the imaging ratio and the focal length and the object distance, the current focal length of the mobile terminal can be known, so that the changed object distance, namely the second object distance, can be directly obtained.
Illustratively, when the image height a ' B ' imaged by the subject changes from 3cm to 2.5cm, the imaging ratio after the change is 0.025, and the focal length f is 15mm, the second object distance u ' after the change can be calculated to be 5.8m according to the formula of the imaging ratio, the object distance and the focal length.
S305, adjusting the focal length according to the second object distance and the imaging ratio.
In order to solve the problem that the imaging size is changed too much due to too large object moving distance in the prior art, and the user is uncomfortable to watch, the embodiment of the invention needs to ensure that the object to be shot is within a certain imaging ratio range in order to improve the watching comfort of the user.
In a specific implementation manner of the present invention, a method for ensuring that a photographed object is within a certain imaging ratio range includes: acquiring any one focal length value in the focal length adjusting process, and calculating the current imaging ratio of the shot object according to the any one focal length value and the second distance; calculating a difference between a current imaging ratio and the imaging ratio; judging whether the difference value is within a preset range; if so, taking the focal length value as the adjusted focal length, otherwise, continuing to perform focal length adjustment until the difference value is within the preset range.
And the focal length is readjusted according to the changed second distance until a new focal length value is found, so that the imaging ratio is in a preset range, the imaging size of the shot object is kept to be changed slightly, and the visual observation of a user is not influenced.
It is understood that the smaller the variation of the imaging ratio, the smaller the value interval of the preset range, and thus the smaller the variation of the imaging size, the more beneficial the visual experience of the user.
And S306, imaging the shot object according to the adjusted focal length.
It can be understood that, after the focal distance is adjusted, the mobile terminal continues to shoot the shot object according to the adjusted focal distance, which may cause the imaging size change in a short time not to be detected by the naked eye of the user, and the user always sees that the imaging size of the shot object is within a certain range.
Therefore, by applying the imaging method provided by the invention, the shot object is imaged, and the current focal length is obtained; then, acquiring the imaging ratio of the shot object during imaging; in the shooting process, judging whether the imaging size of the shot object changes or not; if so, acquiring a second distance corresponding to the shot object after the shot object moves; adjusting the focal length again according to the second object distance and the imaging ratio; and imaging the moved shot object according to the adjusted focal length. After the imaging size of the object is changed, the focal length is adjusted in time according to the moved second object distance so as to keep the imaging ratio within a certain range, thereby ensuring the imaging effect. Therefore, the embodiment of the invention solves the problem that the change of the imaging size influences the watching in the prior art, which causes poor user experience, and improves the user experience.
It will be appreciated that in one implementation of the present invention, if the imaging size changes due to the user changing the focal length at his or her discretion, then there is no need to obtain a corresponding changed object distance, since the imaging size is not a change due to movement of the object. Therefore, the user can be asked to confirm whether to change the focal length by sending the dialog box so as to avoid misoperation, if the user clicks no, as shown in fig. 4, the user is indicated to be in misoperation, and then the automatic focal length adjustment is executed to restore the original size of the focal length. On the other hand, if a change in imaging size occurs simultaneously in the process of performing focal length restoration, it is determined again whether or not there is a change in imaging size caused by a change in object distance. Therefore, the embodiment of the invention can adapt to the imaging size change caused by the focal length change and also adapt to the imaging size change caused by the object distance change.
In another implementation manner of the present invention, the object distance is changed while the focal length is changed, so that the imaging ratio is obtained again according to the changed focal length and the imaging size and original size of the corresponding object to be photographed, a new focal length value is obtained according to the new imaging ratio, and the object to be photographed is imaged according to the new focal length value.
In addition, it should be noted that the camera used for the mobile terminal may be a liquid camera and a solid-state camera, and for the liquid camera, the liquid camera is in a liquid state, and when the focal length needs to be adjusted, the liquid camera can be implemented by only adjusting the thickness of the liquid state, so that the object distance is increased or decreased (the object to be photographed is far away from or close to). For the solid-state camera, the focal length is directly adjusted under the condition that the object distance is increased (the object to be shot is far away); when the object distance becomes smaller (the object is close to), the motor needs to be driven to adjust the position of the lens at the same time, so that a new object distance is formed, wherein the new object distance comprises the movement of the object and the movement distance of the lens, and the new object distance is the relative movement distance between the lens and the object.
In one implementation of the present invention, the step of determining whether the imaging size of the object to be photographed changes includes:
judging whether the imaging ratio of the shot object changes or not;
if yes, determining that the imaging size of the shot object changes; otherwise, determining that the imaging size of the shot object is not changed.
It should be noted that the size of the object is fixed, and when the imaging ratio is fixed, the imaging size is fixed, so that the change of the imaging size of the object is reflected in the imaging ratio. And the size of the shot object does not need to be obtained actually, so that the calculation time in the actual execution process is saved.
It can be understood that there are many objects in the viewing range, and therefore, many motions may occur at the same time, for example, the object distance of the object a becomes larger, and the object distance of the object B becomes smaller, so in order to clarify the object distance of the object to be photographed, the embodiment of the present invention provides a method for selecting an object to be photographed, which is specifically implemented as: before the step of imaging the object to be shot and acquiring the current focal length, the method further comprises: acquiring a selection instruction sent by a user aiming at a target object; and taking the target object corresponding to the selection instruction as the shot object.
The area needing to be selected is determined to be the object to be shot, for example, the object A and the object B included in the viewing range through the selection instruction, and if the selection instruction corresponds to the object A, the object to be shot is the object A. By applying the embodiment of the invention, the shot object can be defined, and the problem that the object distance can not be accurately calculated and the calculation of the imaging ratio can not be effectively ensured because too many objects exist in the view finding range is avoided.
The embodiment of the invention provides a specific object selection method, and the step of acquiring a target object selection instruction of a user comprises the following steps: determining the current view-finding range of the camera; receiving a sliding instruction of a user in the view finding range; judging whether the sliding instruction is a closed area; and if so, determining that the sliding instruction is a target object selection instruction.
The method comprises the steps of manually performing a closed area, such as a circle or an ellipse, by performing an area within a view range, and then identifying an object of the closed area, wherein the identified object is taken as a target object. The object that the user wants to select can be accurately obtained like this to carry out accurate follow-up to the object, accurately obtain the formation of image size, formation of image ratio and the object distance of object, improve like this and carry out the effect of formation of image to the object of shooing, and can be in the condition that the object of shooing exists a lot more, reduce the calculated amount, improve the pertinence of formation of image improvement.
It should be noted that, identification of an object in a closed region may be performed directly by using an image identification method, where image identification is an existing artificial intelligence technology, and details of the embodiment of the present invention are not described herein.
In order to improve interactivity with the user and improve operability of the user, an object recognized by an object of an enclosed area is taken as a target object. The concrete implementation is as follows: identifying the objects in the closed area, and judging whether the identified objects are in at least two categories; if yes, determining the category with the highest priority level in the at least two categories according to the preset priority level; and taking the object corresponding to the category with the highest priority as the target object.
When there are a plurality of objects in the closed area, a user may manually select one object as a target object, or may automatically select the object according to a preset priority level. For example, assuming that a human face is the highest priority, in the case where an enclosed area includes a human face and an animal, the human face is taken as a target object, as shown in fig. 5.
Further, the present invention provides a mobile terminal, please continue to refer to fig. 1, which includes a processor 110, and a memory 109 connected to the processor 110 through a communication bus; wherein the content of the first and second substances,
the memory 109 for storing an imaging program;
the processor 110 is configured to execute an imaging program to implement the following steps:
imaging a shot object and acquiring a current focal length;
acquiring an imaging ratio of the shot object during imaging according to the focal length and a first object distance corresponding to the shot object;
judging whether the imaging size of the shot object changes or not;
if yes, acquiring a second distance corresponding to the shot object;
adjusting the focal length according to the second object distance and the imaging ratio;
and imaging the shot object according to the adjusted focal length.
Optionally, the processor 110 is configured to execute an imaging program to implement the following steps:
acquiring an imaging ratio of the shot object according to a formula k ═ f/(f-u);
wherein k is the imaging ratio, f is the focal length, and u is the first object distance. .
Optionally, the processor 110 is configured to execute an imaging program to implement the following steps:
judging whether the imaging ratio of the shot object changes or not;
if yes, determining that the imaging size of the shot object changes; otherwise, determining that the imaging size of the shot object is not changed.
Optionally, the processor 110 is configured to execute an imaging program to implement the following steps:
acquiring any one focal length value in the focal length adjusting process, and calculating the current imaging ratio of the shot object according to the any one focal length value and the second distance;
calculating a difference between a current imaging ratio and the imaging ratio;
judging whether the difference value is within a preset range;
if so, taking the focal length value as the adjusted focal length, otherwise, continuing to perform focal length adjustment until the difference value is within the preset range.
Optionally, the processor 110 is configured to execute an imaging program to implement the following steps:
acquiring a selection instruction sent by a user aiming at a target object;
and taking the target object corresponding to the selection instruction as the shot object.
Optionally, the processor 110 is configured to execute an imaging program to implement the following steps:
determining the current view-finding range of the camera;
receiving a sliding instruction of a user in the view finding range;
judging whether the sliding instruction is a closed area;
and if so, determining that the sliding instruction is a target object selection instruction.
Optionally, the processor 110 is configured to execute an imaging program to implement the following steps:
and identifying the object in the closed area, and taking the identified object as a target object.
Optionally, the processor 110 is configured to execute an imaging program to implement the following steps:
identifying the objects in the closed area, and judging whether the identified objects are in at least two categories;
if yes, determining the category with the highest priority level in the at least two categories according to the preset priority level;
and taking the object corresponding to the category with the highest priority as the target object.
Compared with the prior art, the mobile terminal provided by the embodiment of the invention images the shot object and obtains the current focal length; then, acquiring the imaging ratio of the shot object during imaging; in the shooting process, judging whether the imaging size of the shot object changes or not; if so, acquiring a second distance corresponding to the shot object after the shot object moves; adjusting the focal length again according to the second object distance and the imaging ratio; and imaging the moved shot object according to the adjusted focal length. After the imaging size of the object is changed, the focal length is adjusted in time according to the moved second object distance so as to keep the imaging ratio within a certain range, thereby ensuring the imaging effect. Therefore, the embodiment of the invention solves the problem that the change of the imaging size influences the watching in the prior art, which causes poor user experience, and improves the user experience.
Further, the present invention also provides a storage medium storing one or more programs executable by one or more processors to implement the steps of:
imaging a shot object and acquiring a current focal length;
acquiring an imaging ratio of the shot object during imaging according to the focal length and a first object distance corresponding to the shot object;
judging whether the imaging size of the shot object changes or not;
if yes, acquiring a second distance corresponding to the shot object;
adjusting the focal length according to the second object distance and the imaging ratio;
and imaging the shot object according to the adjusted focal length.
Optionally, the one or more programs are further executable by the one or more processors to implement the steps of:
acquiring an imaging ratio of the shot object according to k ═ f/(f-u);
wherein k is the imaging ratio, f is the focal length, and u is the first object distance.
Optionally, the one or more programs are further executable by the one or more processors to implement the steps of:
judging whether the imaging ratio of the shot object changes or not;
if yes, determining that the imaging size of the shot object changes; otherwise, determining that the imaging size of the shot object is not changed.
Optionally, the one or more programs are further executable by the one or more processors to implement the steps of:
acquiring any one focal length value in the focal length adjusting process, and calculating the current imaging ratio of the shot object according to the any one focal length value and the second distance;
calculating a difference between a current imaging ratio and the imaging ratio;
judging whether the difference value is within a preset range;
if so, taking the focal length value as the adjusted focal length, otherwise, continuing to perform focal length adjustment until the difference value is within the preset range.
Optionally, the one or more programs are further executable by the one or more processors to implement the steps of:
acquiring a selection instruction sent by a user aiming at a target object;
and taking the target object corresponding to the selection instruction as the shot object.
Optionally, the one or more programs are further executable by the one or more processors to implement the steps of:
determining the current view-finding range of the camera;
receiving a sliding instruction of a user in the view finding range;
judging whether the sliding instruction is a closed area;
and if so, determining that the sliding instruction is a target object selection instruction.
Optionally, the one or more programs are further executable by the one or more processors to implement the steps of:
and identifying the object in the closed area, and taking the identified object as a target object.
Optionally, the one or more programs are further executable by the one or more processors to implement the steps of:
identifying the objects in the closed area, and judging whether the identified objects are in at least two categories;
if yes, determining the category with the highest priority level in the at least two categories according to the preset priority level;
and taking the object corresponding to the category with the highest priority as the target object.
Compared with the prior art, the storage medium provided by the embodiment of the invention images the shot object and acquires the current focal length; then, acquiring the imaging ratio of the shot object during imaging; in the shooting process, judging whether the imaging size of the shot object changes or not; if so, acquiring a second distance corresponding to the shot object after the shot object moves; adjusting the focal length again according to the second object distance and the imaging ratio; and imaging the moved shot object according to the adjusted focal length. After the imaging size of the object is changed, the focal length is adjusted in time according to the moved second object distance so as to keep the imaging ratio within a certain range, thereby ensuring the imaging effect. Therefore, the embodiment of the invention solves the problem that the change of the imaging size influences the watching in the prior art, which causes poor user experience, and improves the user experience.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a mobile terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device, a robot, etc.) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (5)

1. An imaging method applied to a mobile terminal, the method comprising:
imaging a shot object and acquiring a current focal length;
acquiring an imaging ratio of the shot object during imaging according to the focal length and a first object distance corresponding to the shot object;
judging whether the imaging size of the shot object changes or not;
if yes, acquiring a second distance corresponding to the shot object;
adjusting the focal length according to the second object distance and the imaging ratio;
imaging the shot object according to the adjusted focal length;
the formula for obtaining the imaging ratio of the shot object is specifically expressed as follows:
k=f/(f-u)
wherein k is the imaging ratio, f is the focal length, and u is the first object distance;
before the step of imaging the object to be shot and acquiring the current focal length, the method further comprises:
acquiring a selection instruction sent by a user aiming at a target object;
taking the target object corresponding to the selection instruction as a shot object;
the step of obtaining a target object selection instruction of the user includes:
determining the current view-finding range of the camera;
receiving a sliding instruction of a user in the view finding range;
judging whether the sliding instruction is a closed area;
if yes, determining that the sliding instruction is a target object selection instruction;
identifying the objects in the closed area, and judging whether the identified objects are in at least two categories;
if yes, determining the category with the highest priority level in the at least two categories according to the preset priority level;
and taking the object corresponding to the category with the highest priority as the target object.
2. The imaging method according to claim 1, wherein the step of determining whether the imaging size of the subject changes includes:
judging whether the imaging ratio of the shot object changes or not;
if yes, determining that the imaging size of the shot object changes; otherwise, determining that the imaging size of the shot object is not changed.
3. The imaging method according to any one of claims 1 to 2, wherein the step of adjusting the focal length according to the second object distance, the imaging ratio, comprises:
acquiring any one focal length value in the focal length adjusting process, and calculating the current imaging ratio of the shot object according to the any one focal length value and the second distance;
calculating a difference between a current imaging ratio and the imaging ratio;
judging whether the difference value is within a preset range;
if so, taking the focal length value as the adjusted focal length, otherwise, continuing to perform focal length adjustment until the difference value is within the preset range.
4. A mobile terminal, characterized in that the mobile terminal comprises a processor, and a memory connected to the processor by a communication bus; wherein the content of the first and second substances,
the memory is used for storing an imaging program;
the processor is configured to execute the imaging program to implement the following steps:
imaging a shot object and acquiring a current focal length;
acquiring an imaging ratio of the shot object according to the focal length and a first object distance corresponding to the shot object;
judging whether the imaging size of the shot object changes or not;
if yes, acquiring a second distance corresponding to the shot object;
adjusting the focal length according to the second object distance and the imaging ratio;
imaging the shot object according to the adjusted focal length;
and a step of the imaging method of any one of the above;
the formula for obtaining the imaging ratio of the shot object is specifically expressed as follows:
k=f/(f-u)
wherein k is the imaging ratio, f is the focal length, and u is the first object distance;
before the step of imaging the object to be shot and acquiring the current focal length, the method further comprises:
acquiring a selection instruction sent by a user aiming at a target object;
taking the target object corresponding to the selection instruction as a shot object;
the step of obtaining a target object selection instruction of the user includes:
determining the current view-finding range of the camera;
receiving a sliding instruction of a user in the view finding range;
judging whether the sliding instruction is a closed area;
if yes, determining that the sliding instruction is a target object selection instruction;
identifying the objects in the closed area, and judging whether the identified objects are in at least two categories;
if yes, determining the category with the highest priority level in the at least two categories according to the preset priority level;
and taking the object corresponding to the category with the highest priority as the target object.
5. A storage medium storing one or more programs, the one or more programs being executable by one or more processors to cause the one or more processors to perform the steps of the imaging method as claimed in any one of claims 1 to 3.
CN201910164680.3A 2019-03-05 2019-03-05 Imaging method, mobile terminal and storage medium Active CN110049234B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910164680.3A CN110049234B (en) 2019-03-05 2019-03-05 Imaging method, mobile terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910164680.3A CN110049234B (en) 2019-03-05 2019-03-05 Imaging method, mobile terminal and storage medium

Publications (2)

Publication Number Publication Date
CN110049234A CN110049234A (en) 2019-07-23
CN110049234B true CN110049234B (en) 2021-08-24

Family

ID=67274418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910164680.3A Active CN110049234B (en) 2019-03-05 2019-03-05 Imaging method, mobile terminal and storage medium

Country Status (1)

Country Link
CN (1) CN110049234B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014103643A (en) * 2012-11-22 2014-06-05 Canon Inc Imaging device and subject recognition method

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FI114961B (en) * 2001-12-31 2005-01-31 Nokia Corp Method and apparatus for forming an image in an electronic device
JP4985062B2 (en) * 2006-04-14 2012-07-25 株式会社ニコン camera
KR20140102443A (en) * 2013-02-14 2014-08-22 삼성전자주식회사 Object tracking method using camera and camera system for object tracking
EP3132598A1 (en) * 2014-04-17 2017-02-22 Sony Corporation Depth assisted scene recognition for a camera
CN104363380B (en) * 2014-10-15 2017-10-27 北京智谷睿拓技术服务有限公司 IMAQ control method and device
CN105847660A (en) * 2015-06-01 2016-08-10 维沃移动通信有限公司 Dynamic zoom method, device and intelligent device
CN106817532A (en) * 2015-11-27 2017-06-09 小米科技有限责任公司 Image processing method and device
CN107613200A (en) * 2017-09-12 2018-01-19 努比亚技术有限公司 A kind of focus adjustment method, equipment and computer-readable recording medium
CN108234979A (en) * 2017-12-27 2018-06-29 努比亚技术有限公司 A kind of image pickup method, mobile terminal and computer readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014103643A (en) * 2012-11-22 2014-06-05 Canon Inc Imaging device and subject recognition method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CMOS图像传感器片上系统及其在手机上的应用;严求真,金向平等;《现代电子技术》;20070715;全文 *

Also Published As

Publication number Publication date
CN110049234A (en) 2019-07-23

Similar Documents

Publication Publication Date Title
CN107820014B (en) Shooting method, mobile terminal and computer storage medium
CN108566510B (en) Flexible screen control method, mobile terminal and readable storage medium
CN107948360B (en) Shooting method of flexible screen terminal, terminal and computer readable storage medium
CN108419008B (en) Shooting method, terminal and computer readable storage medium
CN110035176B (en) Brightness adjusting method of mobile terminal, mobile terminal and storage medium
CN107105166B (en) Image photographing method, terminal, and computer-readable storage medium
CN110300267B (en) Photographing method and terminal equipment
CN110086993B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN107240072B (en) Screen brightness adjusting method, terminal and computer readable storage medium
CN112188082A (en) High dynamic range image shooting method, shooting device, terminal and storage medium
CN107465873B (en) Image information processing method, equipment and storage medium
CN111866388B (en) Multiple exposure shooting method, equipment and computer readable storage medium
CN107896304B (en) Image shooting method and device and computer readable storage medium
CN112637405A (en) Brightness adjusting method, terminal and computer readable storage medium
CN110177207B (en) Backlight image shooting method, mobile terminal and computer readable storage medium
CN108848321B (en) Exposure optimization method, device and computer-readable storage medium
CN112135060B (en) Focusing processing method, mobile terminal and computer storage medium
CN108197560B (en) Face image recognition method, mobile terminal and computer-readable storage medium
CN107395971B (en) Image acquisition method, image acquisition equipment and computer-readable storage medium
CN110060617B (en) Screen light spot compensation method and device, terminal and readable storage medium
CN112866685A (en) Screen projection delay measuring method, mobile terminal and computer readable storage medium
CN112604281A (en) Game visual field control method, mobile terminal and computer readable storage medium
CN111787234A (en) Shooting control method and device and computer readable storage medium
CN112153305A (en) Camera starting method, mobile terminal and computer storage medium
CN107728789B (en) Starting method of one-hand operation mode, 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