WO2021057626A1 - 图像处理方法、装置、设备及计算机存储介质 - Google Patents

图像处理方法、装置、设备及计算机存储介质 Download PDF

Info

Publication number
WO2021057626A1
WO2021057626A1 PCT/CN2020/116332 CN2020116332W WO2021057626A1 WO 2021057626 A1 WO2021057626 A1 WO 2021057626A1 CN 2020116332 W CN2020116332 W CN 2020116332W WO 2021057626 A1 WO2021057626 A1 WO 2021057626A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
pixel
distorted
coordinate system
camera
Prior art date
Application number
PCT/CN2020/116332
Other languages
English (en)
French (fr)
Inventor
单双
陆枭
朱应成
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021057626A1 publication Critical patent/WO2021057626A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods

Definitions

  • This application relates to the field of communication technology, and in particular to image processing methods, devices, systems, and computer storage media.
  • the embodiment of the present invention discloses an image processing method, device, equipment and storage medium, which can solve the problem that the image integrity and definition cannot be simultaneously taken into account in the existing image de-distortion scheme.
  • an embodiment of the present invention discloses an image processing method, including a terminal device acquiring a distorted image, the distorted image includes at least two distorted regions, and each distorted region includes at least one pixel in its respective pixel coordinate system The pixel coordinates. Furthermore, according to the conversion relationship between the camera coordinate system and the pixel coordinate system of each distorted area, the pixel coordinate of at least one pixel of each distorted area in the distorted image is converted into the corresponding camera coordinate. Perform de-distortion processing on the camera coordinates of at least one pixel of each distorted area in the distorted image to obtain a distorted image corresponding to the distorted image.
  • the distorted image includes a central distortion area and an edge distortion area.
  • the terminal device may convert the pixel coordinates of at least one pixel in the central distortion area into corresponding camera coordinates according to the first conversion relationship.
  • the second conversion relationship the pixel coordinates of at least one pixel in the edge distortion area are converted into corresponding camera coordinates.
  • the first conversion relationship is the conversion relationship between the camera coordinate system and the pixel coordinate system corresponding to the center distortion area
  • the second conversion relationship is the conversion relationship between the camera coordinate system and the pixel coordinate system corresponding to the edge distortion area.
  • the first conversion relationship and the second conversion relationship are different from each other.
  • the first conversion relationship is a mapping relationship established by mapping a connection line between a coordinate point in the camera coordinate system and the optical center of the camera to a plane image in the first image coordinate system.
  • the second conversion relationship is the mapping relationship established by mapping the connection line between the coordinate point in the camera coordinate system and the optical center of the camera to the plane image in the second image coordinate system.
  • the first image coordinate system and the second image coordinate system are respectively located on the plane Different from each other.
  • the terminal device can adjust the focal length of the edge distortion area according to the camera internal parameters of the central distortion area to obtain the target focal length of the edge distortion area, and the target focal length is related to the second conversion relationship.
  • the adjustment of the target focal length needs to meet the following conditions: the sharpness of the edge distortion area exceeds the first threshold; the number of characteristic pixels in the edge distortion area exceeds the second threshold; where The edge distortion area is an image area obtained by performing distortion removal processing on the camera coordinates of at least one pixel in the edge distortion area.
  • the de-distorted image includes a continuous multi-frame de-distorted image.
  • the terminal device can also perform feature extraction on multi-frame de-distorted images to obtain the characteristic pixels in each frame of the de-distorted image; and then track the characteristic pixels in each frame of the de-distorted image to obtain the camera corresponding to the multi-frame de-distorted image attitude.
  • an embodiment of the present application provides an image processing device, which includes a functional device, such as a module or unit, for executing the method described in the first aspect or any possible implementation of the first aspect. .
  • the embodiments of the present application provide a terminal device, the node includes: a processor, a memory, a communication interface, and a bus; the processor, the communication interface, and the memory communicate with each other through the bus; the communication interface is used to receive and send data
  • the memory is used to store instructions; the processor is used to call the instructions in the memory to execute the method described in the first aspect or any possible implementation of the first aspect.
  • a computer-readable storage medium stores program codes for network congestion control.
  • the program code includes instructions for executing the method described in the first aspect or any possible implementation of the first aspect.
  • a chip product is provided to implement the foregoing first aspect or the method in any possible implementation manner of the first aspect.
  • FIG. 1 is a schematic diagram of image changes in image de-distortion processing provided by the prior art
  • FIG. 2 is a schematic diagram of image changes in another image de-distortion processing provided by the prior art
  • FIG. 3 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a software architecture of a terminal device according to an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart of an image processing method provided by an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of image partition provided by an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a scenario for establishing a first conversion relationship according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a scenario for establishing a second conversion relationship according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of changes in a deformed image provided by an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of a characteristic pixel provided by an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of another terminal device provided by an embodiment of the present invention.
  • the traditional image de-distortion scheme usually adopts the following two specific implementation schemes.
  • the first is to discard pixels that exceed the size of the image on the premise of ensuring the image quality.
  • FIG. 1 for a schematic diagram of image changes before and after the distortion is removed.
  • (a) is the left image
  • (b) is the right image.
  • the image on the left is the distorted image
  • the image on the right is the image after de-distortion processing, which is referred to as the de-distorted image for short.
  • the terminal device uses known calibration parameters (such as de-distortion parameters) to perform de-distortion processing on the coordinate points in the distorted image, discarding pixels that exceed the size of the image, and obtains the de-distorted image shown in (b) .
  • known calibration parameters such as de-distortion parameters
  • the second is to perform de-distortion processing on the distorted image without losing image information.
  • FIG. 2 for another schematic diagram of image changes before and after distortion removal. As shown in Figure 2, (a) is the left image, and (b) is the right image. Without loss of image information, the terminal device can adjust the parameters (such as resolution, etc.) of the distorted image to ensure that the image size of the distorted image and the distorted image are the same, and the image information in the distorted image is completely retained.
  • FIG. 3 is a schematic structural diagram of a terminal device provided by the present invention.
  • a processor 210 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, and a battery 242 , Antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, audio module 270, speaker 270A, receiver 270B, microphone 270C, earphone interface 270D, sensor module 280, buttons 290, motor 291, indicator 292, camera 293 , The display screen 294, and the subscriber identification module (SIM) card interface 295, etc.
  • SIM subscriber identification module
  • the sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, and ambient light Sensor 280L, bone conduction sensor 280M, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device 100.
  • the terminal device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 210 may include one or more processing units.
  • the processor 210 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 210 for storing instructions and data.
  • the memory in the processor 210 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 210. If the processor 210 needs to use the instruction or data again, it can be directly called from the memory. Repeated access is avoided, the waiting time of the processor 210 is reduced, and the efficiency of the system is improved.
  • the processor 210 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transceiver (universal asynchronous) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the I2C interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 210 may include multiple sets of I2C buses.
  • the processor 210 may be coupled to the touch sensor 280K, charger, flash, camera 293, etc., respectively through different I2C bus interfaces.
  • the processor 210 may couple the touch sensor 280K through an I2C interface, so that the processor 210 and the touch sensor 280K communicate through the I2C bus interface to implement the touch function of the terminal device 100.
  • the I2S interface can be used for audio communication.
  • the processor 210 may include multiple sets of I2S buses.
  • the processor 210 may be coupled with the audio module 270 through an I2S bus to implement communication between the processor 210 and the audio module 270.
  • the audio module 270 may transmit audio signals to the wireless communication module 260 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communication to sample, quantize and encode analog signals.
  • the audio module 270 and the wireless communication module 260 may be coupled through a PCM bus interface.
  • the audio module 270 may also transmit audio signals to the wireless communication module 260 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 210 and the wireless communication module 260.
  • the processor 210 communicates with the Bluetooth module in the wireless communication module 260 through the UART interface to realize the Bluetooth function.
  • the audio module 270 may transmit audio signals to the wireless communication module 260 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 210 with the display screen 294, the camera 293 and other peripheral devices.
  • the MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on.
  • the processor 210 and the camera 293 communicate through a CSI interface to implement the shooting function of the terminal device 100.
  • the processor 210 and the display screen 294 communicate through a DSI interface to implement the display function of the terminal device 100.
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 210 with the camera 293, the display screen 294, the wireless communication module 260, the audio module 270, the sensor module 280, and so on.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 230 is an interface that complies with the USB standard specifications, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
  • the USB interface 230 can be used to connect a charger to charge the terminal device 100, and can also be used to transfer data between the terminal device 100 and peripheral devices. It can also be used to connect headphones and play audio through the headphones. This interface can also be used to connect to other terminal devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic description, and does not constitute a structural limitation of the terminal device 100.
  • the terminal device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 240 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 240 may receive the charging input of the wired charger through the USB interface 230.
  • the charging management module 240 may receive the wireless charging input through the wireless charging coil of the terminal device 100. While the charging management module 240 charges the battery 242, it can also supply power to the terminal device through the power management module 241.
  • the power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210.
  • the power management module 241 receives input from the battery 242 and/or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the display screen 294, the camera 293, and the wireless communication module 260.
  • the power management module 241 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 241 may also be provided in the processor 210.
  • the power management module 241 and the charging management module 240 may also be provided in the same device.
  • the wireless communication function of the terminal device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 250 may provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the terminal device 100.
  • the mobile communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like.
  • the mobile communication module 250 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation.
  • the mobile communication module 250 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 250 may be provided in the processor 210.
  • at least part of the functional modules of the mobile communication module 250 and at least part of the modules of the processor 210 may be provided in the same device.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor.
  • the application processor outputs a sound signal through an audio device (not limited to a speaker 270A, a receiver 270B, etc.), or displays an image or video through the display screen 294.
  • the modem processor may be an independent device.
  • the modem processor may be independent of the processor 210 and be provided in the same device as the mobile communication module 250 or other functional modules.
  • the wireless communication module 260 can provide applications on the terminal device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 260 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 260 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210.
  • the wireless communication module 260 may also receive a signal to be sent from the processor 210, perform frequency modulation, amplify, and convert it into electromagnetic waves to radiate through the antenna 2.
  • the antenna 1 of the terminal device 100 is coupled with the mobile communication module 250, and the antenna 2 is coupled with the wireless communication module 260, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite-based augmentation systems
  • the terminal device 100 implements a display function through a GPU, a display screen 294, and an application processor.
  • the GPU is an image processing microprocessor, which is connected to the display screen 294 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 210 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 294 is used to display images, videos, and the like.
  • the display screen 294 includes a display panel.
  • the display panel can use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active matrix organic light-emitting diode active-matrix organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the terminal device 100 can implement a shooting function through an ISP, a camera 293, a video codec, a GPU, a display screen 294, and an application processor.
  • the ISP is used to process the data fed back by the camera 293. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 293.
  • the camera 293 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the terminal device 100 may include 1 or N cameras 293, and N is a positive integer greater than 1.
  • the camera 293 includes, but is not limited to, a fisheye camera, a digital camera, an analog camera, and the like.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the terminal device 100 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the terminal device 100 may support one or more video codecs. In this way, the terminal device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, and so on.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • applications such as intelligent cognition of the terminal device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
  • the external memory interface 220 may be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the terminal device 100.
  • the external memory card communicates with the processor 210 through the external memory interface 220 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 221 may be used to store computer executable program code, where the executable program code includes instructions.
  • the internal memory 221 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the terminal device 100.
  • the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • the processor 210 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 221 and/or instructions stored in a memory provided in the processor.
  • the terminal device 100 can implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headset interface 270D, and an application processor. For example, music playback, recording, etc.
  • the audio module 270 is used for converting digital audio information into an analog audio signal for output, and also for converting an analog audio input into a digital audio signal.
  • the audio module 270 can also be used to encode and decode audio signals.
  • the audio module 270 may be provided in the processor 210, or part of the functional modules of the audio module 270 may be provided in the processor 210.
  • the speaker 270A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the terminal device 100 can listen to music through the speaker 270A, or listen to a hands-free call.
  • the receiver 270B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the terminal device 100 answers a call or voice message, it can receive the voice by bringing the receiver 270B close to the human ear.
  • Microphone 270C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 270C through the human mouth, and input the sound signal into the microphone 270C.
  • the terminal device 100 may be provided with at least one microphone 270C.
  • the terminal device 100 may be provided with two microphones 270C, which can implement noise reduction functions in addition to collecting sound signals.
  • the terminal device 100 may also be provided with three, four or more microphones 270C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
  • the earphone interface 270D is used to connect wired earphones.
  • the earphone interface 270D may be a USB interface 230, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 280A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 280A may be provided on the display screen 294.
  • the capacitive pressure sensor may include at least two parallel plates with conductive materials. When a force is applied to the pressure sensor 280A, the capacitance between the electrodes changes. The terminal device 100 determines the strength of the pressure according to the change in capacitance. When a touch operation acts on the display screen 294, the terminal device 100 detects the intensity of the touch operation according to the pressure sensor 280A.
  • the terminal device 100 may also calculate the touched position based on the detection signal of the pressure sensor 280A.
  • touch operations that act on the same touch position but have different touch operation strengths may correspond to different operation instructions. For example, when a touch operation whose intensity of the touch operation is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
  • the gyro sensor 280B may be used to determine the movement posture of the terminal device 100.
  • the angular velocity of the terminal device 100 around three axes ie, x, y, and z axes
  • the gyro sensor 280B can be used for image stabilization.
  • the gyroscope sensor 280B detects the shaking angle of the terminal device 100, and calculates the distance to be compensated by the lens module according to the angle, and allows the lens to counteract the shaking of the terminal device 100 through a reverse movement to achieve anti-shake.
  • the gyroscope sensor 280B can also be used for navigation and somatosensory game scenes.
  • the air pressure sensor 280C is used to measure air pressure. In some embodiments, the terminal device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 280C to assist positioning and navigation.
  • the magnetic sensor 280D includes a Hall sensor.
  • the terminal device 100 may use the magnetic sensor 280D to detect the opening and closing of the flip holster.
  • the terminal device 100 when the terminal device 100 is a flip machine, the terminal device 100 can detect the opening and closing of the flip according to the magnetic sensor 280D.
  • features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 280E can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes). When the terminal device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the terminal device, applied to horizontal and vertical screen switching, pedometer and other applications.
  • the terminal device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the terminal device 100 may use the distance sensor 280F to measure the distance to achieve fast focusing.
  • the proximity light sensor 280G 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 terminal device 100 emits infrared light to the outside through the light emitting diode.
  • the terminal device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device 100. When insufficient reflected light is detected, the terminal device 100 can determine that there is no object near the terminal device 100.
  • the terminal device 100 can use the proximity light sensor 280G to detect that the user holds the terminal device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the proximity light sensor 280G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
  • the ambient light sensor 280L is used to sense the brightness of the ambient light.
  • the terminal device 100 can adaptively adjust the brightness of the display screen 294 according to the perceived brightness of the ambient light.
  • the ambient light sensor 280L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 280L can also cooperate with the proximity light sensor 280G to detect whether the terminal device 100 is in a pocket to prevent accidental touch.
  • the fingerprint sensor 280H is used to collect fingerprints.
  • the terminal device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
  • the temperature sensor 280J is used to detect temperature.
  • the terminal device 100 uses the temperature detected by the temperature sensor 280J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 280J exceeds a threshold value, the terminal device 100 reduces the performance of the processor located near the temperature sensor 280J, so as to reduce power consumption and implement thermal protection.
  • the terminal device 100 when the temperature is lower than another threshold, the terminal device 100 heats the battery 242 to avoid abnormal shutdown of the terminal device 100 due to low temperature.
  • the terminal device 100 boosts the output voltage of the battery 242 to avoid abnormal shutdown caused by low temperature.
  • the touch sensor 280K is also called “touch device”.
  • the touch sensor 280K may be disposed on the display screen 294, and the touch screen is composed of the touch sensor 280K and the display screen 294, which is also called a “touch screen”.
  • the touch sensor 280K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation can be provided through the display screen 294.
  • the touch sensor 280K may also be disposed on the surface of the terminal device 100, which is different from the position of the display screen 294.
  • the bone conduction sensor 280M can acquire vibration signals.
  • the bone conduction sensor 280M can acquire the vibration signal of the vibrating bone mass of the human voice.
  • the bone conduction sensor 280M can also contact the human pulse and receive the blood pressure pulse signal.
  • the bone conduction sensor 280M may also be provided in the earphone, combined with the bone conduction earphone.
  • the audio module 270 can parse out the voice signal based on the vibration signal of the vibrating bone block of the voice obtained by the bone conduction sensor 280M to realize the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beating signal obtained by the bone conduction sensor 280M, and realize the heart rate detection function.
  • the button 290 includes a power button, a volume button, and so on.
  • the button 290 may be a mechanical button. It can also be a touch button.
  • the terminal device 100 may receive key input, and generate key signal input related to user settings and function control of the terminal device 100.
  • the motor 291 can generate vibration prompts.
  • the motor 291 can be used for incoming call vibration notification, and can also be used for touch vibration feedback.
  • touch operations that act on different applications can correspond to different vibration feedback effects.
  • Acting on touch operations in different areas of the display screen 294, the motor 291 can also correspond to different vibration feedback effects.
  • Different application scenarios for example: time reminding, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 292 can be an indicator light, which can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 295 is used to connect to the SIM card.
  • the SIM card can be inserted into the SIM card interface 295 or pulled out from the SIM card interface 295 to achieve contact and separation with the terminal device 100.
  • the terminal device 100 may support 1 or N SIM card interfaces, and N is a positive integer greater than 1.
  • the SIM card interface 295 may support Nano SIM cards, Micro SIM cards, SIM cards, etc.
  • the same SIM card interface 295 can insert multiple cards at the same time. The types of the multiple cards can be the same or different.
  • the SIM card interface 295 can also be compatible with different types of SIM cards.
  • the SIM card interface 295 may also be compatible with external memory cards.
  • the terminal device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
  • the terminal device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.
  • the software system of the terminal device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • an Android system with a layered architecture is taken as an example to illustrate the software structure of the terminal device 100 by way of example.
  • FIG. 4 is a software structure block diagram of a terminal device 100 according to an embodiment of the present invention.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
  • the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
  • the application layer can include a series of application packages.
  • the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions. As shown in Figure 3, the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and so on.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the terminal device 100. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can disappear automatically after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, and so on.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window.
  • prompt text information in the status bar sound a prompt tone, terminal equipment vibration, flashing indicator light, etc.
  • Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
  • the application layer and the application framework layer run in a virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to realize 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the corresponding hardware interrupt is sent to the kernel layer.
  • the kernel layer processes the touch operation into the original input event (including touch coordinates, time stamp of the touch operation, etc.).
  • the original input events are stored in the kernel layer.
  • the application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and the control corresponding to the click operation is the control of the camera application icon as an example, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer.
  • the camera 293 captures still images or videos.
  • FIG. 5 is a schematic flowchart of an image processing method according to an embodiment of the present invention.
  • the method shown in Figure 5 includes the following implementation steps:
  • the terminal device acquires a distorted image, where the distorted image includes at least two distorted regions, and each distorted region includes pixel coordinates of at least one pixel in its respective pixel coordinate system.
  • the terminal device in the embodiment of the present invention may acquire a distorted image, and the distorted image may be acquired by the terminal device through a camera, or may be received from another device (for example, a server). After obtaining the distorted image, the terminal device may perform partition processing (also called block processing) on the distorted image, so as to obtain at least two distorted regions that make up the distorted image. Each distortion area corresponds to a pixel coordinate system.
  • FIG. 6 a schematic diagram of a distorted image partition.
  • the terminal device divides the distorted image into 5 parts, as shown in the figure: upper edge distortion area, lower edge distortion area, left edge distortion area, right edge distortion area, and center distortion area.
  • Each distortion area corresponds to its own pixel coordinate system, as shown in Figure 6, the pixel coordinate system uo p v of the central distortion area is given as an example.
  • the pixel coordinates of any pixel in each distortion area can be expressed as (u, v),
  • the values of u and v are related to the position and size of the distorted area in the distorted image. For example, if the distorted image is a 1000*1000 image, the pixel coordinate u of any pixel in the central distortion area is between -250 and 250, and v is between -250 and 250.
  • the terminal device converts the pixel coordinates of at least one pixel of each distortion area in the distorted image into corresponding camera coordinates according to the conversion relationship between the camera coordinate system and the pixel coordinate system of each distortion area.
  • the terminal device obtains the conversion relationship between the camera coordinate system and the pixel coordinate system of each distorted area in the distorted image, and then converts the pixel coordinates of at least one pixel in the distorted area in the distorted image to the corresponding camera according to the conversion relationship. coordinate. Since the pixel coordinate system of each distorted area in the distorted image is different, the conversion relationship between the camera coordinate system and the pixel coordinate system of each distorted area is also different. For the convenience of the present invention, the conversion relationship between the pixel coordinate system of the center distortion area and the camera coordinate system is called the first conversion relationship, and the conversion relationship between the pixel coordinate system of the edge distortion area and the camera coordinate system is called the first conversion relationship. 2. Conversion relationship.
  • the edge distortion area can also be subdivided into upper edge distortion area, lower edge distortion area, left edge distortion area, etc., which can be divided according to the actual needs of users.
  • the pixel coordinate system and camera coordinates of each edge distortion area The conversion relationship between departments should also be different.
  • the present invention is described here in a unified description taking the edge distortion area as an example to explain the related content, but it does not constitute a limitation.
  • the terminal device may use a commonly used pinhole model to create the first conversion relationship between the pixel coordinate system of the center distortion area and the camera coordinate system.
  • FIG. 7 for a schematic diagram showing the creation of the first conversion relationship under the pinhole model.
  • the terminal device directly maps any coordinate point in the space under the camera coordinate system to the optical center of the camera and directly maps it to the same image plane, thereby establishing a connection between the image coordinate system and the camera coordinate system. Mapping relations.
  • the image plane may be the image plane where the distorted image is located, that is, the image screen where the central distortion area is located in the first image coordinate system.
  • the terminal device translates the center of the pixel coordinate system to the center of the distorted image so as to obtain the image coordinate system of the distorted image.
  • the first conversion relationship between the pixel coordinate system of the center edge area and the camera coordinate system is also established.
  • the first conversion relationship is related to the size of the center edge area, the size A*B of the distorted image, and the focal length f0 of the center edge area.
  • the terminal device uses the first conversion relationship to convert the pixel coordinates (u0, v0) into camera coordinates in the camera coordinate system (x0, y0).
  • x0 H1(u0, A, f0)
  • y0 H2(v0, B, f0)
  • H1 and H2 represent the first conversion relationship.
  • the terminal device uses a block pinhole model to create a second conversion relationship between the pixel coordinate system of the edge distortion area and the camera coordinate system.
  • FIG. 8 shows a schematic diagram of creating a second conversion relationship based on the block-based pinhole model.
  • the terminal device can regard the camera optical center as the center of a cube, and map the connection line between any coordinate point in the camera coordinate system and the camera optical center to image planes in different image coordinate systems, thereby establishing different images The mapping relationship between the coordinate system and the camera coordinate system.
  • the image planes of the different image coordinate systems may specifically correspond to image planes corresponding to different edge distortion regions on different sides of the cube.
  • the image plane in the image coordinate system where the upper edge distortion area is located can be regarded as an image plane formed by rotating the image plane corresponding to the central distortion area by 90 degrees.
  • the pixel coordinate (u1, v1) of any pixel in the above edge distortion area is taken as an example, and the terminal device uses the second conversion relationship to convert the pixel coordinate (u1, v1) into the camera coordinate (u1, v1) in the camera coordinate system ( x1, y1).
  • x1 H3(u1, A, f1)
  • y0 H4(v1, B, f1)
  • H3 and H4 represent the second conversion relationship
  • f1 is the focal length of the upper edge area.
  • the focal length of each distorted area in the distorted image may be the same or different.
  • the focal length of each distortion area is regarded as the same as the shooting focal length f of the distorted image.
  • the terminal device performs de-distortion processing on the camera coordinates of at least one pixel of each distorted area in the distorted image to obtain a distorted image corresponding to the distorted image.
  • the terminal device After the terminal device obtains the camera coordinates of at least one pixel of each distorted area in the distorted image, it can use a preset de-distortion formula to perform de-distortion processing on the camera coordinates of all pixels in each distorted area to obtain the distorted area Corresponding de-distortion area.
  • the corresponding de-distortion formulas used for different distorted regions in the distorted image may be the same or different, which is not limited in the present invention.
  • the terminal device uses the first de-distortion formula to de-distort the camera coordinates of all pixels in the central distortion area to the corresponding central de-distortion area, and uses the second de-distortion formula to de-distort the camera coordinates of all pixels in the edge distortion area.
  • the de-distortion becomes the corresponding edge de-distortion area.
  • the first de-distortion formula and the second de-distortion formula may be preset by the system, which is not limited by the present invention.
  • the camera coordinates of the pixels after de-distortion can be correspondingly obtained. Further according to the conversion relationship between the pixel coordinate system of the distortion area and the camera coordinate system, the camera coordinates of the pixel after the distortion are correspondingly converted into the pixel coordinates of the pixel after the distortion. For example, assuming that the pixel coordinates of a pixel in the central distortion area are (u0, v0), the corresponding camera coordinates of the pixel in the camera coordinate system are (x0, y0).
  • FIG. 9 shows a schematic diagram of changes before and after image distortion. As shown in Fig. 9, (a) is a distorted image collected by a fisheye lens, and (b) is a distorted image obtained after de-distorting (a).
  • the terminal device may also adjust the focal length of each edge distortion area to obtain the target focal length of the edge distortion area after adjustment.
  • the terminal device can adjust the focal length f1 of the upper edge distortion area.
  • the terminal device may adjust the focal length fi of the edge distortion area according to a preset rule, which is self-defined by the system, such as increasing or decreasing the focal length fi of the edge distortion area according to a fixed step.
  • the target focal length of the edge distortion area after adjustment needs to meet the following conditions: 1The sharpness of the edge distortion area exceeds the first threshold; 2The number of characteristic pixels in the edge distortion area exceeds the second threshold.
  • the edge de-distortion area refers to the image area obtained after the edge distortion area is de-distorted, and the central de-distortion area refers to the image area obtained after the central distortion area is de-distorted.
  • the terminal device may analyze the sharpness of the edge distortion area, and if the sharpness exceeds the first threshold, then The adjusted focal length can be used as the target focal length of the edge distortion area.
  • the definition of the edge de-distortion area can be specifically reflected by image indicators such as resolution and sharpness.
  • the terminal device after the terminal device calculates the corresponding edge distortion area according to the adjusted focal length of the edge distortion area, it can extract the characteristic pixel points in the edge distortion area. If the number of the characteristic pixel points exceeds the second Threshold, the adjusted focal length can be used as the target focal length of the edge distortion area.
  • the present invention reflects the retention of image information in the edge de-distortion area by the number of characteristic pixels in the edge de-distortion area. The more characteristic pixels, the greater the retention of image information and the better the quality of the image area.
  • the first threshold and the second threshold may be specifically set by the system, such as an empirical value set based on user experience, or a value calculated based on a series of statistical data. They may be the same or different, and the present invention is not limited.
  • the terminal device can correspondingly obtain the continuous multi-frame de-distorted image.
  • the terminal device can also use a preset feature extraction algorithm to perform feature extraction on the multi-frame de-distorted image to obtain characteristic pixels in each frame of the de-distorted image.
  • the feature extraction algorithm can be pre-configured by the system, and it can include but not limited to local binary patterns (LBP) algorithm, scale-invariant feature transform (SIFT) algorithm, directional gradient histogram Figure (histogram of oriented gradient, HOG) feature extraction algorithm, or other feature extraction algorithms, etc. Exemplarily, FIG.
  • the pixels shown by circles in the de-distorted image are characteristic pixels.
  • the pixels shown in the gray circles are characteristic pixels in the central de-distortion area
  • the pixels shown in the white circles are the characteristic pixels in the edge de-distortion area.
  • the terminal device can perform pixel tracking on the characteristic pixels in each frame of the dedistorted image to obtain the camera posture corresponding to the multiple frames of the dedistorted image.
  • the terminal device may use a preset pixel tracking algorithm to perform pixel tracking on the characteristic pixels of each frame of the multi-frame de-distorted image, so as to identify and obtain the camera posture corresponding to the multi-frame de-distorted image.
  • the present invention is suitable for any image processing scenarios, such as image recognition, simultaneous localization and mapping (simultaneous localization and mapping, SLAM) scenarios.
  • the effect of the de-distorted image can be defined by some reference indicators in a specific application scenario.
  • the adjustment of the focal length of each distorted area in the distorted image by the terminal device can be determined by the camera posture obtained by tracking the distorted image corresponding to the distorted image. For example, if the error between the calculated camera posture and the real camera posture is small, the adjusted focal length corresponding to each deformed area in the deformed image is regarded as the target focal length of the area, which is not limited in the present invention.
  • the embodiment of the present invention may divide the device into functional modules according to the foregoing method examples.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software function modules. It should be noted that the division of modules in the embodiment of the present invention is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 11 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
  • the terminal device 100 also referred to as an image processing apparatus as shown in FIG. 11 includes an acquisition module 102, a conversion module 104, and a processing module 106. among them,
  • the acquiring module 102 is configured to acquire a distorted image, the distorted image including at least two distorted regions, and each distorted region includes the pixel coordinates of at least one pixel in its respective pixel coordinate system;
  • the conversion module 104 is configured to convert the pixel coordinates of at least one pixel of each distortion area in the distorted image to the corresponding camera according to the conversion relationship between the camera coordinate system and the pixel coordinate system of each distortion area coordinate;
  • the processing module 106 is configured to perform de-distortion processing on the camera coordinates of at least one pixel of each distorted area in the distorted image to obtain a distorted image corresponding to the distorted image.
  • the distorted image includes a center distortion area and an edge distortion area
  • the conversion module 104 is specifically configured to convert the pixel coordinate of at least one pixel in the center distortion area according to the first conversion relationship. Is the corresponding camera coordinate; according to the second conversion relationship, the pixel coordinate of at least one pixel in the edge distortion area is converted into the corresponding camera coordinate; wherein, the first conversion relationship is the camera coordinate system and the center distortion
  • the conversion relationship between the pixel coordinate systems of the area, the second conversion relationship is a conversion relationship between the camera coordinate system and the pixel coordinate system of the edge distortion area, and the first conversion relationship and the second conversion relationship different.
  • the first conversion relationship is a mapping relationship established by mapping a connection line between a coordinate point in the camera coordinate system and the optical center of the camera to a plane image in the first image coordinate system
  • the second The conversion relationship is a mapping relationship established by mapping a connection line between a coordinate point in the camera coordinate system and the optical center of the camera to a plane image in the second image coordinate system.
  • the device further includes an adjustment module 108.
  • the adjustment module 108 is configured to adjust the focal length of the edge distortion area according to the camera internal parameters of the central distortion area to obtain the target focal length of the edge distortion area, and the target focal length is related to the second conversion relationship .
  • the adjustment of the target focal length needs to meet at least one of the following: the smoothness between the edge distortion area and the center distortion area exceeds a first threshold; the sharpness of the edge distortion area exceeds The second threshold; the number of characteristic pixels in the edge distortion area exceeds the third threshold; wherein, the edge distortion area is an image obtained after the camera coordinates of at least one pixel in the edge distortion area are subjected to distortion processing Area, the central de-distortion area is an image area obtained by performing de-distortion processing on camera coordinates of at least one pixel in the central distortion area.
  • the de-distorted image includes a continuous multi-frame de-distorted image
  • the device further includes an extraction module 110 and a tracking module 112.
  • the extraction module 110 is used to perform feature extraction on the multi-frame de-distorted image to obtain characteristic pixel points in each frame of the de-distorted image
  • the tracking module 112 is used to perform feature extraction on the de-distorted image in each frame The characteristic pixel points are tracked to obtain the camera pose corresponding to the multi-frame de-distorted image.
  • the device of the embodiment of the present invention may be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD).
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the above-mentioned PLD may be a complex program logic device ( complex programmable logical device (CPLD), field-programmable gate array (field-programmable gate array, FPGA), generic array logic (GAL) or any combination thereof.
  • CPLD complex programmable logical device
  • FPGA field-programmable gate array
  • GAL generic array logic
  • the related description of the above method embodiments can also be implemented by software, and each module in the node can also be a software unit.
  • FIG. 11 is only a possible implementation of the embodiment of the present application.
  • the image processing apparatus may also include more or fewer components, which is not limited here.
  • the principle of solving the problem of the terminal device provided in the embodiment of this application is similar to the principle of solving the problem of the terminal device in the embodiment of the method of this application. Therefore, the implementation of each device can refer to the implementation of the method. For concise description, here No longer.
  • the embodiment of the present invention also provides a computer non-transitory storage medium, the computer non-transitory storage medium stores instructions, and when it runs on a processor, the method flow described in the method embodiment shown in FIG. 5 Achieved.
  • the embodiment of the present application also provides a computer program product.
  • the computer program product runs on a processor, the method flow described in the method embodiment shown in FIG. 5 is realized.
  • the steps of the method or algorithm described in combination with the disclosure of the embodiments of the present application may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions.
  • Software instructions can be composed of corresponding software modules, which can be stored in random access memory (English: Random Access Memory, RAM), flash memory, read-only memory (English: Read Only Memory, ROM), erasable and programmable Read-only memory (English: Erasable Programmable ROM, EPROM), electrically erasable programmable read-only memory (English: Electrically EPROM, EEPROM), register, hard disk, mobile hard disk, CD-ROM or well-known in the art Any other form of storage medium.
  • An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium.
  • the storage medium may also be an integral part of the processor.
  • the processor and the storage medium may be located in the ASIC.
  • the ASIC may be located in the terminal device.
  • the processor and the storage medium may also exist as discrete components in the terminal device.
  • the program can be stored in a computer readable storage medium, and the program can be stored in a computer readable storage medium. When executed, it may include the procedures of the above-mentioned method embodiments.
  • the aforementioned storage media include: ROM, RAM, magnetic disks or optical disks and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Studio Devices (AREA)

Abstract

本发明实施例公开了一种图像处理方法、装置、设备及计算机存储介质,所述方法包括:终端设备获取畸变图像,该畸变图像包括至少两个畸变区域,每个畸变区域在各自像素坐标系中包括有至少一个像素点的像素坐标。根据相机坐标系和每个畸变区域的像素坐标系之间的转换关系,将畸变图像中每个畸变区域的至少一个像素点的像素坐标转换为对应的相机坐标,然后对畸变图像中每个畸变区域的至少一个像素点的相机坐标进行去畸变处理,得到该畸变图像对应的去畸变图像。采用本发明,能够解决现有图像去畸变方案中无法同时兼顾图像完整度及清晰度的问题。

Description

图像处理方法、装置、设备及计算机存储介质
本申请要求于2019年9月23日提交中国专利局、申请号为201910903319.8、申请名称为“图像处理方法、装置、设备及计算机存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及图像处理方法、装置、系统及计算机存储介质。
背景技术
目前,计算机视觉技术已广泛应用于医疗、交通、工业等领域,为获得更大图像视角以得到更多的场景信息,人们常常采用鱼眼镜头来采集场景图像。但是,鱼眼镜头拍摄的图像存在畸变、失真较大,对后续图像处理及应用带来很大的不便。
传统图像去畸变方案中,常采用预设的标定参数对畸变图像进行矫正。然而在实践中发现,若想保证图像质量,会造成大量图像信息的损失,严重影响图像完整度。若想保留所有图像信息,则会造成大量有效图像信息精度(即分辨率)的降低,导致图像清晰度较低。
发明内容
本发明实施例公开了一种图像处理方法、装置、设备及存储介质,能够解决现有图像去畸变方案中无法同时兼顾图像完整度及清晰度的问题。
第一方面,本发明实施例公开提供了一种图像处理方法,包括终端设备获取畸变图像,该畸变图像包括至少两个畸变区域,每个畸变区域在各自像素坐标系中包括有至少一个像素点的像素坐标。进而,根据相机坐标系和每个畸变区域的像素坐标系之间的转换关系,将畸变图像中每个畸变区域的至少一个像素点的像素坐标转换为对应的相机坐标。对该畸变图像中每个畸变区域的至少一个像素点的相机坐标进行去畸变处理,得到与该畸变图像对应的去畸变图像。
通过实施本发明实施例,能够解决现有技术中存在的无法同时保证图像精度及清晰度的问题。
结合第一方面,在一些可能的实施例中,该畸变图像包括中心畸变区域和边缘畸变区域。终端设备可根据第一转换关系,将中心畸变区域中至少一个像素点的像素坐标转换为对应的相机坐标。根据第二转换关系,将边缘畸变区域中至少一个像素点的像素坐标转换为对应的相机坐标。其中,该第一转换关系为相机坐标系与中心畸变区域对应的像素坐标系之间的转换关系,第二转换关系为相机坐标系与边缘畸变区域对应的像素坐标系之间的转换关系,该第一转换关系和第二转换关系互不相同。
结合第一方面,在一些可能的实施例中,第一转换关系为相机坐标系中的坐标点与相机光心的连线映射到第一图像坐标系下的平面图像而建立的映射关系,第二转换关系为相 机坐标系中的坐标点与相机光心的连线映射到第二图像坐标系下的平面图像而建立的映射关系,第一图像坐标系和第二图像坐标系各自位于的平面互不相同。
结合第一方面,在一些可能的实施例中,终端设备可根据中心畸变区域的相机内参,对边缘畸变区域的焦距进行调整,得到边缘畸变区域的目标焦距,该目标焦距和第二转换关系有关。
结合第一方面,在一些可能的实施例中,目标焦距的调整需满足以下条件:边缘去畸变区域的清晰度超过第一阈值;边缘去畸变区域中特征像素点的数量超过第二阈值;其中,所述边缘去畸变区域为对所述边缘畸变区域中至少一个像素点的相机坐标进行去畸变处理后得到的图像区域。
结合第一方面,在一些可能的实施例中,去畸变图像包括连续的多帧去畸变图像。终端设备还可对多帧去畸变图像进行特征提取,得到每帧去畸变图像中的特征像素点;进而对每帧去畸变图像中的特征像素点进行追踪,得到多帧去畸变图像对应的相机姿态。
第二方面,本申请实施例提供了一种图像处理装置,该装置包括用于执行如上第一方面或第一方面的任意可能的实施方式中所描述的方法的功能器件,例如模块或单元等。
第三方面,本申请实施例提供了一种终端设备,该节点包括:处理器,存储器,通信接口和总线;处理器、通信接口、存储器通过总线相互通信;通信接口,用于接收和发送数据;存储器,用于存储指令;处理器,用于调用存储器中的指令,执行上述第一方面或第一方面的任意可能的实施方式中所描述的方法。
第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储了用于网络拥塞控制的程序代码。所述程序代码包括用于执行上述第一方面或第一方面的任意可能的实施方式中所描述的方法的指令。
第五方面,提供了一种芯片产品,以执行上述第一方面或第一方面的任意可能的实施方式中的方法。
本发明在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。
图1是现有技术提供的图像去畸变处理的图像变化示意图;
图2是现有技术提供的另一种图像去畸变处理的图像变化示意图;
图3是本发明实施例提供的一种终端设备的结构示意图;
图4是本发明实施例提供的一种终端设备的软件架构的示意图;
图5是本发明实施例提供的一种图像处理方法的流程示意图;
图6是本发明实施例提供的一种图像分区示意图;
图7是本发明实施例提供的一种第一转换关系建立的场景示意图;
图8是本发明实施例提供的一种第二转换关系建立的场景示意图;
图9是本发明实施例提供的一种去畸变图像的变化示意图;
图10是本发明实施例提供的一种特征像素点的示意图;
图11是本发明实施例提供的另一种终端设备的结构示意图。
具体实施方式
下面将结合本发明的附图,对本发明实施例中的技术方案进行详细描述。
目前,传统图像去畸变方案通常采用以下两种具体实施方案。第一种,在保证图像质量的前提下,舍弃超出图像大小的像素点。请参见图1示出一种去畸变前后的图像变化示意图。如图1,(a)为左侧图像,(b)为右侧图像。左侧图像为畸变图像,右侧图像为去畸变处理后的图像,简称为去畸变图像。本发明实施例,终端设备利用已知的标定参数(如去畸变参数)对畸变图像中的坐标点进行去畸变处理,舍弃超出图像大小的像素点,得到(b)图所示的去畸变图像。
从图1可以看出:虽然去畸变后的图像保证了图像质量,不存在失真,但图像四周边缘的信息被舍弃,保留了中心区域的图像信息,这样后续基于该去畸变图像进行图像处理,例如物体检测及跟踪等带来了极大的困难。
第二种,在不损失图像信息的前提下,对畸变图像进行去畸变处理。请参见图2示出另一种去畸变前后的图像变化示意图。如图2,(a)为左侧图像,(b)为右侧图像。在不损失图像信息的前提下,终端设备可对畸变图像的参数(例如分辨率等)进行调整,保证去畸变图像和畸变图像的图像大小一致,且畸变图像中的图像信息完全保留。
由于鱼眼镜头本身的特性,离镜头中心越远的位置,图像信息被压缩越剧烈,导致去畸变后,所有图像信息被展开,反而使得中心区域的有效像素被成倍缩小。具体从图2中可以看出,该方案虽然保留了畸变图像中所有图像信息,但有效中心区域的分辨率被大大降低,影响图像清晰度,不利于后续图像处理及应用。
由此可见,传统图像去畸变方案无法同时保证图像清晰度及完整度。为解决该问题,本发明特提出一种图像处理方法、所述方法适用的装置及设备。请参见图3,是本发明提供的一种终端设备的结构示意图。如图3所示的终端设备100可以包括处理器210,外部存储器接口220,内部存储器221,通用串行总线(universal serial bus,USB)接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块250,无线通信模块260,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294,以及用户标识模块(subscriber identification module,SIM)卡接口295等。其中传感器模块280可以包括压力传感器280A,陀螺仪传感器280B,气压传感器280C,磁传感器280D,加速度传感器280E,距离传感器280F,接近光传感器280G,指纹传感器280H,温度传感器280J,触摸传感器280K,环境光传感器280L,骨传导传感器280M等。
可以理解的是,本发明实施例示意的结构并不构成对终端设备100的具体限定。在本申请另一些实施例中,终端设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。
在一些实施例中,处理器210可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器210可以包含多组I2C总线。处理器210可以通过不同的I2C总线接口分别耦合触摸传感器280K,充电器,闪光灯,摄像头293等。例如:处理器210可以通过I2C接口耦合触摸传感器280K,使处理器210与触摸传感器280K通过I2C总线接口通信,实现终端设备100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器210可以包含多组I2S总线。处理器210可以通过I2S总线与音频模块270耦合,实现处理器210与音频模块270之间的通信。在一些实施例中,音频模块270可以通过I2S接口向无线通信模块260传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块270与无线通信模块260可以通过PCM总线接口耦合。在一些实施例中,音频模块270也可以通过PCM接口向无线通信模块260传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器210与无线通信模块260。例如:处理器210通过UART接口与无线通信模块260中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块270可以通过UART接口向无线通信模块260传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器210与显示屏294,摄像头293等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface, DSI)等。在一些实施例中,处理器210和摄像头293通过CSI接口通信,实现终端设备100的拍摄功能。处理器210和显示屏294通过DSI接口通信,实现终端设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器210与摄像头293,显示屏294,无线通信模块260,音频模块270,传感器模块280等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口230是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口230可以用于连接充电器为终端设备100充电,也可以用于终端设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他终端设备,例如AR设备等。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对终端设备100的结构限定。在本申请另一些实施例中,终端设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块240用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块240可以通过USB接口230接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块240可以通过终端设备100的无线充电线圈接收无线充电输入。充电管理模块240为电池242充电的同时,还可以通过电源管理模块241为终端设备供电。
电源管理模块241用于连接电池242,充电管理模块240与处理器210。电源管理模块241接收电池242和/或充电管理模块240的输入,为处理器210,内部存储器221,显示屏294,摄像头293,和无线通信模块260等供电。电源管理模块241还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块241也可以设置于处理器210中。在另一些实施例中,电源管理模块241和充电管理模块240也可以设置于同一个器件中。
终端设备100的无线通信功能可以通过天线1,天线2,移动通信模块250,无线通信模块260,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。终端设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块250可以提供应用在终端设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块250可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块250可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块250还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块250的至少部分功能模块可以被设置于处理器210中。在一些实施例中,移动通信模块250的至少部分功能模块可以与处理器210的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信 号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器270A,受话器270B等)输出声音信号,或通过显示屏294显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器210,与移动通信模块250或其他功能模块设置在同一个器件中。
无线通信模块260可以提供应用在终端设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块260可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块260经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块260还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,终端设备100的天线1和移动通信模块250耦合,天线2和无线通信模块260耦合,使得终端设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
终端设备100通过GPU,显示屏294,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏294和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏294用于显示图像,视频等。显示屏294包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。
终端设备100可以通过ISP,摄像头293,视频编解码器,GPU,显示屏294以及应用处理器等实现拍摄功能。
ISP用于处理摄像头293反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP 还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头293中。
摄像头293用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,终端设备100可以包括1个或N个摄像头293,N为大于1的正整数。该摄像头293包括但不限于鱼眼摄像头、数字摄像头及模拟摄像头等。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当终端设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。终端设备100可以支持一种或多种视频编解码器。这样,终端设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现终端设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展终端设备100的存储能力。外部存储卡通过外部存储器接口220与处理器210通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器221可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器210通过运行存储在内部存储器221的指令,和/或存储在设置于处理器中的存储器的指令,执行终端设备100的各种功能应用以及数据处理。
终端设备100可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块270用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块270还可以用于对音频信号编码和解码。在一些实施例中,音频模块270可以设置于处理器210中,或将音频模块270的部分功能模块设置于处理器210中。
扬声器270A,也称“喇叭”,用于将音频电信号转换为声音信号。终端设备100可以通过扬声器270A收听音乐,或收听免提通话。
受话器270B,也称“听筒”,用于将音频电信号转换成声音信号。当终端设备100接听电话或语音信息时,可以通过将受话器270B靠近人耳接听语音。
麦克风270C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风270C发声,将声音信号输入到麦克风270C。终端设备100可以设置至少一个麦克风270C。在另一些实施例中,终端设备100可以设置两个麦克风270C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,终端设备100还可以设置三个,四个或更多麦克风270C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口270D用于连接有线耳机。耳机接口270D可以是USB接口230,也可以是3.5mm的开放移动终端设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器280A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器280A可以设置于显示屏294。压力传感器280A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器280A,电极之间的电容改变。终端设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏294,终端设备100根据压力传感器280A检测所述触摸操作强度。终端设备100也可以根据压力传感器280A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器280B可以用于确定终端设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器280B确定终端设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器280B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器280B检测终端设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消终端设备100的抖动,实现防抖。陀螺仪传感器280B还可以用于导航,体感游戏场景。
气压传感器280C用于测量气压。在一些实施例中,终端设备100通过气压传感器280C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器280D包括霍尔传感器。终端设备100可以利用磁传感器280D检测翻盖皮套的开合。在一些实施例中,当终端设备100是翻盖机时,终端设备100可以根据磁传感器280D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器280E可检测终端设备100在各个方向上(一般为三轴)加速度的大小。当终端设备100静止时可检测出重力的大小及方向。还可以用于识别终端设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器280F,用于测量距离。终端设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,终端设备100可以利用距离传感器280F测距以实现快速对焦。
接近光传感器280G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。终端设备100通过发光二极管向外发射红外光。终端设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定终端设备100附近有物体。当检测到不充分的反射光时,终端设备100可以确定终端设备100附近没有物体。终端设备100可以利用接近光传感器280G检测用户手持终端设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器280G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器280L用于感知环境光亮度。终端设备100可以根据感知的环境光亮度自适应调节显示屏294亮度。环境光传感器280L也可用于拍照时自动调节白平衡。环境光传感器280L还可以与接近光传感器280G配合,检测终端设备100是否在口袋里,以防误触。
指纹传感器280H用于采集指纹。终端设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器280J用于检测温度。在一些实施例中,终端设备100利用温度传感器280J检测的温度,执行温度处理策略。例如,当温度传感器280J上报的温度超过阈值,终端设备100执行降低位于温度传感器280J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,终端设备100对电池242加热,以避免低温导致终端设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,终端设备100对电池242的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器280K,也称“触控器件”。触摸传感器280K可以设置于显示屏294,由触摸传感器280K与显示屏294组成触摸屏,也称“触控屏”。触摸传感器280K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏294提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器280K也可以设置于终端设备100的表面,与显示屏294所处的位置不同。
骨传导传感器280M可以获取振动信号。在一些实施例中,骨传导传感器280M可以获取人体声部振动骨块的振动信号。骨传导传感器280M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器280M也可以设置于耳机中,结合成骨传导耳机。音频模块270可以基于所述骨传导传感器280M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器280M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键290包括开机键,音量键等。按键290可以是机械按键。也可以是触摸式按键。终端设备100可以接收按键输入,产生与终端设备100的用户设置以及功能控制有关的键信号输入。
马达291可以产生振动提示。马达291可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏294不同区域的触摸操作,马达291也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器292可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口295用于连接SIM卡。SIM卡可以通过插入SIM卡接口295,或从SIM卡接口295拔出,实现和终端设备100的接触和分离。终端设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口295可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口295可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口295也可以兼容不同类型的SIM卡。SIM卡接口295也可以兼容外部存储卡。终端设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,终端设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在终端设备100中,不能和终端设备100分离。
以下对终端设备100的软件系统进行详细介绍:
终端设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明终端设备100的软件结构。
如图4所示,图4是本发明实施例的终端设备100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。如图4所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。如图3所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供终端设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例 如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,终端设备振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
下面结合捕获拍照场景,示例性说明终端设备100软件以及硬件的工作流程。
当触摸传感器180K接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的控件。以该触摸操作是触摸单击操作,该单击操作所对应的控件为相机应用图标的控件为例,相机应用调用应用框架层的接口,启动相机应用,进而通过调用内核层启动摄像头驱动,通过摄像头293捕获静态图像或视频。
下面介绍本发明涉及的图像去畸变的相关实施例。请参见图5,是本发明实施例提供的一种图像处理方法的流程示意图。如图5所示的方法包括如下实施步骤:
S502、终端设备获取畸变图像,该畸变图像包括至少两个畸变区域,每个畸变区域在各自像素坐标系中包括有至少一个像素点的像素坐标。
本发明实施例终端设备可获取畸变图像,该畸变图像可为终端设备通过摄像头采集获得的,也可为接收来自其他设备(例如服务器)发送的。终端设备获得该畸变图像后,可对畸变图像进行分区处理(也可称为分块处理),从而获得组成该畸变图像的至少两个畸变区域。每个畸变区域对应有一个像素坐标系。
举例来说,请参见图6示出一种畸变图像分区的示意图。如图6所示,终端设备将畸变图像分为5部分,如图具体为:上边缘畸变区域、下边缘畸变区域、左边缘畸变区域、右边缘畸变区域及中心畸变区域。每个畸变区域对应有各自的像素坐标系,如图6示例性给出中心畸变区域的像素坐标系uo pv,每个畸变区域中任意像素点的像素坐标可表示为(u, v),u和v的取值与该畸变区域在畸变图像中的位置及大小有关。例如畸变图像为1000*1000的图像,则中心畸变区域中任意像素点的像素坐标u处于-250~250之间,v处于-250~250之间。
S504、终端设备根据相机坐标系和每个畸变区域的像素坐标系之间的转换关系,将畸变图像中每个畸变区域的至少一个像素点的像素坐标转换为对应的相机坐标。
终端设备获取相机坐标系和畸变图像中每个畸变区域的像素坐标系之间的转换关系,然后依据该转换关系对应将畸变图像中该畸变区域的至少一个像素点的像素坐标转换为对应的相机坐标。由于畸变图像中每个畸变区域的像素坐标系不相同,因此相机坐标系和每个畸变区域的像素坐标系之间的转换关系也不相同。本发明为方便阐述,将中心畸变区域的像素坐标系和相机坐标系之间的转换关系称为第一转换关系,将边缘畸变区域的像素坐标系和相机坐标系之间的转换关系称为第二转换关系。在实际应用中,边缘畸变区域也可细分为上边缘畸变区域、下边缘畸变区域、左边缘畸变区域等等,具体可根据用户实际需求划分,每个边缘畸变区域的像素坐标系和相机坐标系之间的转换关系也应不同。本发明这里统一描述以边缘畸变区域为例进行相关内容的阐述,但并不构成限定。
针对第一转换关系而言,终端设备可采用常用的针孔模型创建中心畸变区域的像素坐标系与相机坐标系之间的第一转换关系。具体地,请参见图7示出针孔模型下创建第一转换关系的示意图。如图7所示,终端设备依据相机坐标系下空间中的任一坐标点与相机光心的连线,将其直接映射到同一图像平面上,从而建立图像坐标系和相机坐标系之间的映射关系。该图像平面可为畸变图像所在的图像平面,即中心畸变区域在第一图像坐标系下所在的图像屏幕。其中,如图8所示,终端设备将像素坐标系的中心平移至畸变图像的中心从而可获得该畸变图像的图像坐标系。相应地,也建立了该中心边缘区域的像素坐标系与相机坐标系之间的第一转换关系。该第一转换关系与中心边缘区域的尺寸、畸变图像的尺寸A*B及中心边缘区域的焦距f0有关。示例性地,以中心边缘区域中的任一像素点的像素坐标(u0,v0)为例,终端设备采用第一转换关系将该像素坐标(u0,v0)转换为相机坐标系下的相机坐标(x0,y0)。其中,x0=H1(u0,A,f0),y0=H2(v0,B,f0),H1和H2代表第一转换关系。
针对第二转换关系而言,终端设备采用分块的针孔模型,创建边缘畸变区域的像素坐标系与相机坐标系之间的第二转换关系。具体地,参见图8示出基于分块的针孔模型下创建第二转换关系的示意图。如图8,终端设备可将相机光心视为一个立方体的中心,将相机坐标系下任一坐标点与相机光心的连线映射到不同图像坐标系下的图像平面上,从而建立不同图像坐标系和相机坐标系之间的映射关系。该不同图像坐标系的图像平面具体可对应为不同边缘畸变区域位于立方体不同侧面而对应的图像平面。例如,图6所示的上边缘畸变区域,该上边缘畸变区域所在的图像坐标系下的图像平面可视为中心畸变区域对应的图像平面旋转90度后形成的图像平面。
举例来说,以上边缘畸变区域中任一像素点的像素坐标(u1,v1)为例,终端设备采用第二转换关系将该像素坐标(u1,v1)转换为相机坐标系下的相机坐标(x1,y1)。其中,x1=H3(u1,A,f1),y0=H4(v1,B,f1),H3和H4代表第二转换关系。f1为上边缘区 域的焦距。
在实际应用中,畸变图像中各畸变区域的焦距可以相同,也可不相同。通常,将各畸变区域的焦距视为与该畸变图像的拍摄焦距f相同。
S506、终端设备对畸变图像中每个畸变区域的至少一个像素点的相机坐标进行去畸变处理,得到与畸变图像对应的去畸变图像。
终端设备获得畸变图像中每个畸变区域的至少一个像素点的相机坐标后,可采用预设的去畸变公式对应对每个畸变区域的所有像素点的相机坐标进行去畸变处理,得到该畸变区域对应的去畸变区域。其中,畸变图像中不同畸变区域各自对应采用的去畸变公式可以相同,也可不同,本发明不做限定。例如,终端设备采用第一去畸变公式对中心畸变区域中所有像素点的相机坐标进行去畸变得到相应地中心去畸变区域,采用第二去畸变公式对边缘畸变区域中所有像素点的相机坐标进行去畸变得到相应地边缘去畸变区域,该第一去畸变公式和第二去畸变公式具体可为系统预先设置的,本发明不做限定。
具体地,终端设备采用去畸变公式对畸变区域中所有像素点的相机坐标进行去畸变处理后,可对应得到去畸变后该像素点的相机坐标。进一步依据该畸变区域的像素坐标系和相机坐标系之间的转换关系,将去畸变后该像素点的相机坐标对应转换为去畸变后该像素点的像素坐标。例如,假设中心畸变区域中像素点的像素坐标为(u0,v0),该像素点对应在相机坐标系中的相机坐标为(x0,y0)。若采用预设畸变公式对该像素点的相机坐标(x0,y0)进行去畸变处理后,得到去畸变后该像素点的相机坐标(x’0,y’0)。然后依据相机坐标系与该畸变区域的像素坐标系之间的转换关系,将去畸变后该像素点的相机坐标(x’0,y’0)转换为对应的去畸变后该像素点的像素坐标(u’0,v’0)。以此类推,可计算得到该畸变区域所对应的去畸变区域中每个去畸变后像素点的像素坐标,从而获得畸变区域对应的去畸变区域。示例性地,如图9示出一种图像去畸变前后的变化示意图。如图9所示,(a)为鱼眼镜头采集的畸变图像,(b)为对(a)进行去畸变处理后得到的去畸变图像。
在可选实施例中,终端设备还可对各边缘畸变区域的焦距进行调整,得到调整后该边缘畸变区域的目标焦距。例如,终端设备可对上边缘畸变区域的焦距f1进行调整。具体地,终端设备可按照预设规则对边缘畸变区域的焦距fi进行调整,该预设规则为系统自定义设置的,例如按照固定步长增加或减少边缘畸变区域的焦距fi。其中,调整后该边缘畸变区域的目标焦距需满足以下条件:①边缘去畸变区域的清晰度超过第一阈值;②边缘去畸变区域中特征像素点的数量超过第二阈值。该边缘去畸变区域指对边缘畸变区域进行去畸变处理后得到的图像区域,该中心去畸变区域指对中心畸变区域进行去畸变处理后得到的图像区域。
在一个具体实施方式中,终端设备在依据边缘畸变区域的调整焦距计算得到相应地边缘去畸变区域后,终端设备可分析该边缘去畸变区域的清晰度,若该清晰度超过第一阈值,则可将该调整焦距作为该边缘畸变区域的目标焦距。其中,边缘去畸变区域的清晰度具体可通过分辨率、锐度等图像指标来反映。
再一个具体实施方式中,终端设备在依据边缘畸变区域的调整焦距计算得到相应地边 缘去畸变区域后,可提取该边缘去畸变区域中的特征像素点,若该特征像素点的数量超过第二阈值,则可将调整焦距作为该边缘畸变区域的目标焦距。本发明通过边缘去畸变区域中特征像素点的数量来反映该边缘去畸变区域中图像信息的保留度,特征像素点越多,表明图像信息的保留度越大,图像区域质量越好。
在实际应用中,上述两种具体实施方式可单独实施,也可结合实施,本发明并不做限定。其中,该第一阈值及第二阈值具体可为系统自定义设置的,例如根据用户经验设置的经验值,或者根据一系列的统计数据计算得到的数值等。它们可以相同,也可不相同,本发明并不做限定。
在可选实施例中,若终端设备采用上述图像去畸变原理对连续的多帧畸变区域进行去畸变处理后,可对应获得连续的多帧去畸变图像。相应地,终端设备还可采用预设的特征提取算法对多帧去畸变图像进行特征提取,得到每帧去畸变图像中的特征像素点。该特征提取算法具体可为系统预先配置的,其可包括但不限于局部二值模式(local binary patterns,LBP)算法、尺度不变特征变换(scale-invariant feature transform,SIFT)算法、方向梯度直方图(histogram of oriented gradient,HOG)特征提取算法、或其他特征提取算法等等。示例性地,如图10示出一种特征像素点的示意图。如图10所示,该去畸变图像中圆圈所示的像素点为特征像素点。其中,灰色圆圈所示的像素点为中心去畸变区域中的特征像素点,白色圆圈所示的像素点为边缘去畸变区域中的特征像素点。
进一步终端设备可对每帧去畸变图像中的特征像素点进行像素追踪,得到多帧去畸变图像对应的相机姿态。具体地,终端设备可采用预设像素追踪算法,对多帧去畸变图像中的每帧去畸变图像的特征像素点进行像素追踪,从而识别获得拍摄该多帧去畸变图像对应的相机姿态。
需要说明的是,本发明适应于任意图像处理场景,例如图像识别、同步定位与建图(simultaneous localization and mapping,SLAM)等场景。去畸变图像的效果可采用特定应用场景下的一些参考指标来界定。以SLAM场景为例,终端设备对畸变图像中每个畸变区域焦距的调整,可通过基于该畸变图像对应的去畸变图像追踪获得的相机姿态来确定。例如,若计算的相机姿态和真实的相机姿态之间的误差较小,则将该去畸变图像中每个去畸变区域对应的调整焦距视为该区域的目标焦距,本发明不做限定。
通过实施本发明,能够采用基于图像分区的去畸变处理,既能保证图像清晰度,又能保证有效图像信息的保留,同时兼顾考虑图像的完整度和清晰度。
本发明实施例可以根据上述方法示例对设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
请参见图11,是本发明实施例提供的一种终端设备的结构示意图。如图11所示的终端设备100(也可称为图像处理装置)包括获取模块102、转换模块104及处理模块106。其中,
所述获取模块102,用于获取畸变图像,所述畸变图像包括至少两个畸变区域,每个畸变区域在各自像素坐标系中包括有至少一个像素点的像素坐标;
所述转换模块104,用于根据相机坐标系和每个畸变区域的像素坐标系之间的转换关系,将所述畸变图像中每个畸变区域的至少一个像素点的像素坐标转换为对应的相机坐标;
所述处理模块106,用于对所述畸变图像中每个畸变区域的至少一个像素点的相机坐标进行去畸变处理,得到与所述畸变图像对应的去畸变图像。
在一些可能的实施例中,所述畸变图像包括中心畸变区域和边缘畸变区域,所述转换模块104具体用于根据第一转换关系,将所述中心畸变区域中至少一个像素点的像素坐标转换为对应的相机坐标;根据第二转换关系,将所述边缘畸变区域中至少一个像素点的像素坐标转换为对应的相机坐标;其中,所述第一转换关系为相机坐标系和所述中心畸变区域的像素坐标系之间的转换关系,所述第二转换关系为相机坐标系和所述边缘畸变区域的像素坐标系之间的转换关系,所述第一转换关系与所述第二转换关系不同。
在一些可能的实施例中,所述第一转换关系为相机坐标系中的坐标点与相机光心的连线映射到第一图像坐标系下的平面图像而建立的映射关系,所述第二转换关系为相机坐标系中的坐标点与相机光心的连线映射到第二图像坐标系下的平面图像而建立的映射关系。
在一些可能的实施例中,所述装置还包括调整模块108。所述调整模块108用于根据所述中心畸变区域的相机内参,对所述边缘畸变区域的焦距进行调整,得到所述边缘畸变区域的目标焦距,所述目标焦距与所述第二转换关系有关。
在一些可能的实施例中,所述目标焦距的调整需满足以下中的至少一项:边缘去畸变区域与中心去畸变区域之间的平滑度超过第一阈值;边缘去畸变区域的清晰度超过第二阈值;边缘去畸变区域中特征像素点的数量超过第三阈值;其中,所述边缘去畸变区域为对所述边缘畸变区域中至少一个像素点的相机坐标进行去畸变处理后得到的图像区域,所述中心去畸变区域为所述中心畸变区域中至少一个像素点的相机坐标进行去畸变处理后得到的图像区域。
在一些可能的实施例中,所述去畸变图像包括连续的多帧去畸变图像,所述装置还包括提取模块110及追踪模块112。其中,所述提取模块110用于对所述多帧去畸变图像进行特征提取,得到每帧去畸变图像中的特征像素点;所述追踪模块112用于对所述每帧去畸变图像中的特征像素点进行追踪,得到所述多帧去畸变图像对应的相机姿态。
应理解的是,本发明实施例的装置可以通过专用集成电路(application-specific integrated circuit,ASIC)实现,或可编程逻辑器件(programmable logic device,PLD)实现,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD),现场可编程门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。也可以通过软件实现上述方法实施例的相关描述,该节点中的各个模块也可以为软件单元。
需要说明的,图11仅仅是本申请实施例的一种可能的实现方式,实际应用中,图像处理装置还可以包括更多或更少的部件,这里不作限制。基于同一发明构思,本申请实施例中提供的终端设备解决问题的原理与本申请方法实施例中终端设备解决问题的原理相似,因此各设备的实施可以参见方法的实施,为简洁描述,在这里不再赘述。
本发明实施例还提供一种计算机非瞬态存储介质,所述计算机非瞬态存储介质中存储有指令,当其在处理器上运行时,图5所示方法实施例中所描述的方法流程得以实现。
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在处理器上运行时,图5所示方法实施例中所描述的方法流程得以实现。
结合本申请实施例公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(英文:Random Access Memory,RAM)、闪存、只读存储器(英文:Read Only Memory,ROM)、可擦除可编程只读存储器(英文:Erasable Programmable ROM,EPROM)、电可擦可编程只读存储器(英文:Electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于终端设备中。当然,处理器和存储介质也可以作为分立组件存在于终端设备中。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。

Claims (14)

  1. 一种图像处理方法,其特征在于,所述方法包括:
    获取畸变图像,所述畸变图像包括至少两个畸变区域,每个畸变区域在各自像素坐标系中包括有至少一个像素点的像素坐标;
    根据相机坐标系和每个畸变区域的像素坐标系之间的转换关系,将所述畸变图像中每个畸变区域的至少一个像素点的像素坐标转换为对应的相机坐标;
    对所述畸变图像中每个畸变区域的至少一个像素点的相机坐标进行去畸变处理,得到与所述畸变图像对应的去畸变图像。
  2. 如权利要求1所述的方法,其特征在于,所述畸变图像包括中心畸变区域和边缘畸变区域,所述根据相机坐标系和每个畸变区域的像素坐标系之间的转换关系,将所述畸变图像中每个畸变区域的至少一个像素点的像素坐标转换为对应的相机坐标包括:
    根据第一转换关系,将所述中心畸变区域中至少一个像素点的像素坐标转换为对应的相机坐标;
    根据第二转换关系,将所述边缘畸变区域中至少一个像素点的像素坐标转换为对应的相机坐标;
    其中,所述第一转换关系为相机坐标系和所述中心畸变区域的像素坐标系之间的转换关系,所述第二转换关系为相机坐标系和所述边缘畸变区域的像素坐标系之间的转换关系,所述第一转换关系与所述第二转换关系不同。
  3. 如权利要求2所述的方法,其特征在于,所述第一转换关系为相机坐标系中的坐标点与相机光心的连线映射到所述中心畸变区域在第一图像坐标系下所在的第一图像平面而建立的映射关系,所述第二转换关系为相机坐标系中的坐标点与相机光心的连线映射到所述边缘畸变区域在第二图像坐标系下的图像平面而建立的映射关系。
  4. 如权利要求2或3所述的方法,其特征在于,所述根据相机坐标系和每个畸变区域的像素坐标系之间的转换关系,将所述畸变图像中每个畸变区域的至少一个像素点的像素坐标转换为对应的相机坐标之前,所述方法还包括:
    对所述边缘畸变区域的焦距进行调整,得到所述边缘畸变区域的目标焦距,所述目标焦距与所述第二转换关系有关。
  5. 如权利要求4所述的方法,其特征在于,所述目标焦距的调整需满足以下条件:边缘去畸变区域的清晰度超过第一阈值;边缘去畸变区域中特征像素点的数量超过第二阈值;
    其中,所述边缘去畸变区域为对所述边缘畸变区域中至少一个像素点的相机坐标进行去畸变处理后得到的图像区域。
  6. 如权利要求1-5中任一项所述的方法,其特征在于,所述去畸变图像包括连续的多帧去畸变图像,所述方法还包括:
    对所述多帧去畸变图像进行特征提取,得到每帧去畸变图像中的特征像素点;
    对所述每帧去畸变图像中的特征像素点进行追踪,得到所述多帧去畸变图像对应的相机姿态。
  7. 一种图像处理装置,其特征在于,包括获取模块、转换模块及处理模块,其中,
    所述获取模块,用于获取畸变图像,所述畸变图像包括至少两个畸变区域,每个畸变区域在各自像素坐标系中包括有至少一个像素点的像素坐标;
    所述转换模块,用于根据相机坐标系和每个畸变区域的像素坐标系之间的转换关系,将所述畸变图像中每个畸变区域的至少一个像素点的像素坐标转换为对应的相机坐标;
    所述处理模块,用于对所述畸变图像中每个畸变区域的至少一个像素点的相机坐标进行去畸变处理,得到与所述畸变图像对应的去畸变图像。
  8. 如权利要求7所述的装置,其特征在于,所述畸变图像包括中心畸变区域和边缘畸变区域,
    所述转换模块,具体用于根据第一转换关系,将所述中心畸变区域中至少一个像素点的像素坐标转换为对应的相机坐标;根据第二转换关系,将所述边缘畸变区域中至少一个像素点的像素坐标转换为对应的相机坐标;
    其中,所述第一转换关系为相机坐标系和所述中心畸变区域的像素坐标系之间的转换关系,所述第二转换关系为相机坐标系和所述边缘畸变区域的像素坐标系之间的转换关系,所述第一转换关系与所述第二转换关系不同。
  9. 如权利要求8所述的装置,其特征在于,所述第一转换关系为相机坐标系中的坐标点与相机光心的连线映射到第一图像坐标系下的平面图像而建立的映射关系,所述第二转换关系为相机坐标系中的坐标点与相机光心的连线映射到第二图像坐标系下的平面图像而建立的映射关系。
  10. 如权利要求8或9所述的装置,其特征在于,所述装置还包括调整模块,
    所述调整模块,用于根据所述中心畸变区域的相机内参,对所述边缘畸变区域的焦距进行调整,得到所述边缘畸变区域的目标焦距,所述目标焦距与所述第二转换关系有关。
  11. 如权利要求10所述的装置,其特征在于,所述目标焦距的调整需满足以下条件:边缘去畸变区域的清晰度超过第一阈值;边缘去畸变区域中特征像素点的数量超过第二阈值;
    其中,所述边缘去畸变区域为对所述边缘畸变区域中至少一个像素点的相机坐标进行去畸变处理后得到的图像区域。
  12. 如权利要求7-11中任一项所述的装置,其特征在于,所述去畸变图像包括连续的多帧去畸变图像,所述装置还包括提取模块及追踪模块,
    所述提取模块,用于对所述多帧去畸变图像进行特征提取,得到每帧去畸变图像中的特征像素点;
    所述追踪模块,用于对所述每帧去畸变图像中的特征像素点进行追踪,得到所述多帧去畸变图像对应的相机姿态。
  13. 一种终端设备,其特征在于,包括:处理器,存储器,通信接口和总线;所述处理器、所述通信接口、所述存储器通过总线相互通信;所述通信接口,用于接收和发送数据;所述存储器,用于存储指令;所述处理器,用于调用所述存储器中的指令,执行如上权利要求1-6中任一项所述的方法。
  14. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-6中任一项所述的方法。
PCT/CN2020/116332 2019-09-23 2020-09-19 图像处理方法、装置、设备及计算机存储介质 WO2021057626A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910903319.8A CN112541861B (zh) 2019-09-23 2019-09-23 图像处理方法、装置、设备及计算机存储介质
CN201910903319.8 2019-09-23

Publications (1)

Publication Number Publication Date
WO2021057626A1 true WO2021057626A1 (zh) 2021-04-01

Family

ID=75013094

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/116332 WO2021057626A1 (zh) 2019-09-23 2020-09-19 图像处理方法、装置、设备及计算机存储介质

Country Status (2)

Country Link
CN (1) CN112541861B (zh)
WO (1) WO2021057626A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116263971A (zh) * 2021-12-15 2023-06-16 华为技术有限公司 图像帧的预测方法、电子设备及计算机可读存储介质
CN117974519A (zh) * 2024-04-02 2024-05-03 荣耀终端有限公司 一种图像处理方法及相关设备

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113837990B (zh) * 2021-06-11 2022-09-30 荣耀终端有限公司 一种噪声的监测方法、电子设备、芯片系统及存储介质
CN117135450A (zh) * 2023-01-30 2023-11-28 荣耀终端有限公司 一种对焦方法及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030103063A1 (en) * 2001-12-03 2003-06-05 Tempest Microsystems Panoramic imaging and display system with canonical magnifier
US20090318228A1 (en) * 2006-07-25 2009-12-24 Sony Computer Entertainment Europe Limited Apparatus and method of interaction with a data processor
CN101783011A (zh) * 2010-01-08 2010-07-21 宁波大学 一种鱼眼镜头的畸变校正方法
CN101814181A (zh) * 2010-03-17 2010-08-25 天津理工大学 一种鱼眼图像复原的展开方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101921672B1 (ko) * 2014-10-31 2019-02-13 후아웨이 테크놀러지 컴퍼니 리미티드 이미지 처리 방법 및 장치
CN109961402A (zh) * 2017-12-22 2019-07-02 中科创达软件股份有限公司 一种显示设备目镜反畸变方法及装置
CN109308686B (zh) * 2018-08-16 2022-06-24 北京市商汤科技开发有限公司 一种鱼眼图像处理方法及装置、设备和存储介质
CN109461213B (zh) * 2018-11-16 2023-11-28 京东方科技集团股份有限公司 基于虚拟现实的图像处理方法、装置、设备和存储介质
CN110097516B (zh) * 2019-04-25 2021-02-12 上海交通大学 内孔壁面图像畸变纠正方法、系统及介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030103063A1 (en) * 2001-12-03 2003-06-05 Tempest Microsystems Panoramic imaging and display system with canonical magnifier
US20090318228A1 (en) * 2006-07-25 2009-12-24 Sony Computer Entertainment Europe Limited Apparatus and method of interaction with a data processor
CN101783011A (zh) * 2010-01-08 2010-07-21 宁波大学 一种鱼眼镜头的畸变校正方法
CN101814181A (zh) * 2010-03-17 2010-08-25 天津理工大学 一种鱼眼图像复原的展开方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116263971A (zh) * 2021-12-15 2023-06-16 华为技术有限公司 图像帧的预测方法、电子设备及计算机可读存储介质
CN117974519A (zh) * 2024-04-02 2024-05-03 荣耀终端有限公司 一种图像处理方法及相关设备

Also Published As

Publication number Publication date
CN112541861B (zh) 2024-05-24
CN112541861A (zh) 2021-03-23

Similar Documents

Publication Publication Date Title
WO2020259452A1 (zh) 一种移动终端的全屏显示方法及设备
US11816775B2 (en) Image rendering method and apparatus, and electronic device
WO2021213120A1 (zh) 投屏方法、装置和电子设备
US11223772B2 (en) Method for displaying image in photographing scenario and electronic device
WO2021057626A1 (zh) 图像处理方法、装置、设备及计算机存储介质
US20230276014A1 (en) Photographing method and electronic device
WO2022127787A1 (zh) 一种图像显示的方法及电子设备
WO2022007862A1 (zh) 图像处理方法、系统、电子设备及计算机可读存储介质
WO2022017261A1 (zh) 图像合成方法和电子设备
WO2021180089A1 (zh) 界面切换方法、装置和电子设备
US11627437B2 (en) Device searching method and electronic device
WO2022100685A1 (zh) 一种绘制命令处理方法及其相关设备
WO2021213031A1 (zh) 图像合成方法及相关装置
WO2022001258A1 (zh) 多屏显示方法、装置、终端设备及存储介质
EP4036842A1 (en) Image flooding processing method and apparatus, and storage medium
CN110138999B (zh) 一种用于移动终端的证件扫描方法及装置
CN116389884B (zh) 缩略图显示方法及终端设备
CN114283195B (zh) 生成动态图像的方法、电子设备及可读存储介质
WO2022033344A1 (zh) 视频防抖方法、终端设备和计算机可读存储介质
EP4206865A1 (en) Brush effect picture generation method, image editing method and device, and storage medium
WO2024114257A1 (zh) 转场动效生成方法和电子设备
WO2022166550A1 (zh) 数据传输方法及电子设备
WO2024078275A1 (zh) 一种图像处理的方法、装置、电子设备及存储介质
WO2023036084A1 (zh) 一种图像处理方法及相关装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20869943

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20869943

Country of ref document: EP

Kind code of ref document: A1