CN112584037A - Method for saving image and electronic equipment - Google Patents

Method for saving image and electronic equipment Download PDF

Info

Publication number
CN112584037A
CN112584037A CN202011295395.4A CN202011295395A CN112584037A CN 112584037 A CN112584037 A CN 112584037A CN 202011295395 A CN202011295395 A CN 202011295395A CN 112584037 A CN112584037 A CN 112584037A
Authority
CN
China
Prior art keywords
user
angle
electronic device
plane
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011295395.4A
Other languages
Chinese (zh)
Other versions
CN112584037B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202011295395.4A priority Critical patent/CN112584037B/en
Publication of CN112584037A publication Critical patent/CN112584037A/en
Priority to PCT/CN2021/130540 priority patent/WO2022105702A1/en
Application granted granted Critical
Publication of CN112584037B publication Critical patent/CN112584037B/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/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides a method for saving an image and electronic equipment, wherein the method is applied to the electronic equipment, the electronic equipment can respond to the operation of a user and display a shooting preview interface, the electronic equipment responds to the operation of the user and obtains a first photo, the electronic equipment can determine a first angle according to the information of an included angle between a normal vector of a plane where eyes of the user are located and the plane where an upper surface of the electronic equipment is located or the information of touch between the user and the electronic equipment, and when the first angle is judged to be within a preset angle range, the first photo is rotated by the first angle and the rotated first photo is saved. According to the technical scheme, when the user grips the electronic equipment in different holding postures to shoot, the electronic equipment can automatically store the photos with the same direction as the shot object seen by the user in the shooting preview interface, so that the photos can be comfortably looked up by the user, and the shooting experience of the user is improved.

Description

Method for saving image and electronic equipment
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a method for saving an image and an electronic device.
Background
When a user uses the electronic device to take a picture, the direction in which the picture is saved generally relates to the posture in which the user holds the electronic device, for example, when the user holds the electronic device vertically to take a picture horizontally, the user intends to have the electronic device vertically save the taken picture, but since the user holds the electronic device horizontally to take a picture, the plane in which the panel of the electronic device is located may not be parallel to the horizontal plane, and therefore, a gravity sensor in the electronic device may mistakenly assume that the user takes a picture horizontally, and thus the picture is saved horizontally.
In the face of such a situation, the user generally manually rotates the photo with the wrong saving direction, or the electronic device prompts the user to save the photo horizontally or vertically when saving the photo, and in any case, the user needs to manually adjust the photo, which affects the shooting experience of the user to a certain extent.
Disclosure of Invention
The application provides a method for saving images and electronic equipment, which can enable the electronic equipment to automatically save photos with the same direction as a target shooting object seen by a user in a shooting preview interface when the user holds the electronic equipment in different holding postures to horizontally shoot.
In a first aspect, a method for saving an image is provided, and the method is applied to an electronic device, and the method includes: the method comprises the steps that the electronic equipment responds to a first operation of a user and displays a first interface, wherein the first interface is a shooting preview interface of the electronic equipment; the electronic equipment responds to the shooting operation of a user and obtains a first picture; the electronic equipment determines a first angle, wherein the first angle is an included angle between a connecting line of the position of a first preset part and the position of a second preset part of the electronic equipment and a preset geographic direction when the first photo is obtained; when the electronic equipment judges that the first angle is within a first preset angle range, the first photo is rotated; the electronic equipment stores the rotated first photo.
Based on the embodiment of the application, when the electronic equipment responds to the operation of a user to obtain the first photo, and the electronic equipment determines that a first angle between a connection line between the position of the first preset part and the position of the second preset part and a preset geographic direction is within a preset angle range, the first photo is rotated, and the rotated first photo is stored. When the user holds the electronic equipment in different postures for shooting, the shot picture can be automatically rotated and stored, and the technical scheme is favorable for the user to look up the shot picture more comfortably.
With reference to the first aspect, in an implementation manner of the first aspect, the method further includes: the electronic equipment detects a second operation of the user; and the electronic equipment responds to the second operation and displays a second interface, wherein the second interface comprises the rotated first picture, and the direction of the target shooting object in the first interface is the same as the direction of the target shooting object in the second interface.
According to the embodiment of the application, when the user opens the second interface to view the first picture, the direction of the target shooting object in the first interface is the same as the direction of the target shooting object in the second interface. According to the technical scheme, the user can see and obtain the shot pictures when the user shoots horizontally, namely when the user views the shot pictures, the direction of the target shooting object in the pictures is consistent with the direction of the user seeing the shooting preview interface of the electronic equipment, so that the user can look up the shot pictures in a normal posture, the electronic equipment does not need to be rotated or the pictures are manually rotated, and the shooting experience of the user is improved.
With reference to the first aspect, in an implementation manner of the first aspect, the determining, by an electronic device, a first angle includes: determining a second plane, wherein the second plane is a plane where the two eyes of the user are located; and determining the first angle according to the information of the included angle between the normal vector of the second plane and a first plane, wherein the first plane is parallel to the plane of the upper surface of the electronic equipment.
In the embodiment of the present application, the second plane is a plane where both eyes of the user are located, and the second plane is perpendicular to the central axis of the head of the user.
Based on the embodiment of the application, the first angle can be determined according to the information of the included angle between the normal vector of the second plane and the first plane.
With reference to the first aspect, in an implementation manner of the first aspect, determining the first angle according to information of an included angle between a normal vector of the second plane and the first plane includes: and determining the first angle according to a second preset angle range in which the angle between the normal vector of the second plane and the first plane is located.
In this embodiment of the application, the first angle may be determined according to a second preset range in which an angle between a normal vector of the second plane and the first plane is located. For example, if the second predetermined angle range is 45 degrees to 135 degrees, the first angle is determined to be 45 degrees or 90 degrees, and the like, which is not limited in the embodiment of the present application.
With reference to the first aspect, in an implementation manner of the first aspect, the determining, by an electronic device, a first angle includes: determining touch information of a user and the electronic equipment when the user holds the electronic equipment; and determining the first angle according to the touch information.
In the embodiment of the application, the first angle may be determined according to touch information of a finger, a palm and the electronic device of a user when the user uses the electronic device, and the touch information may be touch information of the user and a frame or a screen of the electronic device.
With reference to the first aspect, in an implementation manner of the first aspect, determining the first angle according to the touch information includes: inputting the touch information into a neural network model; the first angle is determined based on an output of the neural network model.
In the embodiment of the application, the electronic equipment can acquire the touch information of the user and the electronic equipment when the user uses the mobile phone, train the neural network model according to the touch information, and determine the first angle according to the output result of the neural network model when the user uses the electronic equipment for shooting. Alternatively, the neural network model is trained in advance, which is not limited in the embodiment of the present application.
With reference to the first aspect, in an implementation manner of the first aspect, when the electronic device determines that the first angle is within a first preset angle, the rotating the first photo includes: and when the first angle is within a first preset angle range, rotating the first photo by the first angle anticlockwise.
Based on this application embodiment, when electronic equipment judges this first angle and is in first preset angle within range, carry out anticlockwise rotation according to this first angle with the first photo of shooing, this technical scheme can realize that the direction of the object of shooting in the photo that the shooting obtained is unanimous with the direction that the user saw in electronic equipment's shooting preview interface, thereby be favorable to the user to look up the photo of shooing with normal posture, need not to rotate electronic equipment or manual rotatory photo, thereby be favorable to the look up of user to the photo, user's shooting experience has been promoted.
With reference to the first aspect, in an implementation manner of the first aspect, an included angle between a plane where the upper surface of the electronic device is located and a horizontal plane is within a third preset angle range.
Illustratively, the electronic device is in a horizontal state, which may be understood as a state in which a plane in which an upper surface of the electronic device is located is parallel or nearly parallel to a horizontal plane. For example, the third predetermined angle range may be minus 3 degrees to 3 degrees, -5 degrees to 5 degrees, and so on.
In a second aspect, an electronic device is provided, the electronic device comprising: one or more processors; one or more memories; the one or more memories store one or more computer programs, the one or more computer programs comprising instructions, which when executed by the one or more processors, cause the electronic device to perform the steps of: responding to a first operation of a user, and displaying a first interface, wherein the first interface is a shooting preview interface of the electronic equipment; responding to the shooting operation of a user, and acquiring a first picture; determining a first angle, wherein the first angle is an included angle between a connecting line of the position of a first preset part and the position of a second preset part of the electronic equipment and a preset geographic direction when the first photo is obtained; when the first angle is judged to be within a first preset angle range, rotating the first photo; saving the rotated first photo.
With reference to the second aspect, in an implementation manner of the second aspect, the instructions, when executed by the one or more processors, cause the electronic device to perform the following steps: detecting a second operation of the user; and responding to the second operation, displaying a second interface, wherein the second interface comprises the rotated first picture, and the direction of the target shooting object in the first interface is the same as that of the target shooting object in the second interface.
With reference to the second aspect, in an implementation manner of the second aspect, the electronic device is specifically configured to: determining a second plane, wherein the second plane is a plane where the two eyes of the user are located; and determining the first angle according to the information of the included angle between the normal vector of the second plane and a first plane, wherein the first plane is parallel to the plane of the upper surface of the electronic equipment.
With reference to the second aspect, in an implementation manner of the second aspect, the electronic device is specifically configured to: and determining the first angle according to a second preset angle range in which the angle between the normal vector of the second plane and the first plane is located.
With reference to the second aspect, in an implementation manner of the second aspect, the electronic device is specifically configured to: determining touch information of a user and the electronic equipment when the user holds the electronic equipment; and determining the first angle according to the touch information.
With reference to the second aspect, in an implementation manner of the second aspect, the electronic device is specifically configured to: inputting the touch information into a neural network model; the first angle is determined based on an output of the neural network model.
With reference to the second aspect, in an implementation manner of the second aspect, the electronic device is specifically configured to: and when the first angle is within a first preset angle range, rotating the first photo by the first angle anticlockwise.
With reference to the second aspect, in an implementation manner of the second aspect, an included angle between a plane where the upper surface of the electronic device is located and the horizontal plane is within a third preset angle range.
In a third aspect, a computer-readable storage medium is provided, which includes computer instructions, when the computer instructions are executed on an electronic device, the electronic device is caused to execute the method for saving image as described in the first aspect and any implementation manner thereof
In a fourth aspect, a computer program product is provided, which comprises computer instructions that, when run on an electronic device, cause the electronic device to perform the method for saving images as described in the first aspect and any implementation manner thereof.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Fig. 2 is a schematic diagram of a software structure of an electronic device according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a set of GUIs provided in embodiments of the present application.
Fig. 4 is a schematic diagram of a relationship between a plane of a terminal panel and normal vectors of planes of two eyes of a user according to an embodiment of the present application.
FIG. 5 is a schematic diagram of another set of GUIs provided by an embodiment of the present application.
FIG. 6 is a schematic diagram of another set of GUIs provided by an embodiment of the present application.
FIG. 7 is a schematic diagram of another set of GUIs provided by an embodiment of the present application.
Fig. 8 is a schematic flowchart of a method for saving an image according to an embodiment of the present application.
Fig. 9 is a schematic flowchart of another method for saving an image according to an embodiment of the present application.
Fig. 10 is a schematic flowchart of another method for saving an image according to an embodiment of the present application.
Fig. 11 is a schematic flowchart of another method for saving an image according to an embodiment of the present application.
Fig. 12 is a schematic flowchart of a method for saving an image according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the embodiments herein, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality" means two or more than two.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
The method for saving the image provided by the embodiment of the application can be applied to electronic devices such as a mobile phone, a tablet personal computer, a wearable device, a vehicle-mounted device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), and the like, and the embodiment of the application does not limit the specific types of the electronic devices at all.
Fig. 1 shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be, among other things, a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in 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 have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL). In some embodiments, processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example: the processor 110 may be coupled to the touch sensor 180K via an I2C interface, such that the processor 110 and the touch sensor 180K communicate via an I2C bus interface to implement the touch functionality of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may communicate audio signals to the wireless communication module 160 via the I2S interface, enabling answering of calls via a bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled by a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit the audio signal to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a bluetooth headset.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the capture functionality of electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices, such as AR devices and the like.
It should be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only an illustration, and does not limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, with N being a positive integer greater than 1.
The electronic device 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, the electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a handsfree call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic apparatus 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking the user's mouth near the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to achieve a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
The headphone interface 170D is used to connect a wired headphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm open mobile electronic device platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used for sensing a pressure signal, and converting the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A can be of a wide variety, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic apparatus 100 may also calculate the touched position from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: and when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., the x, y, and z axes) may be determined by gyroscope sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects a shake angle of the electronic device 100, calculates a distance to be compensated for by the lens module according to the shake angle, and allows the lens to counteract the shake of the electronic device 100 through a reverse movement, thereby achieving anti-shake. The gyroscope sensor 180B may also be used for navigation, somatosensory gaming scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude, aiding in positioning and navigation, from barometric pressure values measured by barometric pressure sensor 180C.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the opening and closing state of the leather sheath or the opening and closing state of the flip cover, the automatic unlocking of the flip cover is set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. The method can also be used for recognizing the posture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, taking a picture of a scene, electronic device 100 may utilize range sensor 180F to range for fast focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light to the outside through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there are no objects near the electronic device 100. The electronic device 100 can utilize the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the screen to achieve the purpose of saving power. The proximity light sensor 180G may also be used in a holster mode, a pocket mode automatically unlocks and locks the screen.
The ambient light sensor 180L is used to sense the ambient light level. Electronic device 100 may adaptively adjust the brightness of display screen 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and so on.
The temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 implements a temperature processing strategy using the temperature detected by temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 performs a reduction in performance of a processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, the electronic device 100 heats the battery 142 when the temperature is below another threshold to avoid the low temperature causing the electronic device 100 to shut down abnormally. In other embodiments, when the temperature is lower than a further threshold, the electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, the bone conduction sensor 180M may acquire a vibration signal of the human vocal part vibrating the bone mass. The bone conduction sensor 180M may also contact the human pulse to receive the blood pressure pulsation signal. In some embodiments, the bone conduction sensor 180M may also be disposed in a headset, integrated into a bone conduction headset. The audio module 170 may analyze a voice signal based on the vibration signal of the bone mass vibrated by the sound part acquired by the bone conduction sensor 180M, so as to implement a voice function. The application processor can analyze heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M, so as to realize the heart rate detection function.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The software system of the electronic device 100 may employ a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes an Android system with a layered architecture as an example, and exemplarily illustrates a software structure of the electronic device 100.
Fig. 2 is a block diagram of a software structure of the electronic device 100 according to the embodiment of the present application. The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom. The application layer may include a series of application packages.
As shown in fig. 2, the application package may include applications such as camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, etc.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain 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 it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, 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, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide communication functions of the electronic device 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The Android runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises 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. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), media libraries (media libraries), three-dimensional graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. 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.
For convenience of understanding, the following embodiments of the present application will specifically describe, by taking an electronic device having a structure shown in fig. 1 and fig. 2 as an example, a method for saving an image provided by the embodiments of the present application in conjunction with the accompanying drawings and application scenarios.
Before describing the technical solutions of the embodiments of the present application, first, related terms referred to in the present application are briefly introduced.
Horizontal shooting: the horizontal shooting in the embodiment of the application refers to that when a user uses a mobile phone to shoot, a plane (namely, a first plane) where the upper surface of the mobile phone is located is parallel or approximately parallel to a horizontal plane. For example, the included angle between the first plane and the horizontal plane is in a predetermined angle range, such as minus 3 degrees to 3 degrees, minus 6 degrees to 6 degrees, and so on.
Forward (vertical screen): and in the horizontal shooting state, the user erects the direction of holding the mobile phone.
Left-hand horizontal screen: the forward direction is rotated 90 degrees counterclockwise.
Right-direction horizontal screen: the forward direction is rotated 90 degrees clockwise.
Inverting and erecting the screen: the forward direction is rotated clockwise/counterclockwise by 180 degrees.
When a user uses the mobile phone to shoot, the direction of storing the pictures is generally related to the posture of the user holding the mobile phone, for example, when the user holds the mobile phone vertically to shoot horizontally, the user intends to vertically store the shot pictures in the mobile phone, but because the user holds the mobile phone to shoot horizontally, the plane where the panel of the mobile phone is located may not be parallel to the horizontal plane, so the gravity sensor in the mobile phone may mistakenly assume that the user shoots horizontally, and the pictures are stored horizontally. In the face of such a situation, the user generally rotates the photo with the wrong storage direction manually, or the mobile phone prompts the user to store the photo horizontally or vertically when storing the photo, and in any case, the user needs to adjust the photo manually, which affects the shooting experience of the user to a certain extent.
The embodiment of the application provides a method for saving images, which can enable a mobile phone electronic device to automatically save a picture which is consistent with a direction of a target shooting object seen by a user in a viewfinder shooting preview interface of a screen when the user holds the electronic device in different holding postures to horizontally shoot.
Fig. 3 is a schematic diagram of a set of Graphical User Interfaces (GUIs) provided in an embodiment of the present application. Wherein, from (a) to (d) of fig. 3, the process of horizontal shooting is shown in which the user holds the mobile phone in the vertical direction, and from (e) to (h) of fig. 3, the process of horizontal shooting is shown in which the user holds the mobile phone in the horizontal direction.
Referring to fig. 3 (a), the GUI is a desktop 300 of a mobile phone. When the handset detects an operation of the user clicking on the icon 301 of the camera application on the desktop 300, the camera may be started, and a GUI as shown in fig. 3 (b) may be displayed, which may be referred to as a camera interface.
In the embodiment of the present application, the GUI shown in (b) in fig. 3 may also be displayed by calling a camera from another application.
Referring to fig. 3 (b), the user holds the mobile phone in a portrait mode to photograph the subject 304a located on a horizontal plane horizontally (for example, the subject 304a is placed on the horizontal plane in a direction rotated by 90 degrees counterclockwise with respect to the forward direction), and when the mobile phone detects an operation of clicking the photographing control 302 by the user, a GUI as shown in fig. 3 (c) may be displayed.
Referring to (c) in fig. 3, a photo taken by the user may be displayed in the area 303, and when the mobile phone detects an operation of clicking on the area 303 by the user, a GUI as shown in (d) in fig. 3 may be displayed, where the GUI is a saving interface of the taken photo in the album.
Referring to (d) of fig. 3, when the user views the photo 304 vertically, the photo 304 is stored in the album in a direction rotated 90 ° counterclockwise with respect to the forward direction, that is, the direction in which the photo of the photographic subject 304a is finally stored coincides with the direction displayed on the screen of the user's mobile phone when the user takes the photo.
In fig. 3, (e) may refer to the description of (a) in fig. 3, and for brevity, the description is omitted.
Referring to (f) in fig. 3, when the user horizontally photographs the photographic subject 304a located on the horizontal plane with the mobile phone held in a landscape orientation (for example, the mobile phone is rotated 90 degrees counterclockwise with respect to the forward direction), the photographic subject 304a is placed on the horizontal plane in a direction rotated 90 degrees counterclockwise with respect to the forward direction in the display interface of the camera, and after the mobile phone detects the operation of the user clicking the photographing control 307, a GUI as shown in (g) in fig. 3 may be displayed.
Referring to (g) in fig. 3, a photo taken by the user may be displayed in the area 308, and when the mobile phone detects an operation of clicking on the area 303 by the user, a GUI as shown in (h) in fig. 3 may be displayed.
Referring to (h) in fig. 3, when the user views the photo 309 vertically, the photo 309 is stored in the album in a landscape orientation, i.e., in an orientation rotated 90 ° counterclockwise with respect to the forward direction, that is, the direction in which the photo of the photographic subject 304a is stored coincides with the direction in which the photographic subject is displayed on the screen of the cellular phone when the user takes the photo.
It should be understood that, in the embodiment of the present application, the mobile phone is only described as an example in which the user holds the mobile phone vertically and holds the mobile phone horizontally (rotates 90 degrees counterclockwise in the vertical direction), but the embodiment of the present application is not limited to this, and in fact, no matter what posture the user holds the mobile phone to take horizontally, the direction in which the picture of the object to be taken is finally stored is always the same as the direction in which the picture is displayed on the screen of the mobile phone, that is, what the user sees is what the user can obtain.
Fig. 4 is a schematic diagram of a relationship between a plane of a terminal panel and normal vectors of planes of two eyes of a user according to an embodiment of the present application.
As shown in fig. 4, when a user uses a mobile phone to perform horizontal shooting, a front-facing camera in the mobile phone may collect information of a user's face, where the front-facing camera may be a three-dimensional (3D) sensing camera, when the user's face is within a viewing angle of the front-facing camera, the camera may acquire 3D information of the user's face, and a second plane where two eyes of the user are located and a normal vector of the second plane may be determined according to the 3D information, where the second plane is perpendicular to a center line of the user's head. The plane where the mobile phone panel is located is the first plane, and the holding posture of the user who uses the mobile phone to shoot horizontally at present can be determined through the information of the included angle between the normal vector of the second plane and the first plane, and the photo is rotated and stored according to the holding posture of the user.
When the included angle is within the first threshold value range, the user can be considered to hold the mobile phone in a positive vertical screen posture for horizontal shooting, and the shot picture is directly and vertically stored; when the included angle is within the second threshold range, the user can be considered to hold the mobile phone in a posture of horizontally shooting in a left-direction transverse screen (rotating 90 degrees counterclockwise relative to the forward direction), and the shot picture is stored by rotating 90 degrees counterclockwise; when the included angle is within the third threshold range, the user can be considered to hold the mobile phone in an inverted vertical screen (rotated 180 degrees counterclockwise relative to the forward direction) posture for horizontal screen shooting, and the shot picture is rotated 180 degrees counterclockwise for storage; when the included angle is within the fourth threshold range, the user may be considered to hold the mobile phone in a right-direction landscape (rotated by 270 degrees counterclockwise relative to the forward direction) posture for horizontal screen shooting, and the shot picture is rotated by 270 degrees counterclockwise and stored.
Illustratively, the angle is a clockwise angle between a normal vector of the second plane and the first plane, the first threshold range X1 may be-45 ° < X1 ≦ 45 °, the second threshold range X2 may be 45 ° < X2 ≦ 135 °, the third threshold range X3 may be 135 ° < X1 ≦ 135 °, and the fourth threshold range X4 may be-135 ° < X1 ≦ 45 °.
Based on the embodiment of the application, the gesture of holding the mobile phone by the user can be judged through the threshold range, and the mobile phone rotates and stores the shot picture according to the holding gesture, so that the direction of storing the picture of the finally shot object is always consistent with the direction displayed on the screen of the mobile phone, namely the shot object can be obtained in what you see. Fig. 5 is a schematic diagram of a holding posture of a group of users using a mobile phone according to an embodiment of the present application. According to the embodiment of the application, the holding posture of the user can be judged by detecting the contact point or contact surface information of the edge of the mobile phone, and then the direction in which the user intends to store the photo when horizontally shooting is judged.
As shown in fig. 5 (a), when the user holds the mobile phone with the left hand facing the vertical screen, a contact point contacting with the thumb of the user is arranged above the left side of the mobile phone, a contact surface contacting with the palm of the user is arranged below the left side of the terminal, and four contact points contacting with the fingers of the user are arranged on the right side of the mobile phone.
As shown in fig. 5 (b), when the user holds the mobile phone with his right hand in the forward direction, there are four contact points on the top of the right side of the mobile phone, which are in contact with the thumb of the user's right hand, and there are four contact points on the bottom of the right side of the terminal, which are in contact with the palm of the user's hand, and there are four contact points on the left side of the mobile phone, which are in contact with the fingers of the user.
When the user is holding the mobile phone in the forward direction, the mobile phone can directly vertically save the taken picture regardless of whether the user is holding the mobile phone in the left hand or in the right hand, as shown in (c) of fig. 5.
As shown in fig. 5 (d), when the user holds the mobile phone with the left hand facing the left landscape, i.e. the mobile phone rotates 90 degrees counterclockwise relative to the forward direction, the top of the left side of the mobile phone has a contact surface contacting with the thumb of the user's left hand, the top of the right side of the mobile phone has a contact point contacting with the user's finger, and the top of the right side has at least one contact point contacting with the user's finger.
When the user holds the mobile phone in a left-handed landscape manner, the mobile phone may save the taken photo by rotating 90 degrees counterclockwise with respect to the forward direction, so that when the user views the taken photo 222 vertically, the photo 222 is displayed in the album in the vertical direction, i.e. the direction in which the 304a is saved coincides with the direction in which it is displayed on the mobile phone screen when taken, as shown in (f) of fig. 5.
As shown in fig. 5 (e), when the user holds the mobile phone with right hand and right lateral screen, i.e. the mobile phone rotates clockwise by 90 degrees relative to the forward direction, the top of the right side of the mobile phone has a contact surface contacting with the thumb of the user's right hand, the top of the left side of the mobile phone has a contact point contacting with the finger of the user, and the top of the left side of the mobile phone has at least one contact point contacting with the finger of the user.
When the user holds the mobile phone in a right-handed landscape manner, and when the user holds the mobile phone in a left-handed landscape manner, the mobile phone may save the taken photo by rotating the taken photo 90 degrees clockwise with respect to the forward direction, so that when the user views the taken photo 222 vertically, the photo 222 is displayed in the album in the vertical direction, that is, the saved direction of 304a is consistent with the direction displayed on the mobile phone screen when the user takes the photo, as shown in (f) in fig. 5.
It is understood that the holding posture of the user is related to the habit of the user using the mobile phone, and the holding posture of each user may be different, that is, the touch information of each user and the mobile phone may be different in the holding posture.
Referring to fig. 5 (g), the user holds the mobile phone with the left hand upside down, that is, the mobile phone rotates 180 degrees counterclockwise relative to the forward direction, and then the top of the right side of the mobile phone has a contact surface contacting with the palm of the user, the bottom of the right side of the mobile phone has a contact point contacting with the finger of the user, and the left side of the mobile phone has four contact points contacting with the finger of the user.
Referring to fig. 5 (h), the user holds the mobile phone upside down with the right hand, so that the top of the left side of the mobile phone has a contact surface contacting with the palm of the user, the bottom of the left side of the mobile phone has a contact point contacting with the fingers of the user, and the right side of the mobile phone has four contact points contacting with the fingers of the user.
When the user holds the mobile phone upside down, whether the user holds the mobile phone with the left hand or the right hand, the mobile phone can save the shot picture by rotating the shot picture by 180 degrees clockwise or counterclockwise relative to the forward direction, so that when the user looks at the shot picture 223 vertically, the shot picture 223 is displayed in the album in the vertical direction, that is, the saved direction of the picture 304a is consistent with the direction displayed on the screen of the mobile phone when the picture is shot, as shown in (I) in fig. 5.
It should be understood that the mobile phone in the embodiment of the present application may be a mobile phone with a waterfall screen or a curved screen, and for a mobile phone without a waterfall screen or a curved screen, an additional sensor may be disposed on a side surface of the mobile phone to sense contact information between the mobile phone and the user.
Based on the embodiment of the application, the holding posture of the mobile phone of the user is judged by detecting the contact point or contact surface information of the edge of the mobile phone, and the shot picture is rotated and stored according to the holding posture, so that the direction for storing the picture of the finally shot object is always consistent with the direction displayed on the screen of the mobile phone, and what you see is what you get can be achieved.
FIG. 6 is a schematic diagram of another set of GUIs provided by an embodiment of the present application. Here, fig. 6 (a) to (d) show a process in which the user horizontally photographs with the mobile phone held vertically.
Referring to fig. 6 (a), the GUI is a desktop 300 of a mobile phone. When the handset detects an operation of the user clicking on the icon 301 of the camera application on the desktop 300, the camera may be started, and a GUI as shown in fig. 3 (b) may be displayed, which may be referred to as a camera interface.
Referring to (b) of fig. 6, when the user horizontally photographs the photographic subject 304a located on the horizontal plane, it can be seen that, in the display interface of the camera, the photographic subject 304a is placed on the horizontal plane in a direction rotated by 90 ° clockwise with respect to the forward direction, and after the mobile phone detects the operation of the user clicking the photographing control 302, a GUI as shown in (c) of fig. 6 can be displayed.
Referring to (c) in fig. 6, a picture taken by the user may be displayed in the region 303, and when the mobile phone detects an operation of clicking the region 303 by the user, a GUI as shown in (d) in fig. 6 may be displayed.
Referring to fig. 6 (d), the GUI is an interface for saving photos taken by the user in an album, and it can be seen that when the user is looking up (upright) at the photos, the photos 304 are saved in the album in a forward manner.
FIG. 7 is a schematic diagram of another set of GUIs provided by an embodiment of the present application. Fig. 7 (a) to (d) show horizontal shooting with the mobile phone held by the user.
Fig. 7 (a) may refer to the description of fig. 6 (a), and for brevity, the description is omitted.
Referring to (b) of fig. 7, when the user horizontally photographs the photographic subject 304a located on the horizontal plane with the mobile phone held in a landscape orientation (for example, the mobile phone is rotated 90 degrees counterclockwise with respect to the forward direction), the photographic subject 304a is placed on the horizontal plane in a direction rotated 90 degrees clockwise with respect to the forward direction in the display interface of the camera, and after the mobile phone detects the operation of the user clicking the photographing control 302, a GUI as shown in (c) of fig. 7 may be displayed.
Referring to (c) in fig. 7, a picture taken by the user may be displayed in the region 303, and when the mobile phone detects an operation of clicking the region 303 by the user, a GUI as shown in (d) in fig. 7 may be displayed.
Referring to (d) of FIG. 7, when the user views the photos vertically, the photos 304 are saved in the album in the forward direction.
While the two ways of saving the image in the embodiment of the present application are described above with reference to fig. 6 and 7, it should be understood that the embodiment of the present application only exemplifies the two ways, and in fact, when the user uses the mobile phone to shoot horizontally, no matter what posture the user holds (e.g., holds the mobile phone horizontally or vertically or holds at other angles), and no matter what direction the object to be shot is placed on the horizontal plane (e.g., places the object forward, rotates 90 degrees, 180 degrees, or places at other angles), the mobile phone always saves the shot picture in the forward direction, i.e., always saves the picture in the direction most suitable for the user to read.
Based on the embodiment of the application, when the user uses the mobile phone to horizontally shoot, the shot picture is automatically stored into the direction which is most suitable for the user to read by the mobile phone, so that the situation that the picture direction is wrongly stored by the mobile phone is avoided, manual adjustment of the user is not needed, and the user experience is improved.
Fig. 8 is an exemplary flowchart of a method for saving an image according to an embodiment of the present application. As shown in fig. 8, the method may include steps 301 to 305.
301, the user starts the camera and turns on the rear camera.
302, the shot picture is input into the image rotation direction recognition model.
Optionally, when the mobile phone determines that an included angle between the mobile phone panel and the horizontal plane meets a preset value, the shot picture is input into the image rotation direction recognition model. The plane of the mobile phone panel is parallel to the plane of the upper surface of the mobile phone.
The gravity sensor in the mobile phone can acquire the upward gravity acceleration values of the X axis (for example, the bottom direction of the mobile phone) and the Y axis (for example, the side direction of the mobile phone) of the mobile phone panel, and the plane formed by the X axis and the Y axis is the plane where the mobile phone panel is located. If the gravity acceleration value in the X-axis direction is smaller than the first preset acceleration value and the gravity acceleration value in the Y-axis direction is smaller than the second preset acceleration value, the angle of the plane where the mobile phone panel is located deviating from the horizontal plane can be judged to be within the preset range, namely the plane where the mobile phone panel is located is approximately parallel to the horizontal plane. At this time, it may be determined that the user is performing horizontal photographing using the mobile phone.
When a user takes a picture horizontally, the taken picture may be stored in a wrong direction, and at this time, the taken picture is input into a pre-trained image rotation direction recognition model, and the image rotation direction recognition model may output a plurality of results, for example, a forward picture, a clockwise rotation of 90 degrees, a clockwise rotation of 180 degrees, a clockwise rotation of 270 degrees, and the like.
The training method of the image rotation direction recognition model comprises the following steps:
(1) and acquiring a training data set with the marks.
For example, a large number of sample photos in the forward direction (the rotation angle is 0) may be obtained, and the sample photos are rotated clockwise by 90 degrees, 180 degrees and 270 degrees and stored, so as to obtain photos in four directions.
For example, a large number of sample photos in the forward direction (the rotation angle is 0) may be obtained, and the sample photos are rotated clockwise by 45 degrees, 90 degrees, 135 degrees, 180 degrees, 225 degrees, 270 degrees, and 315 degrees, respectively, and stored, so as to obtain photos in eight directions.
It should be understood that, in the embodiment of the present application, sample photos in more directions may also be saved, and the sample photos may also be rotated counterclockwise and saved, which is not specifically limited in the embodiment of the present application.
Forming a sample training data set by each sample photo and the photos in multiple directions stored after rotation to obtain multiple training sets;
and carrying out data marking on the photos in different directions in each training set to obtain each marked training set. For example, if each training set includes the above four sample photos in different directions, the forward photo in each training set is labeled as "0", the photo rotated clockwise by 90 degrees is labeled as "1", the photo rotated clockwise by 180 degrees is labeled as "2", and the photo rotated clockwise by 90 degrees is labeled as "3", so as to obtain the training data set with labels.
(2) And inputting the marked training data set into a neural network model for training.
It should be understood that the neural network model may be a Convolutional Neural Network (CNN), a Deep Belief Network (DBN), a Recurrent Neural Network (RNN), a Generative Adaptive Network (GAN), and the like, which is not specifically limited in this embodiment of the present application.
For example, if the neural network model is CNN, the labeled training data set in step (1) may be input into the CNN model for training.
(3) And obtaining an image rotation direction identification model.
And (3) when the loss function of the CNN model in the step (2) is reduced to the minimum and is kept stable, obtaining the trained CNN image rotation direction recognition model.
303, rotating the picture according to the output result of the image rotation direction identification model and storing the image.
For example, if the training data set of the image rotation direction recognition model includes sample photos in four different directions, the image rotation direction recognition model may output four results, and according to the output result of the model, the clockwise rotation angle of the currently taken photo relative to the forward photo may be determined, and then the currently taken photo may be rotated counterclockwise by the same angle and stored, or the currently taken photo may be rotated to the forward direction by a certain angle along with the pointer.
For example, as shown in fig. 7, the output result of the image rotation direction recognition model indicates that the clockwise rotation angle of the current photo relative to the forward photo is 90 degrees, and then the current photo is rotated counterclockwise by 90 degrees and saved in the album.
For example, the output result of the image rotation direction recognition model shows that the clockwise rotation angle of the current photo relative to the forward photo is 90 degrees, and the current shot photo is rotated clockwise by 270 degrees and then stored in the album.
Alternatively, the currently taken picture may be rotated clockwise by 90 degrees, 180 degrees, and 270 degrees, respectively, and then input into the conventional CNN target recognition model to obtain four confidence results, and the picture with the maximum confidence value is stored.
In the embodiment of the application, when the user uses the terminal to horizontally shoot, the photo direction which is most suitable for the user to look up is intelligently identified, and the image shot by the user horizontally is stored into the direction which is suitable for the user to look up, namely, the photo is stored in the forward direction, so that the phenomenon that the photo direction is wrongly stored when the user horizontally shoots due to the handheld terminal device is avoided, and the shooting experience of the user is further improved.
In some cases, the user himself wants to save a horizontal photo, and the above technical solution automatically rotates the horizontal photo to save the photo in the forward direction, which is contrary to the user's intention.
In view of this situation, the present application provides another method for saving an image, which can make the direction in which a terminal saves a photograph coincide with the direction in which a user sees an image in a viewfinder of a screen of the terminal.
Fig. 9 is a schematic flow chart of a method of saving an image according to an embodiment of the present application. As shown in fig. 9, the method may include steps 401 to 405.
401, the user starts the camera and turns on the rear camera.
And 402, starting a front camera to acquire a first image.
Optionally, when the mobile phone judges that an included angle between the mobile phone panel and the horizontal plane meets a preset value, the front-facing camera is started, and the first image is acquired.
It should be understood that, in this step, the manner of determining that the included angle between the mobile phone panel and the horizontal plane satisfies the preset value may refer to the related description in step 302, and is not described again.
The first image is an image acquired within a front camera viewing angle, for example, as shown in fig. 4, the front camera may be a three-dimensional 3D sensing camera, when the face of the user is within the front camera viewing angle, 3D information of the face of the user may be acquired by using the front camera, and a second plane where two eyes of the user are located and a normal vector of the second plane may be determined according to the 3D information, where the second plane is perpendicular to a center line of the head of the user.
And 403, calculating an included angle between a normal vector of a second plane where the two eyes of the user are located and a first plane where the mobile phone panel is located.
The included angle may be a clockwise included angle between a normal vector of the second plane and the first plane, or an anticlockwise included angle.
And 404, judging the holding posture of the user according to the included angle.
When the included angle is within the first threshold value range, the user can be considered to hold the mobile phone in a positive vertical screen posture for horizontal shooting; when the included angle is within the second threshold range, the user can be considered to hold the mobile phone in a posture of horizontally shooting in a left-direction transverse screen (rotating 90 degrees counterclockwise relative to the forward direction); when the included angle is within the third threshold range, the user can be considered to hold the mobile phone in a posture of inverting the vertical screen (rotating 180 degrees counterclockwise relative to the forward direction) to perform horizontal screen shooting; when the included angle is within the fourth threshold range, it may be considered that the user holds the mobile phone in a right-direction landscape (rotated by 270 degrees counterclockwise with respect to the forward direction) posture to perform horizontal screen shooting.
Illustratively, the angle is a clockwise angle between a normal vector of the second plane and the first plane, the first threshold range X1 is-45 ° < X1 ≦ 45 °, the second threshold range X2 is 45 ° < X2 ≦ 135 °, the third threshold range X3 is 135 ° < X1 ≦ 135 °, and the fourth threshold range X4 is-135 ° < X1 ≦ 45 °.
Illustratively, the angle is a clockwise angle between a normal vector of the second plane and the first plane, the first threshold range X1 is 0 ° ≦ X1 < 45 °, the second threshold range X2 is 45 ° ≦ X1 < 90 °, the third threshold range X3 is 90 ° ≦ X1 < 135 °, and the fourth threshold range X4 is 135 ≦ X1 < 180 °.
The picture is rotated and stored 405 according to the user's holding posture.
Exemplarily, if the mobile phone judges that the user holds the mobile phone in a positive vertical screen posture, the shot picture is stored in a positive direction; if the user is judged to hold the mobile phone in a left-side horizontal screen posture, as shown in fig. 3, the shot picture is stored by rotating 90 degrees counterclockwise or 270 degrees clockwise relative to the positive direction; if the user holds the mobile phone in the inverted vertical screen posture, storing the shot picture by rotating the shot picture by 180 degrees counterclockwise or clockwise relative to the positive direction; if the user is judged to hold the mobile phone in a right-side landscape posture, the shot picture is stored by rotating 270 degrees anticlockwise relative to the forward direction or rotating 90 degrees along the pointer, so that when the user views the shot picture vertically, the direction of the finally stored picture is consistent with the direction of an image seen by the user in a viewfinder of a screen of the mobile phone.
According to the technical scheme, the method and the device for acquiring the holding posture of the mobile phone can acquire the current holding posture of the user according to the included angle between the normal vector of the second plane where the eyes of the user are located and the first plane where the mobile phone panel is located, and rotate and store the shot picture according to the holding posture.
FIG. 10 is an exemplary flow chart of another method for saving an image according to an embodiment of the present application. As shown in fig. 10, the method may include steps 501 to 504.
501, the user starts the camera and turns on the rear camera.
502, acquiring touch information of the mobile phone.
Optionally, when the mobile phone determines that an included angle between the plane where the mobile phone panel is located and the horizontal plane meets a preset value, the mobile phone obtains touch information of the mobile phone.
It should be understood that, in this step, the manner of determining that the included angle between the mobile phone panel and the horizontal plane satisfies the preset value may refer to the related description in step 302, and is not described again.
The touch information may be touch information between a finger or a palm of the hand and a side surface of the mobile phone when the user holds the mobile phone, and may be a touch point or a touch surface, for example.
In one example, the mobile phone has a curved screen or a waterfall screen, and when a user holds the mobile phone to take a horizontal shot, touch information of the side of the mobile phone and the user is recorded.
In another example, when the mobile phone does not have a curved screen or a waterfall screen, a contact sensor may be installed on a side of the mobile phone to record touch information of the side of the mobile phone and the user.
As shown in fig. 5 (a), (b), (d), (e), (g), and (h), when the user holds the mobile phone in different postures, the contact points or contact surfaces between the fingers or the palm of the user and the mobile phone are different, and therefore, the holding posture of the user can be determined according to the touch information sensed by the side surface of the mobile phone.
It should be understood that the holding posture of the mobile phone is different for different users, and accordingly, the corresponding relationship between the touch information and the holding posture of the user may be changed.
Table 1 shows the correspondence between the holding posture and the touch information of a certain user in the normal shooting.
Figure BDA0002785127530000181
Figure BDA0002785127530000191
When the user normally uses the mobile phone, the corresponding relationship between the holding posture of the user and the touch information is recorded, and the corresponding relationship between the touch information and the holding posture can be subjected to recognition model training, wherein the network models such as the CNN, the DBN, the RNN, the GAN and the like can be adopted.
503, determining the posture of the user holding the mobile phone according to the touch information.
When the user adopts horizontal shooting, touch information of the mobile phone is collected and input into the trained corresponding relation recognition model, and the holding posture of the user can be obtained.
And 504, rotating and saving the photo according to the gesture of the user holding the mobile phone.
Illustratively, if the user is judged to hold the mobile phone in a positive vertical screen posture, the shot picture is stored in a positive direction; if the user is judged to hold the mobile phone in a left-side horizontal screen posture, as shown in fig. 5, the shot picture is stored by rotating 90 degrees counterclockwise or 270 degrees clockwise relative to the positive direction; if the user holds the mobile phone in the inverted vertical screen posture, storing the shot picture by rotating the shot picture by 180 degrees counterclockwise or clockwise relative to the positive direction; if the user holds the mobile phone in a right-side landscape posture, the shot picture is stored by rotating 270 degrees counterclockwise relative to the forward direction or rotating 90 degrees clockwise along the pointer.
In some cases, the user may temporarily change the posture of holding, and therefore may cause errors in the output result of the model, and in such a case, the user may manually rotate the photograph in the correct direction in the album. At the moment, the mobile phone can record the error result and the touch information acquired during shooting, and feeds back the error result and the touch information to the corresponding relation recognition model of the holding gesture and the touch information to achieve the purpose of updating the recognition model, so that the model can continuously learn the use habits of the user, and the recognition model is more and more accurate.
Based on the technical scheme, the holding gesture of the user for horizontally shooting by using the mobile phone can be judged through the touch information sensed by the mobile phone, and the shot picture is rotated and stored according to the holding gesture.
Fig. 11 is a schematic flow chart of another method for saving an image according to an embodiment of the present application. As shown in fig. 11, the method may include steps 601 to 608.
601, the user starts the camera and turns on the rear camera.
And 602, starting a front camera to acquire a first image.
Optionally, when the mobile phone judges that an included angle between the panel and the horizontal plane meets a preset value, the front camera is started, and a first image is acquired.
It should be understood that, the above steps 601 and 602 may refer to the description related to the steps 401 to 402, and are not repeated for brevity.
603, when the first image contains the eyes of the user, calculating an included angle between a normal vector of a second plane where the eyes of the user are located and the first plane.
And 604, judging the holding posture of the user according to the included angle.
605, the picture is rotated and stored in accordance with the user's holding posture.
It should be understood that, the above steps 603 to 605 may refer to the descriptions in steps 403 to 405, and are not repeated for brevity.
And 606, when the first image does not contain the eyes of the user, acquiring touch information of the mobile phone.
At this time, the face of the user is not within the visual angle of the front camera of the mobile phone.
607, the posture of the user holding the mobile phone is judged according to the touch information.
And 608, rotating and saving the picture according to the gesture of the user holding the mobile phone.
It should be understood that steps 606 to 608 may refer to steps 502 to 504, and are not described again for brevity.
Based on the technical scheme, when a user uses the mobile phone to horizontally shoot, if the front-facing camera can capture the eyes of the user, the holding posture of the user is judged according to the relation between the normal vector of the plane where the eyes of the user are located and the included angle of the plane where the mobile phone panel is located, if the front-facing camera does not capture the eyes of the user, the holding posture of the user can be judged according to touch information sensed by the mobile phone, and the shot picture is rotated and stored according to the holding posture of the user. According to the technical scheme, the user can see and obtain the shot picture when shooting horizontally, namely when the shot picture is viewed vertically, the direction of the picture is consistent with the direction of the image seen by the user in the shooting preview interface of the mobile phone screen.
Fig. 12 is a schematic flowchart of a method for saving an image according to an embodiment of the present application. As shown in fig. 12, the method is applied to an electronic device, and may include steps 701 to 705.
701, the electronic equipment responds to a first operation of a user and displays a first interface, and the first interface is a shooting preview interface of the electronic equipment.
Illustratively, a user can click a camera from a desktop, and in response to the operation of the user, the electronic device displays a first interface, wherein the first interface is a camera shooting preview interface; or the user may invoke the camera from other applications, and the electronic device enters a camera shooting preview interface, where the shooting preset interface may also be referred to as a preview interface, a view interface, and the like. As shown in fig. 3, the cell phone performs a camera shooting preview interface in response to an operation for clicking on the camera 301.
The electronic device obtains a first picture in response to a user's photographing operation 702.
703, the electronic device determines a first angle, where the first angle is an included angle between a connection line between a position of a first preset portion and a position of a second preset portion of the electronic device and a preset geographic direction when the first photo is obtained.
In the embodiment of the application, the first preset part can be a central position of a charging interface of the electronic equipment, the charging interface is located in the middle of a frame at the bottom of the electronic equipment, and the second preset part can be a central position of a screen of the electronic equipment; alternatively, the first preset portion may be a center position of a screen of the electronic device, and the second preset portion may be a center position of a front camera of the electronic device, which is not limited in this embodiment of the present application.
The predetermined geographic direction may be north, east, etc., which is not limited in the embodiments of the present application.
It should be understood that, the order of the steps 702 and 703 is not limited in the embodiments of the present application.
704, when the electronic device determines that the first angle is within a first preset angle range, the electronic device rotates the first photo.
For example, the position of the first preset portion is a center position of a charging interface of the electronic device, the position of the second preset portion is a screen center position of the electronic device, the preset geographic direction is a north direction, when the user holds the electronic device in a forward direction, the first angle may be understood as 0 degree, when the user holds the electronic device in another posture, a counterclockwise angle between a connecting line from the north direction to the position of the first preset portion and the position of the second preset portion may be taken as the first angle, the first preset angle range may be 45 degrees to 315 degrees, the first preset angle range may also be 30 degrees to 330 degrees, which is not limited in the embodiment of the present application.
As shown in fig. 3 (e) and (f), the electronic device in fig. (e) may be understood that the first angle is 0 degree, and the first angle of the electronic device in fig. (f) is 90 degrees, and when the electronic device determines that the first angle is within the first preset angle range, the electronic device rotates the first photo.
As shown in fig. 5 (g) and (h), the first angle may be 180 degrees, as shown in fig. 5 (e), the first angle may be 270 degrees, and in other embodiments, the first angle may have other values.
The electronic device saves the rotated first photograph 705.
Exemplarily, as shown in (g), (h) of fig. 3, the electronic device saves the rotated first photo.
Based on the embodiment of the application, when the electronic equipment responds to the operation of a user to obtain the first photo, and the electronic equipment determines that a first angle between a connection line between the position of the first preset part and the position of the second preset part and a preset geographic direction is within a preset angle range, the first photo is rotated, and the rotated first photo is stored. When the user holds the electronic equipment in different postures for shooting, the shot picture can be automatically rotated and stored, and the technical scheme is favorable for the user to look up the shot picture more comfortably.
Optionally, the method may further comprise steps 706 to 707.
The electronic device detects 706 a second operation by the user.
Illustratively, as shown in (g) in fig. 3, the second operation may be an operation in which the user clicks the area 308.
And 707, in response to the second operation, the electronic device displays a second interface including the rotated first picture, wherein the direction of the target photographic object in the first interface is the same as the direction of the target photographic object in the second interface.
Illustratively, as shown in (h) of fig. 3, in response to the second operation, the electronic device displays a second interface, which may be the interface displayed in (h) of fig. 3, wherein the direction of the subject 304a in the photograph 309 is the same as the direction thereof in the first interface.
According to the embodiment of the application, when the user opens the second interface to view the first picture, the direction of the target shooting object in the first interface is the same as the direction of the target shooting object in the second interface. According to the technical scheme, the user can see and obtain the shot pictures when the user shoots horizontally, namely when the user views the shot pictures, the direction of the target shooting object in the pictures is consistent with the direction of the user seeing the shooting preview interface of the electronic equipment, so that the user can look up the shot pictures in a normal posture, the electronic equipment does not need to be rotated or the pictures are manually rotated, and the shooting experience of the user is improved.
Optionally, the electronic device determines a first angle, comprising:
determining a second plane, wherein the second plane is a plane where the two eyes of the user are located;
and determining the first angle according to the information of the included angle between the normal vector of the second plane and a first plane, wherein the first plane is parallel to the plane where the upper surface of the electronic equipment is located.
Illustratively, as shown in fig. 4, the second plane is a plane on which both eyes of the user are located, the second plane is perpendicular to the central axis of the head of the user, the first plane is parallel to a plane on which the upper surface of the electronic device is located, or the first plane is parallel to a plane on which the panel of the electronic device is located.
Optionally, the determining, by the electronic device, a first angle according to information of an included angle between the normal vector of the second plane and the first plane includes: and determining the first angle according to a second preset angle range in which the angle between the normal vector of the second plane and the first plane is located.
In this embodiment of the application, the first angle may be determined according to a second preset angle range in which an angle between a normal vector of the second plane and the first plane is located.
For example, when the second predetermined angle range is 45 degrees to 135 degrees, the first angle is determined to be 45 degrees or 90 degrees, etc. If the second predetermined angle range is 135 degrees to 225 degrees, the first angle is determined to be 135 degrees or 180 degrees, which is not limited in the embodiment of the present application.
Optionally, the electronic device determines a first angle comprising: determining touch information of a user and the electronic equipment when the user holds the electronic equipment; and determining the first angle according to the touch information.
In the embodiment of the application, the first angle may be determined according to touch information of a finger, a palm and the electronic device of a user when the user uses the electronic device, and the touch information may be touch information of the user and a frame or a screen of the electronic device.
For example, as shown in fig. 5, touch information of the user and the electronic device may be associated with a first angle, and the first angle may be determined according to the touch information of the user and the electronic device.
Optionally, the determining, by the electronic device, the first angle according to the touch information includes: inputting the touch information into a neural network model; the first angle is determined based on an output of the neural network model.
In the embodiment of the application, the electronic equipment can acquire the touch information of the user and the electronic equipment when the user uses the mobile phone, train the neural network model according to the touch information, and determine the first angle according to the output result of the neural network model when the user uses the electronic equipment for shooting. Alternatively, the neural network model is trained in advance, which is not limited in the embodiment of the present application.
Optionally, when the electronic device determines that the first angle is within a first preset angle range, rotating the first photo includes: and when the first angle is within a first preset angle range, rotating the first photo by the first angle anticlockwise.
Illustratively, as shown in fig. 3, if the first angle is 90 degrees, the first photo is saved by rotating 90 degrees counterclockwise, and when the user views the first photo vertically, the direction of the object 304a in the first photo 309 is the same as the direction the user sees in the viewing interface.
In the embodiment of the application, when electronic equipment judges that this first angle is in first preset angle within range, carry out anticlockwise rotation according to this first angle with the first photo of shooing, the direction that the object was shot to the target in this technical scheme can realize shooting the photo that obtains is unanimous with the direction that the user saw in electronic equipment's shooting preview interface, thereby be favorable to the user to look up the photo of shooing with normal posture, need not to rotate electronic equipment or manual rotatory photo, thereby be favorable to the comfortable photo of looking up of user, user's shooting experience has been promoted.
Optionally, an included angle between a plane where the upper surface of the electronic device is located and the horizontal plane is within a third preset angle range.
For example, the third predetermined angle range may be minus 3 degrees to 3 degrees, minus 5 degrees to 5 degrees, and the like, which is not limited in the embodiment of the present application.
The embodiment of the present application further provides an electronic device, which includes one or more processors; one or more memories; the one or more memories store one or more computer programs, the one or more computer programs including instructions, which when executed by the one or more processors, cause the electronic device to perform the method of saving images as described in any of the preceding.
It will be appreciated that the electronic device, in order to implement the above-described functions, comprises corresponding hardware and/or software modules for performing the respective functions. The present application is capable of being implemented in hardware or a combination of hardware and computer software in conjunction with the exemplary algorithm steps described in connection with the embodiments disclosed herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, with the embodiment described in connection with the particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In this embodiment, the electronic device may be divided into functional modules according to the above method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module may be implemented in the form of hardware. It should be noted that the division of the modules in this embodiment is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
The present embodiment also provides a computer-readable storage medium, in which computer instructions are stored, and when the computer instructions are executed on an electronic device, the electronic device executes the above related method steps to implement the method for saving an image in the above embodiment.
The present embodiment also provides a computer program product, which when running on a computer, causes the computer to execute the above related steps to implement the method for saving an image in the above embodiments.
In addition, embodiments of the present application also provide an apparatus, which may be specifically a chip, a component or a module, and may include a processor and a memory connected to each other; the memory is used for storing computer execution instructions, and when the device runs, the processor can execute the computer execution instructions stored in the memory, so that the chip can execute the method for saving the image in the above method embodiments.
The electronic device, the computer-readable storage medium, the computer program product, or the chip provided in this embodiment are all configured to execute the corresponding method provided above, so that the beneficial effects achieved by the electronic device, the computer-readable storage medium, the computer program product, or the chip may refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
Through the description of the above embodiments, those skilled in the art will understand that, for convenience and simplicity of description, only the division of the above functional modules is used as an example, and in practical applications, the above function distribution may be completed by different functional modules as needed, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, a module or a unit may be divided into only one logic function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (18)

1. A method for saving an image, the method being applied to an electronic device, the method comprising:
the electronic equipment responds to a first operation of a user and displays a first interface, and the first interface is a shooting preview interface of the electronic equipment;
the electronic equipment responds to the shooting operation of the user and obtains a first photo;
the electronic equipment determines a first angle, wherein the first angle is an included angle between a connecting line of the position of a first preset part and the position of a second preset part of the electronic equipment and a preset geographic direction when the first photo is obtained;
when the electronic equipment judges that the first angle is within a first preset angle range, rotating the first photo;
the electronic equipment stores the rotated first photo.
2. The method of claim 1, further comprising:
the electronic equipment detects a second operation of the user;
and the electronic equipment responds to the second operation and displays a second interface, wherein the second interface comprises the rotated first picture, and the direction of the target shooting object in the first interface is the same as the direction of the target shooting object in the second interface.
3. The method of claim 1 or 2, wherein the electronic device determines the first angle, comprising:
determining a second plane, wherein the second plane is a plane where the two eyes of the user are located;
and determining the first angle according to the information of an included angle between the normal vector of the second plane and a first plane, wherein the first plane is parallel to the plane where the upper surface of the electronic equipment is located.
4. The method of claim 3, wherein determining the first angle according to the information of the included angle between the normal vector of the second plane and the first plane comprises:
and determining the first angle according to a second preset angle range in which the angle between the normal vector of the second plane and the first plane is located.
5. The method of claim 1 or 2, wherein the electronic device determines the first angle, comprising:
determining touch information of a user and the electronic equipment when the user holds the electronic equipment;
and determining the first angle according to the touch information.
6. The method of claim 5, wherein determining the first angle from the touch information comprises:
inputting the touch information into a neural network model;
determining the first angle according to an output result of the neural network model.
7. The method of any of claims 1-6, wherein the electronic device determining that the first angle is within a first preset angle range, rotating the first photograph comprises:
when the first angle is within a first preset angle range, the first photo is rotated anticlockwise by the first angle.
8. The method according to any of claims 1-7, wherein an angle between a plane in which the upper surface of the electronic device is located and a horizontal plane is within a third predetermined angle range.
9. An electronic device, comprising:
one or more processors;
one or more memories;
the one or more memories store one or more computer programs, the one or more computer programs comprising instructions, which when executed by the one or more processors, cause the electronic device to perform the steps of:
responding to a first operation of a user, and displaying a first interface, wherein the first interface is a shooting preview interface of the electronic equipment;
responding to the shooting operation of the user, and acquiring a first photo;
determining a first angle, wherein the first angle is an included angle between a connection line of the position of a first preset part and the position of a second preset part of the electronic equipment and a preset geographic direction when the first photo is obtained;
when the first angle is judged to be within a first preset angle range, rotating the first photo;
and saving the rotated first photo.
10. The electronic device of claim 9, wherein the instructions, when executed by the one or more processors, cause the electronic device to perform the steps of:
detecting a second operation of the user;
and responding to the second operation, displaying a second interface, wherein the second interface comprises the rotated first picture, and the direction of the target shooting object in the first interface is the same as that of the target shooting object in the second interface.
11. The electronic device according to claim 9 or 10, wherein the electronic device is specifically configured to:
determining a second plane, wherein the second plane is a plane where the two eyes of the user are located;
and determining the first angle according to the information of an included angle between the normal vector of the second plane and a first plane, wherein the first plane is parallel to the plane where the upper surface of the electronic equipment is located.
12. The electronic device of claim 11, wherein the electronic device is specifically configured to:
and determining the first angle according to a second preset angle range in which the angle between the normal vector of the second plane and the first plane is located.
13. The electronic device according to claim 9 or 10, wherein the electronic device is specifically configured to:
determining touch information of a user and the electronic equipment when the user holds the electronic equipment;
and determining the first angle according to the touch information.
14. The electronic device of claim 13, wherein the electronic device is specifically configured to:
inputting the touch information into a neural network model;
determining the first angle according to an output result of the neural network model.
15. The electronic device according to any of claims 9-14, wherein the electronic device is specifically configured to:
when the first angle is within a first preset angle range, the first photo is rotated anticlockwise by the first angle.
16. The electronic device according to any of claims 9-15, wherein an angle between a plane in which the upper surface of the electronic device is located and a horizontal plane is within a third predetermined angle range.
17. A computer readable storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method of saving an image of any of claims 1 to 8.
18. A computer program product comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method of saving an image according to any one of claims 1 to 8.
CN202011295395.4A 2020-11-18 2020-11-18 Method for saving image and electronic equipment Active CN112584037B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011295395.4A CN112584037B (en) 2020-11-18 2020-11-18 Method for saving image and electronic equipment
PCT/CN2021/130540 WO2022105702A1 (en) 2020-11-18 2021-11-15 Method and electronic device for saving image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011295395.4A CN112584037B (en) 2020-11-18 2020-11-18 Method for saving image and electronic equipment

Publications (2)

Publication Number Publication Date
CN112584037A true CN112584037A (en) 2021-03-30
CN112584037B CN112584037B (en) 2023-02-07

Family

ID=75123116

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011295395.4A Active CN112584037B (en) 2020-11-18 2020-11-18 Method for saving image and electronic equipment

Country Status (2)

Country Link
CN (1) CN112584037B (en)
WO (1) WO2022105702A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022105702A1 (en) * 2020-11-18 2022-05-27 华为技术有限公司 Method and electronic device for saving image
CN115294320A (en) * 2022-10-08 2022-11-04 平安银行股份有限公司 Method and device for determining image rotation angle, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100632091B1 (en) * 2005-07-08 2006-10-04 주식회사 팬택앤큐리텔 Camera phone applied dual shot mode and control method for dual shot mode of a camera phone
CN101068309A (en) * 2007-05-24 2007-11-07 中兴通讯股份有限公司 Method and device for automatic rotating mobile terminal camera head shooting results
CN201639664U (en) * 2010-02-10 2010-11-17 青岛海信移动通信技术股份有限公司 Photographing system and mobile terminal with same
CN104252302A (en) * 2013-06-26 2014-12-31 富泰华工业(深圳)有限公司 Self-adaptive image adjusting system and method
CN106293077A (en) * 2016-07-29 2017-01-04 雷仲魁 A kind of based on human eye and the face image automatic rotating method in direction and device
CN108108114A (en) * 2017-12-19 2018-06-01 维沃移动通信有限公司 A kind of thumbnail display control method and mobile terminal
CN109451216A (en) * 2018-11-16 2019-03-08 青岛真时科技有限公司 A kind of display processing method and device shooting photo
CN109922322A (en) * 2019-04-10 2019-06-21 Oppo广东移动通信有限公司 Photographic method, image processor, camera arrangement and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105657260A (en) * 2015-12-31 2016-06-08 宇龙计算机通信科技(深圳)有限公司 Shooting method and terminal
CN112584037B (en) * 2020-11-18 2023-02-07 华为技术有限公司 Method for saving image and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100632091B1 (en) * 2005-07-08 2006-10-04 주식회사 팬택앤큐리텔 Camera phone applied dual shot mode and control method for dual shot mode of a camera phone
CN101068309A (en) * 2007-05-24 2007-11-07 中兴通讯股份有限公司 Method and device for automatic rotating mobile terminal camera head shooting results
CN201639664U (en) * 2010-02-10 2010-11-17 青岛海信移动通信技术股份有限公司 Photographing system and mobile terminal with same
CN104252302A (en) * 2013-06-26 2014-12-31 富泰华工业(深圳)有限公司 Self-adaptive image adjusting system and method
CN106293077A (en) * 2016-07-29 2017-01-04 雷仲魁 A kind of based on human eye and the face image automatic rotating method in direction and device
CN108108114A (en) * 2017-12-19 2018-06-01 维沃移动通信有限公司 A kind of thumbnail display control method and mobile terminal
CN109451216A (en) * 2018-11-16 2019-03-08 青岛真时科技有限公司 A kind of display processing method and device shooting photo
CN109922322A (en) * 2019-04-10 2019-06-21 Oppo广东移动通信有限公司 Photographic method, image processor, camera arrangement and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022105702A1 (en) * 2020-11-18 2022-05-27 华为技术有限公司 Method and electronic device for saving image
CN115294320A (en) * 2022-10-08 2022-11-04 平安银行股份有限公司 Method and device for determining image rotation angle, electronic equipment and storage medium

Also Published As

Publication number Publication date
WO2022105702A1 (en) 2022-05-27
CN112584037B (en) 2023-02-07

Similar Documents

Publication Publication Date Title
CN110536004B (en) Method for applying multiple sensors to electronic equipment with flexible screen and electronic equipment
CN110506416B (en) Method for switching camera by terminal and terminal
WO2020073959A1 (en) Image capturing method, and electronic device
CN112887583B (en) Shooting method and electronic equipment
CN112130742A (en) Full screen display method and device of mobile terminal
CN110798552A (en) Volume adjusting method and electronic equipment
CN111742539B (en) Voice control command generation method and terminal
WO2020029306A1 (en) Image capture method and electronic device
CN112527094A (en) Human body posture detection method and electronic equipment
CN110138999B (en) Certificate scanning method and device for mobile terminal
CN114650363A (en) Image display method and electronic equipment
CN110559645B (en) Application operation method and electronic equipment
CN110248037B (en) Identity document scanning method and device
CN111602108A (en) Application icon display method and terminal
CN115589051B (en) Charging method and terminal equipment
CN115484380A (en) Shooting method, graphical user interface and electronic equipment
CN114995715B (en) Control method of floating ball and related device
CN113641271A (en) Application window management method, terminal device and computer readable storage medium
WO2022105702A1 (en) Method and electronic device for saving image
CN113489895B (en) Method for determining recommended scene and electronic equipment
CN114500901A (en) Double-scene video recording method and device and electronic equipment
CN114222020B (en) Position relation identification method and device and readable storage medium
CN113467735A (en) Image adjusting method, electronic device and storage medium
CN113542574A (en) Shooting preview method under zooming, terminal, storage medium and electronic equipment
CN112532508A (en) Video communication method and video communication device

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