Control method and apparatus of electronic device, terminal, and storage medium
Patent Information
- Application Number
- CN202311089938.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-25
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-08-25
AI Technical Summary
目前,针对鱼眼摄像头的采集图像进行处理,通常的做法是:固定的视场(FOV)参数值,设定一个中规中矩的反畸变参数满足大部分场景使用,整体识别率中规中矩,无自适应与动态调整功能;每个设备的摄像头参数固定,无法针对各类应用场景进行微调,导致识别率偏低
[0009]本公开通过结合目标对象与电子设备之间的距离,并且利用与该距离对应的第一参数对鱼眼摄像头采集的第一图像进行反畸变处理,如此,能够实现动态调整第一图像的反畸变参数,获得更高质量的反畸变图像。
Smart Images

Figure CN117036200B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of information technology, and in particular to control methods and apparatuses, terminals and storage media for electronic devices. Background Technology
[0002] With the advancement of technology, head-mounted devices (such as virtual reality (VR) glasses) are becoming increasingly widespread. Typically, a head-mounted device includes display lenses, a computing unit, a fisheye camera, a controller, a battery, various sensors, and a head-mounted accessory. Among these, the fisheye camera, as a key component for image acquisition, processes and recognizes images of external or spatial scenes. Due to its inherent characteristics, although a fisheye camera is a wide-angle lens, the image data it captures differs from that of a regular wide-angle camera, exhibiting an arc-shaped image. To process these images, such as for image recognition or editing, distortion correction is necessary. Currently, the common practice for processing images captured by fisheye cameras is to use a fixed field of view (FOV) parameter value, setting a moderate distortion correction parameter to meet most scenarios. This results in a mediocre overall recognition rate without adaptive or dynamic adjustment capabilities. Furthermore, the fixed camera parameters for each device prevent fine-tuning for various application scenarios, leading to a lower recognition rate. Summary of the Invention
[0003] To address the existing problems, this disclosure provides a control method, apparatus, terminal, and storage medium for an electronic device.
[0004] The following technical solution is adopted in this disclosure.
[0005] Embodiments of this disclosure provide a control method for an electronic device. The control method includes: acquiring a first image of a target object through a fisheye camera of the electronic device; acquiring the distance between the target object and the electronic device; determining a first parameter corresponding to the distance; and performing anti-distortion processing on the first image based on the first parameter to obtain a second image.
[0006] Another embodiment of this disclosure provides a control device for an electronic device, the control device comprising: an image acquisition module configured to acquire a first image of a target object through a fisheye camera of the electronic device; a distance acquisition module configured to acquire the distance between the target object and the electronic device; a parameter determination module configured to determine a first parameter corresponding to the distance; and an image processing module configured to perform anti-distortion processing on the first image based on the first parameter to obtain a second image.
[0007] In some embodiments, this disclosure provides a terminal, including: at least one memory and at least one processor; wherein the memory is used to store program code, and the processor is used to call the program code stored in the memory to execute the control method of the above-described electronic device.
[0008] In some embodiments, this disclosure provides a storage medium for storing program code for executing the control method of the above-described electronic device.
[0009] This disclosure combines the distance between the target object and the electronic device, and uses a first parameter corresponding to that distance to perform anti-distortion processing on the first image captured by the fisheye camera. In this way, the anti-distortion parameters of the first image can be dynamically adjusted to obtain a higher quality anti-distortion image. Attached Figure Description
[0010] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0011] Figure 1 This is a flowchart of a control method for an electronic device according to an embodiment of the present disclosure.
[0012] Figure 2 This is an exemplary correspondence between the distance and the first parameter in an embodiment of this disclosure.
[0013] Figure 3 An example flow of a control method for an electronic device according to some embodiments is shown.
[0014] Figure 4 A projection model of a fisheye camera according to some embodiments is shown.
[0015] Figure 5 This is a part of the control device for an electronic device according to embodiments of this disclosure.
[0016] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. Detailed Implementation
[0017] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0018] It should be understood that the various steps described in the method embodiments of this disclosure can be performed in sequence and / or in parallel. Furthermore, method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0019] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0020] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0021] It should be noted that the use of the word "a" in this disclosure is illustrative rather than restrictive, and those skilled in the art should understand that it should be understood as "one or more" unless otherwise expressly indicated in the context.
[0022] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0023] Figure 1 A flowchart of a control method for an electronic device according to embodiments of the present disclosure is provided. The control method for the electronic device of the present disclosure may include step S101, acquiring a first image of a target object using a fisheye camera of the electronic device. In some embodiments, the electronic device may include a head-mounted device. In some embodiments, the electronic device may include virtual reality (VR) glasses, etc. In some embodiments, the fisheye camera is typically located on the front side of the electronic device for acquiring or capturing images. In some embodiments, the target object is an object captured by the fisheye camera.
[0024] In some embodiments, the method of this disclosure may further include step S102, obtaining the distance between the target object and the electronic device. In some embodiments, the distance between the target object and the electronic device may be obtained by a distance sensor. In some embodiments, the distance sensor may include a depth-sensing camera, but this disclosure is not limited thereto. In some embodiments, the distance sensor is disposed on the front side of the electronic device for obtaining the distance between the target object and the electronic device.
[0025] In some embodiments, the method of this disclosure may further include step S103, determining a first parameter corresponding to the distance. In some embodiments, the distance and the first parameter have a mapping relationship, such as a one-to-one correspondence, with each distance corresponding to a corresponding first parameter. In some embodiments, the first parameter can be used to adjust the anti-distortion parameters of the anti-distortion processing of the first image in real time to improve the anti-distortion effect. Figure 2 An exemplary correspondence between distance and the first parameter is shown.
[0026] In some embodiments, the method of this disclosure may further include step S104, performing anti-distortion processing on the first image based on the first parameter to obtain a second image. In some embodiments, the first parameter may reflect the distance between the target object being photographed and the electronic device. By combining the first parameter to perform anti-distortion processing on the first image, the anti-distortion parameters can be intelligently adjusted, avoiding the problem of a single fixed parameter leading to a monotonous anti-distortion structure, thereby improving the anti-distortion result and increasing the image recognition rate of the obtained second image.
[0027] In some embodiments, such as Figure 2 As shown, the first parameter is between 0 and 1, and the larger the distance, the larger the first parameter. In some embodiments, when the distance sensor detects a close distance, the value of the first parameter can be decreased to weaken the information in the surrounding corners and concentrate on the central area for distortion correction, thereby improving the distortion correction effect. In some embodiments, when the distance sensor detects a far distance, the value of the first parameter can be increased to include as much information as possible and reduce the loss of information in the original image.
[0028] In some embodiments, when acquiring a first image of a target object using a fisheye camera on an electronic device, the method further includes: acquiring the application scenario of the fisheye camera; and adjusting the image acquisition parameters of the fisheye camera based on the application scenario. In some embodiments, the application scenario of the fisheye camera may include a QR code scanning scenario, a facial recognition scenario, etc. For example, in a QR code recognition scenario, it is usually necessary to improve image contrast to make the distinction between black and white more pronounced. Thus, by adjusting the image acquisition parameters of the fisheye camera based on the application scenario, the acquisition effect of the first image can be improved.
[0029] In some embodiments, anti-distortion processing of the first image based on the first parameter includes: performing anti-distortion processing on the first image based on the first parameter and the application scenario. By combining the application scenario with the anti-distortion processing of the first image, a second image more suitable for the needs of that application scenario can be obtained. For example, when scanning a QR code, it is usually necessary to increase the image contrast to enhance the distinction between black and white. That is, by considering the application scenario when performing anti-distortion processing on the first image, the anti-distortion effect can be improved, resulting in a second image that better meets the needs of that application scenario.
[0030] In some embodiments, the control method of the electronic device disclosed herein further includes: acquiring light parameters through a light sensor of the electronic device; and adjusting the image acquisition parameters of the fisheye camera based on the light parameters when acquiring a first image of a target object through the fisheye camera of the electronic device. In some embodiments, the light sensor is used to sense the intensity of ambient light. In some embodiments, the light parameters serve as the basis for adjusting the image acquisition parameters of the fisheye camera. For example, when the ambient brightness is too low, it can prevent the user from manually entering night mode to increase exposure and improve ISO sensitivity, thus avoiding low image recognition rate due to underexposure; when the ambient brightness is too high, it can reduce the exposure value to prevent overexposure.
[0031] In some embodiments, performing anti-distortion processing on the first image based on the first parameter includes performing anti-distortion processing on the first image based on the first parameter and a lighting parameter. Combining the lighting parameter with the anti-distortion processing of the first image can improve the anti-distortion effect. For example, in a darker environment, the brightness of the output second image needs to be increased to improve the image recognition rate. In some embodiments, performing anti-distortion processing on the first image based on the first parameter includes performing anti-distortion processing on the first image based on the first parameter, the application scenario, and the lighting parameter. Thus, combining the first parameter, the application scenario, and the lighting parameter can better improve the anti-distortion effect of the first image.
[0032] Figure 3 An example flow of a control method for an electronic device according to some embodiments is shown. In this method, the application layer's usage scenario or the light parameters of a light sensor can be used to adjust the image acquisition parameters of a fisheye camera, and the distance between the target object and the electronic device acquired by a distance sensor (e.g., a depth camera) can be used to adjust the field of view parameters of the fisheye camera. During the anti-distortion processing, the distance acquired by the depth camera, the light parameters, and the application scenario can be combined to improve the anti-distortion processing effect and increase the image recognition rate of the obtained second image.
[0033] Figure 4 A projection model of a fisheye camera according to some embodiments is shown. For example... Figure 4 As shown in O c Let O be the camera coordinate system with axes Xc, Yc, and Zc, and let O be the imaging plane coordinate system with axes X, Y, and Z. Let P be a luminous point in the real world, which, after distortion by the fisheye camera, appears at position P'. Let θ be the incident angle of the object. d Let be the equivalent angle of refraction after passing through the fisheye camera. Where, r... dLet P be the projection of point P onto the imaging plane, and k1, k2, k3, and k4 be radial distortion parameters (which can be obtained using the commonly used checkerboard calibration method or straight line calibration method). According to the equidistant projection formula and the Taylor expansion, we know that:
[0034] r d =θ d =θ(1+k1θ) 2 +k2θ 4 +k3θ 6 +k4θ 8 (1)
[0035] When performing anti-distortion, which is the process of obtaining the coordinates of P0 in reverse through P', the basic process is as follows:
[0036] The Cartesian coordinates x' and y' of P' are:
[0037] x′=(θ d / r)a,y′=(θ d / r)b (2)
[0038] Where x' and y' are the distorted coordinates of the corresponding world coordinates x and y on the imaging plane, r is the variable radius of the Cartesian coordinate system, and a and b are the projected coordinates of point P on the imaging plane in the vacuum state.
[0039] Transform P' to the world coordinate system based on the camera intrinsic parameters:
[0040] u=(f x x′+c x ), v = (f y y′+c y (3) where u and v are the coordinate vectors of P' in the coordinate system after anti-distortion, and f x f y c x c y These are the values in the camera intrinsic parameter matrix A.
[0041]
[0042] Add the transformation coefficient, i.e., the first parameter, to the two projection transformation formulas. This introduces the first parameter, factor, with a value of 0 to 1.
[0043] u=(f x x′(1-factor)+c x factor), v = (f y y′(1-factor)+c y factor) (4)
[0044] In some embodiments, when the distance sensor detects a close proximity (i.e., point P is close to the camera origin), the value of the first parameter `factor` can be decreased to weaken information from the surrounding corners and concentrate distortion correction on the central area, thus improving the distortion correction effect. Conversely, when the distance sensor detects a far proximity (i.e., point P is far from the camera origin), the value of the first parameter `factor` can be increased to include as much information as possible and reduce information loss from the original image. This method intelligently adjusts the distortion correction parameters based on the distance of the image to be identified, thereby avoiding the limitation of a single fixed parameter leading to a single distortion correction result.
[0045] In some embodiments, the light sensor can transmit the ambient brightness to an anti-distortion algorithm library, which can increase the brightness value based on the current ambient brightness. For example, in a darker environment, the brightness of the pre-output image needs to be increased to improve the image recognition rate.
[0046] g(i,j)=αf(i,j)+β(α>0) (5)
[0047] Where i and j represent the current pixel being located in the i-th row and j-th column, β is the brightness value of the image, g(i,j) is the contrast gain variable of the image, and f(i,j) is the adjusted contrast and f(i,j) is the original contrast.
[0048] This disclosure improves the anti-distortion effect and increases the image recognition rate of the obtained anti-distortion image by dynamically adjusting the field of view parameters of the fisheye camera and the anti-distortion processing parameters using numerous parameters based on the recognition of external scenes, such as distance, light intensity, and application scenario.
[0049] Embodiments of this disclosure also provide a control device 400 for an electronic device. Figure 5 This is a partial module of a control device 400 for an electronic device according to an embodiment of the present disclosure. The control device 400 includes an image acquisition module 401, a distance acquisition module 402, a parameter determination module 403, and an image processing module 404. In some embodiments, the image acquisition module 401 is configured to acquire a first image of a target object using a fisheye camera of the electronic device. In some embodiments, the distance acquisition module 402 is configured to acquire the distance between the target object and the electronic device. In some embodiments, the parameter determination module 403 is configured to determine a first parameter corresponding to the distance. In some embodiments, the image processing module 404 is configured to perform anti-distortion processing on the first image based on the first parameter to obtain a second image.
[0050] It should be understood that the description of the control method for electronic devices also applies to the control device 400 for electronic devices described herein, but for simplicity, it will not be described in detail here.
[0051] In some embodiments, the electronic device includes a head-mounted device. In some embodiments, the first parameter is between 0 and 1, and the greater the distance, the larger the first parameter. In some embodiments, the control device further includes: a scene acquisition module configured to acquire the application scene of the fisheye camera; and a parameter adjustment module configured to adjust the image acquisition parameters of the fisheye camera based on the application scene. In some embodiments, performing anti-distortion processing on the first image based on the first parameter includes: performing anti-distortion processing on the first image based on the first parameter and the application scene. In some embodiments, the control device further includes: a parameter acquisition module configured to acquire light parameters through a light sensor of the electronic device; and a parameter adjustment module configured to adjust the image acquisition parameters of the fisheye camera based on the light parameters when acquiring the first image of the target object through the fisheye camera of the electronic device. In some embodiments, performing anti-distortion processing on the first image based on the first parameter includes: performing anti-distortion processing on the first image based on the first parameter and the light parameters.
[0052] Furthermore, this disclosure also provides a terminal, comprising: at least one memory and at least one processor; wherein the memory is used to store program code, and the processor is used to call the program code stored in the memory to execute the control method of the above-described electronic device.
[0053] In addition, this disclosure also provides a computer storage medium storing program code for executing the control method of the above-described electronic device.
[0054] The control method and apparatus for the electronic device of this disclosure have been described above based on embodiments and application examples. Furthermore, this disclosure also provides a terminal and a storage medium, which are described below.
[0055] The following is for reference. Figure 6 The diagram illustrates a structural schematic of an electronic device (e.g., a terminal device or a server) 500 suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0056] like Figure 6As shown, the electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0057] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0058] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.
[0059] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0060] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0061] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0062] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods of the present disclosure.
[0063] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0064] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0065] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.
[0066] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary hardware logic components that can be used include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0067] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0068] According to one or more embodiments of this disclosure, a control method for an electronic device is provided. The control method includes: acquiring a first image of a target object through a fisheye camera of the electronic device; acquiring the distance between the target object and the electronic device; determining a first parameter corresponding to the distance; and performing anti-distortion processing on the first image based on the first parameter to obtain a second image.
[0069] According to one or more embodiments of this disclosure, the electronic device includes a head-mounted device.
[0070] According to one or more embodiments of this disclosure, the first parameter is between 0 and 1, and the greater the distance, the larger the first parameter is.
[0071] According to one or more embodiments of this disclosure, when acquiring the first image of the target object through the fisheye camera of the electronic device, the method further includes: acquiring the application scenario of the fisheye camera; and adjusting the image acquisition parameters of the fisheye camera based on the application scenario.
[0072] According to one or more embodiments of this disclosure, performing anti-distortion processing on the first image based on the first parameter includes: performing anti-distortion processing on the first image based on the first parameter and the application scenario.
[0073] According to one or more embodiments of this disclosure, the method further includes: acquiring light parameters through a light sensor of the electronic device; and adjusting the image acquisition parameters of the fisheye camera based on the light parameters when acquiring the first image of the target object through the fisheye camera of the electronic device.
[0074] According to one or more embodiments of this disclosure, performing anti-distortion processing on the first image based on the first parameter includes: performing anti-distortion processing on the first image based on the first parameter and the light parameter.
[0075] According to one or more embodiments of this disclosure, a control device for an electronic device is provided, the control device comprising: an image acquisition module configured to acquire a first image of a target object through a fisheye camera of the electronic device; a distance acquisition module configured to acquire the distance between the target object and the electronic device; a parameter determination module configured to determine a first parameter corresponding to the distance; and an image processing module configured to perform anti-distortion processing on the first image based on the first parameter to obtain a second image.
[0076] According to one or more embodiments of this disclosure, a terminal is provided, comprising: at least one memory and at least one processor; wherein the at least one memory is used to store program code, and the at least one processor is used to invoke the program code stored in the at least one memory to execute the method described in any one of the above descriptions.
[0077] According to one or more embodiments of the present disclosure, a storage medium is provided for storing program code for performing the methods described above.
[0078] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0079] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0080] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A control method for an electronic device, characterized in that, The control method for the electronic device includes: A first image of the target object is acquired through the fisheye camera of the electronic device; Obtain the distance between the target object and the electronic device; Determine the first parameter corresponding to the distance; The second image is obtained by performing anti-distortion processing on the first image based on the first parameter, including: obtaining the distortion coordinates (x', y') of points on the first image on the imaging plane, and according to the intrinsic parameters (f) of the fisheye camera. x , f y ,c x , c y Calculate the coordinates (u, v) of the point after distortion correction using the following formula: u=(f x* x'(1-factor)+c x* factor),v=(f y* y'(1-factor)+c y* factor) ; Wherein, factor is the first parameter, which is between 0 and 1, and the larger the distance, the larger the first parameter is. The first parameter is used to adjust the coverage of the anti-distortion processing.
2. The control method for an electronic device according to claim 1, characterized in that, The electronic devices include head-mounted devices.
3. The control method for an electronic device according to claim 1, characterized in that, When acquiring the first image of the target object through the fisheye camera of the electronic device, the method further includes: Obtain the application scenarios of the fisheye camera; Adjust the image acquisition parameters of the fisheye camera based on the application scenario.
4. The control method for an electronic device according to claim 3, characterized in that, Performing anti-distortion processing on the first image based on the first parameter includes: performing anti-distortion processing on the first image based on the first parameter and the application scenario.
5. The control method for an electronic device according to claim 1, characterized in that, Also includes: Light parameters are acquired through the light sensor of the electronic device; When acquiring the first image of the target object through the fisheye camera of the electronic device, the image acquisition parameters of the fisheye camera are adjusted based on the light parameters.
6. The control method for an electronic device according to claim 5, characterized in that, Performing anti-distortion processing on the first image based on the first parameter includes: performing anti-distortion processing on the first image based on the first parameter and the light parameter.
7. A control device for an electronic device, characterized in that, The control device for the electronic device includes: The image acquisition module is configured to acquire a first image of the target object through the fisheye camera of the electronic device; The distance acquisition module is configured to acquire the distance between the target object and the electronic device; The parameter determination module is configured to determine a first parameter corresponding to the distance; The image processing module is configured to perform anti-distortion processing on the first image based on the first parameter to obtain a second image, including: obtaining the distortion coordinates (x', y') of points on the first image on the imaging plane, and processing the distortion coordinates (x', y') based on the intrinsic parameters (f) of the fisheye camera. x , f y , c x , c y Calculate the coordinates (u, v) of the point after distortion correction using the following formula: u=(f x* x'(1-factor)+c x* factor),v=(f y* y'(1-factor)+c y* factor) ; Wherein, factor is the first parameter, which is between 0 and 1, and the larger the distance, the larger the first parameter is. The first parameter is used to adjust the coverage of the anti-distortion processing.
8. A terminal, comprising: At least one memory and at least one processor; The at least one memory is used to store program code, and the at least one processor is used to call the program code stored in the at least one memory to execute the control method of the electronic device according to any one of claims 1 to 6.
9. A storage medium for storing program code for executing the control method of the electronic device according to any one of claims 1 to 6.
Citation Information
Patent Citations
Image correction method, apparatus, device and system, camera device and display device
CN107424126A
Image distortion correction method, terminal and computer-readable storage medium
CN107680060A
Distortion parameter modeling method and device, correction method, terminal and storage medium
CN107707821A
Image distortion correction method and device, computer readable medium and electronic equipment
CN114612341A