Camera automatic focusing method and device, storage medium and electronic equipment
By introducing a signal receiving module and driver in the camera, storing and splitting the camera's digital signals to extract phase data, the problem that the camera cannot be autofocused is solved, and the combination of low-cost chips and cameras can also be used for autofocus control.
Patent Information
- Application Number
- CN202510279327.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-06-06
AI Technical Summary
In the prior art, the camera cannot complete automatic focus when the chip does not have the ability to filter digital signal data and the camera does not have the ability to filter data.
The digital signal sent by the camera is obtained through the chip's signal receiving module and stored in memory. Then, a digital signal is obtained from memory through a driver, a splitting process is performed to extract the phase data, and sent it to the image processing unit to control the camera focus.
The camera's automatic focus function is realized. Even if the camera and chip do not have the ability to screen digital signal data, the phase data can be filtered and calculated through the driver to achieve focus control.
Smart Images

Figure CN120111359A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of camera focusing, and in particular to a camera automatic focusing method, device, storage medium and electronic device. Background Art
[0002] In the prior art, during the process of automatic focusing of a camera, the light signal can be captured by the camera and converted into a digital signal, which can be sent to the image processing unit of the chip, and the image processing unit calculates the focus data according to the digital signal to complete the automatic focusing of the camera. In the prior art, the digital signal is sent to the image processing unit in the following situations:
[0003] The first case is to send it directly to the image processing unit, which processes the digital signal. This case requires the chip to have the ability to filter digital signal data, filter out phase data from the digital signal, and then calculate the focus data, which places high requirements on the chip.
[0004] The second situation is that the camera filters the digital signal, filters out the phase data, and sends the filtered phase data to the image processing unit of the chip. This situation requires the camera to have the ability to filter digital signal data, which places higher requirements on the camera.
[0005] However, if the chip does not have the data filtering capability for digital signals and the camera does not have the data filtering capability, the chip will receive a complete digital signal but will not be able to process the digital signal to obtain the focus data and thus will not be able to complete the focus. Summary of the invention
[0006] The present application provides a camera auto-focusing method, device, storage medium and electronic device to solve the technical problem that the camera cannot complete auto-focusing.
[0007] In a first aspect, the present application provides a camera autofocus method, comprising: when a signal receiving module of a chip obtains a digital signal sent by a camera, the signal receiving module stores the digital signal in a memory; the digital signal is obtained from the memory, and the digital signal is split and processed to obtain phase data containing light phase information; the phase data is sent to an image processing unit of the chip; and the camera focus is controlled according to the calculation result of the phase data by the image processing unit.
[0008] As an optional example, the above-mentioned splitting and processing of the above-mentioned digital signal to obtain phase data containing light phase information includes: obtaining the physical layout information of the phase detection pixels in the camera sensor of the above-mentioned camera according to the above-mentioned digital signal; and extracting the above-mentioned phase data from the above-mentioned digital signal according to the above-mentioned physical layout information.
[0009] As an optional example, the above-mentioned obtaining the physical layout information of the phase detection pixels in the camera sensor of the above-mentioned camera according to the above-mentioned digital signal includes: determining the model of the above-mentioned camera according to the above-mentioned digital signal; and querying the corresponding physical layout information from the model and physical layout information table according to the model of the above-mentioned camera.
[0010] As an optional example, the above-mentioned physical layout information includes the data type and data location of each pixel point in the above-mentioned camera sensor, and the above-mentioned extraction of the above-mentioned phase data from the above-mentioned digital signal according to the above-mentioned physical layout information includes: deleting the pixel points of the data type in the above-mentioned physical layout information, and determining the remaining physical layout information as the above-mentioned phase data; or, extracting the pixel points of the phase type in the above-mentioned physical layout information, and determining them as the above-mentioned phase data.
[0011] As an optional example, the above-mentioned phase type pixel points include left channel type pixel points and right channel type pixel points. The above-mentioned extracting the above-mentioned phase data from the above-mentioned digital signal according to the above-mentioned physical layout information includes: extracting the left channel type pixel points as left channel phase data, and extracting the right channel type pixel points as right channel phase data.
[0012] As an optional example, before the signal receiving module of the chip acquires the digital signal, the method further includes: adjusting the storage path configuration of the signal receiving module from the image processing unit to the memory, so that the signal receiving module stores the digital signal in the memory.
[0013] As an optional example, the above-mentioned obtaining the above-mentioned digital signal from the above-mentioned memory and splitting and processing the above-mentioned digital signal includes: obtaining the above-mentioned digital signal from the above-mentioned memory through a driver installed on the operating system of the above-mentioned chip, and splitting and processing the above-mentioned digital signal, wherein the corresponding above-mentioned driver is equipped according to different models of the above-mentioned camera.
[0014] In a second aspect, the present application provides a camera autofocus device, including a signal receiving module, for storing the digital signal in a memory when a digital signal sent by a camera is obtained; an acquisition module, for obtaining the digital signal from the memory, and splitting and processing the digital signal to obtain phase data containing light phase information; a sending module, for sending the phase data to an image processing unit of a chip; and a control module, for controlling the camera focus according to the calculation result of the phase data by the image processing unit. In a third aspect, the present application provides an electronic device, including: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor is configured to implement any one of the above-mentioned camera autofocus methods when executing the computer program.
[0015] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute any of the above-mentioned camera autofocus methods of the present application.
[0016] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: in the solution provided by the embodiment of the present application, when the signal receiving module of the chip obtains the digital signal sent by the camera, the signal receiving module stores the above digital signal in the memory; obtains the above digital signal from the above memory, and splits and processes the above digital signal to obtain phase data containing light phase information; sends the above phase data to the image processing unit of the chip; and controls the focus of the camera according to the calculation result of the above phase data by the above image processing unit. Therefore, in the process of automatic focusing of the camera, the camera and the chip do not need to provide the ability to filter the digital signal by themselves, but complete the data filtering through the driver program, filter the phase data, and then let the chip complete the calculation of the phase data and complete the focus control, so as to achieve the purpose of automatic focus control of the camera by the combination of low-cost chip and low-cost camera. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0020] Figure 1 A flowchart of a camera auto-focusing method provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of processing a digital signal provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of a phase detection pixel provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of pixel division provided in an embodiment of the present application;
[0024] Figure 5 A flowchart of a camera auto-focusing method provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of extracting phase data provided in an embodiment of the present application;
[0026] Figure 7a and Figure 7b A schematic diagram of phase data provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0029] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0030] In order to solve the technical problem that the camera in the prior art cannot complete autofocus, the present application provides a camera autofocus method, which can achieve the effect of autofocus control of the camera by combining a low-cost chip and a low-cost camera.
[0031] Figure 1 The following is a flow chart of a camera auto-focusing method provided in an embodiment of the present application. Figure 1 As shown, the above-mentioned camera automatic focusing method includes:
[0032] S102, when the signal receiving module of the chip obtains the digital signal sent by the camera, the signal receiving module stores the digital signal into the memory;
[0033] S104, acquiring the digital signal from the memory, and performing splitting processing on the digital signal to obtain phase data containing light phase information;
[0034] S106, sending the above phase data to the image processing unit of the chip;
[0035] S108, controlling the focus of the camera according to the calculation result of the phase data by the image processing unit.
[0036] The camera focusing method in the technical solution is applied in the process of automatic focusing of the camera. The above-mentioned digital signal is a signal obtained by converting the image after the camera captures the image. A camera sensor Sensor is installed on the camera, and the camera sensor can convert the captured light signal into a digital signal. The camera sensor includes a number of pixels. For example, a 5-megapixel camera sensor includes 2592x1944 pixels for light sensing, and each pixel can sense RGB (red, green, blue) three colors of light. On the 5 million pixels of the camera, phase detection pixels are reserved. The phase detection pixels do not sense RGB colors, but sense the position information of the light entering. When the camera is shooting, the phase difference can be determined by the phase detection pixels, and the focal length of the camera can be adjusted by the phase difference to achieve automatic focus of the camera.
[0037] The digital signal of the camera is generally sent to the image processing unit (ISP) of the chip, and the ISP calculates the phase difference. However, due to the low-performance chip and the low-performance camera, neither of them has the ability to filter phase data. Therefore, in this technical solution, the digital signal of the camera will not be directly transmitted to the ISP, but stored in the memory. The signal receiving module is a module that receives the digital signal. After receiving the digital signal, the digital signal can be stored in the memory and the storage location can be recorded. After storing the digital signal, the chip's operating system can obtain the digital signal from the memory through the driver, and split the digital signal to obtain the phase data containing the light phase information, and send the phase data to the image processing unit of the chip.
[0038] After acquiring the phase data, the image processing unit can calculate the phase data to obtain a calculation result, and adjust the focal length of the camera according to the calculation result to achieve automatic focusing of the camera.
[0039] That is to say, in the present technical solution, the digital signal of the camera is intercepted and stored in the memory, the digital signal in the memory is split and processed to obtain phase data, and the phase data is handed over to the image processing unit of the chip, so that the image processing unit processes the phase data to obtain the calculation result, and automatically focuses the camera. In this way, even cameras and chips that do not have the phase data extraction function can achieve automatic focus of the camera.
[0040] Figure 2 is a schematic diagram of processing a digital signal in this embodiment. After receiving the digital signal, the signal receiving module does not send the digital signal to the image processing unit, but stores the digital signal in the memory. Then the driver obtains the digital signal from the memory, performs splitting processing on the digital signal to obtain the phase data therein, and sends the phase data therein to the image processing unit. The image processing unit calculates the focus control result of the camera based on the phase data.
[0041] The solution provided by the embodiment of the present application is that when the signal receiving module of the chip obtains the digital signal sent by the camera, the signal receiving module of the chip stores the above digital signal in the memory; obtains the above digital signal from the above memory, and splits and processes the above digital signal to obtain phase data containing light phase information; sends the above phase data to the image processing unit of the chip; and controls the focus of the camera according to the calculation result of the above phase data by the above image processing unit. Therefore, in the process of automatically focusing the camera, the camera and the chip do not need to provide the ability to filter the digital signal by themselves, but complete the data filtering through the driver program, filter the phase data, and then let the chip complete the calculation of the phase data and complete the focus control, thereby achieving the purpose of automatically controlling the camera by combining a low-cost chip and a low-cost camera.
[0042] As an optional example, the above-mentioned splitting and processing of the above-mentioned digital signal to obtain phase data containing light phase information includes: obtaining the physical layout information of the phase detection pixels in the camera sensor of the above-mentioned camera according to the above-mentioned digital signal; and extracting the above-mentioned phase data from the above-mentioned digital signal according to the above-mentioned physical layout information.
[0043] In this embodiment, the above-mentioned physical layout information is the position and type of the pixels in the camera sensor of the camera. For example, the types may include two types, the first type is the pixels sensing the three colors of red, green and blue. The second type is the phase detection pixels. The two types of pixels and the position of each pixel in each type of pixel can be distinguished by the type annotation. Then, the layout position of the phase detection pixels can be obtained through the physical layout information. Through the layout position, the phase detection pixels in the digital signal are extracted to obtain the phase data.
[0044] For example, Figure 3 As shown, Figure 3 The example in the figure is an example of 5 pixels in the horizontal direction and 4 pixels in the vertical direction. Among the 20 pixels in total, 5 pixels in the horizontal direction and 4 pixels in the vertical direction, most of the pixels are pixels for sensing the three colors of red, green and blue. Some pixels are not used to sense the three colors of red, green and blue, but are phase detection pixels for marking the phase. Figure 3 A pixel point partially filled with a black square in FIG. 1 indicates that the pixel point is a phase detection pixel.
[0045] As an optional example, the above-mentioned obtaining the physical layout information of the phase detection pixels in the camera sensor of the above-mentioned camera according to the above-mentioned digital signal includes: determining the model of the above-mentioned camera according to the above-mentioned digital signal; and querying the corresponding physical layout information from the model and physical layout information table according to the model of the above-mentioned camera.
[0046] In this embodiment, since the pixels of the cameras are different, the physical layout information that matches the cameras with different pixels can be determined. For example, for a 2-megapixel camera, the number of pixels in length and width is different from the number of pixels in length and width of a 5-megapixel camera. Therefore, the physical layout information is also different. In addition, for cameras with the same pixels, even if the number of pixels in length and width is the same, the phase detection pixels can be set at different positions in the physical layout, thereby forming different physical layout information.
[0047] Therefore, in this embodiment, the corresponding physical layout information can be determined according to the number of pixels of the camera and the position of the phase detection element. Different models of cameras can correspond to different physical layout information, and cameras with different numbers of pixels can also correspond to different physical layout information.
[0048] In one example, when determining the physical layout information of a camera of a certain model or a certain number of pixels, the camera sensor of the camera can be divided into different parts according to the area, each part includes the same number of pixels, and each part can be set with 0 or one or more phase detection pixels.
[0049] For example, Figure 4 As shown, Figure 4 An 8×8 pixel area is shown in the figure. In this embodiment, the physical layout in the physical layout information can be divided into different areas according to 8×8. Zero or one or more phase detection pixels can be set in each area. The specific settings and the number of settings are determined according to actual needs. In an example, when determining the physical layout information, it can be determined by testing whether different numbers and positions of phase detection pixels have an effect on the speed of automatic focusing of the camera, so as to determine the appropriate number and position.
[0050] As an optional example, the above-mentioned physical layout information includes the data type and data location of each pixel point in the above-mentioned camera sensor, and the above-mentioned extraction of the above-mentioned phase data from the above-mentioned digital signal according to the above-mentioned physical layout information includes: deleting the pixel points of the data type in the above-mentioned physical layout information, and determining the remaining physical layout information as the above-mentioned phase data; or, extracting the pixel points of the phase type in the above-mentioned physical layout information, and determining them as the above-mentioned phase data.
[0051] In this embodiment, the phase data may be the distribution of phase detection pixels in the physical layout. Since the physical layout information of cameras of different models or different numbers of pixels is different, when extracting phase data, the phase detection pixels are extracted according to the type and position of each pixel in the physical layout information. There are many ways to extract, one of which is to delete the pixels in the physical layout information except the phase detection pixels, and the remaining pixels are the phase detection pixels. At this time, only the phase detection pixels are retained in the physical layout information, which can be used as phase data. Another method is to extract the phase detection elements from the physical layout information to the blank pixel layout that is the same as the physical layout. After the phase detection elements are filled in the blank pixel layout, it can be used as phase data.
[0052] As an optional example, the above-mentioned phase type pixel points include left channel type pixel points and right channel type pixel points. The above-mentioned extracting the above-mentioned phase data from the above-mentioned digital signal according to the above-mentioned physical layout information includes: extracting the left channel type pixel points as left channel phase data, and extracting the right channel type pixel points as right channel phase data.
[0053] In this embodiment, the phase data in the physical layout information can be divided into left channel phase data and right channel phase data. When acquiring phase data, the left channel phase data and the right channel phase data can be summed up to obtain the total phase data. In addition, the left channel phase data can be acquired separately, and the right channel phase data can be acquired separately, so as to separate the left channel phase data from the right channel phase data. For example, Figure 3 In the phase detection pixel, the black filling block is on the left side of the pixel or on the right side of the pixel. Thus, the pixel is divided into left channel pixel and right channel pixel. The data composed of the left channel pixel is the left channel pixel data, and the data composed of the right channel pixel is the right channel pixel data.
[0054] As an optional example, before the signal receiving module of the chip acquires the digital signal, the method further includes: adjusting the storage path configuration of the signal receiving module from the image processing unit to the memory, so that the signal receiving module stores the digital signal in the memory.
[0055] In this embodiment, the digital signal is obtained through the signal receiving module of the chip. If the storage path configuration of the signal receiving module is not adjusted, the signal receiving module will send the digital signal to the image processing unit of the chip after obtaining the digital signal. Therefore, it is necessary to change the data transmission path of the signal receiving module through pre-configuration, from the original sending to the image processing unit to adjusting it to be stored in the memory. Therefore, the storage path of the signal receiving module is configured as a memory, so that after the signal receiving module obtains the digital signal, it will store the digital signal in the memory. By configuring the storage path as a memory, the digital signal is intercepted and stored in the memory.
[0056] In one example, adjusting the data transmission path of the signal receiving module can be determined by adjusting the parameters in the channel configuration of the chip, such as changing the channel configuration mode from normal to raw_rdback_frame x 1. After adjusting the parameters, the digital signal of the camera sensor will be sent to the memory via the signal receiving module instead of to the image processing unit. The chip is equipped with a corresponding library to support parameter adjustment, and the parameters can be adjusted through the corresponding application programming interface (API).
[0057] As an optional example, the above-mentioned obtaining the above-mentioned digital signal from the above-mentioned memory and splitting and processing the above-mentioned digital signal includes: obtaining the above-mentioned digital signal from the above-mentioned memory through a driver installed on the operating system of the above-mentioned chip, and splitting and processing the above-mentioned digital signal, wherein the corresponding above-mentioned driver is equipped according to different models of the above-mentioned camera.
[0058] In the embodiment of the present application, a driver can be installed on the operating system of the chip, and different drivers can be configured according to the camera model and the number of pixels of the camera. When a digital signal is obtained, a corresponding driver can be used to split and process the digital signal to obtain the phase data therein.
[0059] The technical solution is explained in conjunction with a process of automatically focusing a camera.
[0060] In this technical solution, the camera sensor includes a plurality of pixels, including pixels for sensing RGB colors and phase detection pixels for determining the position where light enters. The camera sensor of the camera can convert light into a digital signal, and the digital signal includes the image raw data Bayer Raw Image (BayerRAW) containing RGB color information, and the phase raw data Phase Detection Raw (PD RAW) of the light. The camera sends the digital signal to the signal receiving module (Video Capture, VICAP). VICAP is a video capture component that captures the digital signal sent by the camera. By configuring VICAP, the data channel between VICAP and ISP is closed, and the output of VICAP is configured to be output to the double data rate (Double Data Rate, DDR) memory.
[0061] like Figure 5 As shown in the figure, the hardware part includes the camera sensor and the chip. The hardware part of the chip includes at least VICAP and ISP. The digital signal sent by the camera sensor is captured by VICAP, and VICAP stores it in the DDR memory. The way to close the data channel between VICAP and ISP can be achieved through the configuration interface provided by the chip. Taking an RK3562 chip as an example, the chip provides a configuration method. Through the configuration method, the channel configuration mode of the CSI2RX module can be changed from normal to raw_rdback_frame x 1. The data of the camera sensor will be sent to the DDR memory through VICAP, and the software can obtain the digital signal output by the camera sensor from the memory.
[0062] After the data is stored in the DDR memory, the software driver obtains the digital signal from the DDR memory, and then separates the digital signal to separate the bayer raw image data and PD raw phase data. For example, in the rawstream application programming interface (API) callback, the data acquisition process is called up, the RAW data is taken out from the DDR, and then the data is separated to separate the bayer raw image data and PD raw phase data. The separation means can be based on the physical layout information of the camera sensor, and the PD Raw data can be extracted from the raw data. The physical layout information is provided by the original camera manufacturer, and specifically, all pixels of the camera sensor can be divided into multiple areas, such as 32x32 (or 64x64) areas. The position of the PD information in each area can be the same. The same position makes it easier to separate the data. Only one area needs to be separated, and other areas can be separated according to the separation method of the first area. After separation, PD Raw data can be obtained. The PD Raw data can finally include left channel L type data and right channel R type data. Figure 6 FIG. 1 is a schematic diagram of an exemplary extracted PD Raw data. The remaining pixels have been deleted, and the pixels of the phase data are retained. The pixels of the phase data are extracted and combined to obtain the phase data, such as Figure 7a and Figure 7b The phase difference is obtained by comparing the L-type data with the R-type data. The phase difference can be used to adjust the focal length of the camera. If the phase difference is large, the focal length is increased or decreased until the phase difference is reduced to below the preset threshold, thereby completing the automatic adjustment of the camera focal length.
[0063] In this solution, the driver software can use the graphics processing unit (GPU) or the central processing unit (CPU) to complete flexible software processing. When using CPU processing, there is also a distinction between the single instruction, multiple data (SIMD) architecture processor extension structure NEON instruction acceleration and general non-SIMD instructions. NEON is the name of the SIMD instruction set. Its execution performance ranking is:
[0064] GPU acceleration > CPU NEON instruction acceleration > CPU general non-SIMD instructions
[0065] The test was conducted on the RK3562 chip platform. The CPU was Arm cortex A53 with a main frequency of 1.2G. A 13-megapixel (4208x 3120) camera digital signal with phase data was input. The PD data was extracted using the CPU general instructions. The processing time of each digital signal RAW image was calculated. The test was repeated 30 times and the average time was taken.
[0066] When the camera sensor frame rate is 30fps, a frame of digital signal RAW image will be input every 33ms, and the software processing time cannot exceed 33ms. This meets the time requirements during the camera autofocus process and realizes autofocus in the case of low-performance chips and low-performance cameras.
[0067] The embodiment of the present application also provides a camera autofocus device. The above-mentioned camera autofocus device includes a module or unit, which is used to execute the steps of the above-mentioned camera autofocus method, such as the camera autofocus device includes: a signal receiving module, which is used to store the digital signal sent by the camera into a memory when the digital signal is obtained; an acquisition module, which is used to obtain the digital signal from the memory and split the digital signal to obtain phase data containing light phase information; a sending module, which is used to send the phase data to the image processing unit of the chip; a control module, which is used to control the camera focus according to the calculation result of the image processing unit on the phase data.
[0068] The camera focusing method in the technical solution is applied in the process of automatic focusing of the camera. The above-mentioned digital signal is a signal obtained by converting the image after the camera captures the image. A camera sensor Sensor is installed on the camera, and the camera sensor can convert the captured light signal into a digital signal. The camera sensor includes a number of pixels. For example, a 5-megapixel camera sensor includes 2592x1944 pixels for light sensing, and each pixel can sense RGB (red, green, blue) three colors of light. On the 5 million pixels of the camera, phase detection pixels are reserved. The phase detection pixels do not sense RGB colors, but sense the position information of the light entering. When the camera is shooting, the phase difference can be determined by the phase detection pixels, and the focal length of the camera can be adjusted by the phase difference to achieve automatic focus of the camera.
[0069] The digital signal of the camera is generally sent to the image processing unit (ISP) of the chip, and the ISP calculates the phase difference. However, due to the low-performance chip and the low-performance camera, neither of them has the ability to filter phase data. Therefore, in this technical solution, the digital signal of the camera will not be directly transmitted to the ISP, but stored in the memory. The signal receiving module is a module that receives the digital signal. After receiving the digital signal, the digital signal can be stored in the memory and the storage location can be recorded. After storing the digital signal, the chip's operating system can obtain the digital signal from the memory through the driver, and split the digital signal to obtain the phase data containing the light phase information, and send the phase data to the image processing unit of the chip.
[0070] After acquiring the phase data, the image processing unit can calculate the phase data to obtain a calculation result, and adjust the focal length of the camera according to the calculation result to achieve automatic focusing of the camera.
[0071] That is to say, in the present technical solution, the digital signal of the camera is intercepted and stored in the memory, the digital signal in the memory is split and processed to obtain phase data, and the phase data is handed over to the image processing unit of the chip, so that the image processing unit processes the phase data to obtain the calculation result, and automatically focuses the camera. In this way, even cameras and chips that do not have the phase data extraction function can achieve automatic focus of the camera.
[0072] Figure 2 is a schematic diagram of processing a digital signal in this embodiment. After receiving the digital signal, the signal receiving module does not send the digital signal to the image processing unit, but stores the digital signal in the memory. Then the driver obtains the digital signal from the memory, performs splitting processing on the digital signal to obtain the phase data therein, and sends the phase data therein to the image processing unit. The image processing unit calculates the focus control result of the camera based on the phase data.
[0073] The solution provided by the embodiment of the present application is that when the signal receiving module of the chip obtains the digital signal sent by the camera, the signal receiving module of the chip stores the above digital signal in the memory; obtains the above digital signal from the above memory, and splits and processes the above digital signal to obtain phase data containing light phase information; sends the above phase data to the image processing unit of the chip; and controls the focus of the camera according to the calculation result of the above phase data by the above image processing unit. Therefore, in the process of automatically focusing the camera, the camera and the chip do not need to provide the ability to filter the digital signal by themselves, but complete the data filtering through the driver program, filter the phase data, and then let the chip complete the calculation of the phase data and complete the focus control, thereby achieving the purpose of automatically controlling the camera by combining a low-cost chip and a low-cost camera.
[0074] For other examples of this embodiment, please refer to the above examples and will not be described in detail here.
[0075] like Figure 8 As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0076] Memory 113, used for storing computer programs;
[0077] In one embodiment of the present application, the processor 111 is used to implement the camera auto-focus method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 113 .
[0078] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the camera autofocus method provided by any of the aforementioned method embodiments is implemented.
[0079] The device embodiments described above are merely illustrative, wherein the units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0080] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0081] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0082] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A camera auto-focus method, characterized in that: include: When the signal receiving module of the chip obtains the digital signal sent by the camera, the digital signal is stored in the memory; Acquire the digital signal from the memory, and split the digital signal to obtain phase data containing light phase information; Sending the phase data to an image processing unit of a chip; The camera focus is controlled according to the calculation result of the phase data by the image processing unit.
2. The method according to claim 1, characterized in that The splitting and processing of the digital signal to obtain phase data containing light phase information includes: Acquire physical layout information of phase detection pixels in a camera sensor of the camera according to the digital signal; The phase data is extracted from the digital signal according to the physical layout information.
3. The method according to claim 2, characterized in that The acquiring, according to the digital signal, physical layout information of phase detection pixels in the camera sensor of the camera comprises: Determining the model of the camera according to the digital signal; According to the model of the camera, the corresponding physical layout information is queried from the model and physical layout information table.
4. The method according to claim 2, characterized in that: The physical layout information includes a data type and a data location of each pixel point in the camera sensor, and extracting the phase data from the digital signal according to the physical layout information includes: Deleting the pixel points of the data type in the physical layout information, and determining the remaining physical layout information as the phase data; or, Pixel points of the phase type are extracted from the physical layout information and determined as the phase data.
5. The method according to claim 4, characterized in that The pixel points of the phase type include pixel points of the left channel type and pixel points of the right channel type, and the extracting the phase data from the digital signal according to the physical layout information includes: The pixel points of the left channel type are extracted as the left channel phase data, and the pixel points of the right channel type are extracted as the right channel phase data.
6. The method according to claim 1, characterized in that Before the signal receiving module of the chip acquires the digital signal, the method further includes: The storage path configuration of the signal receiving module is adjusted from the image processing unit to the memory, so that the signal receiving module stores the digital signal in the memory.
7. The method according to claim 1, characterized in that The acquiring the digital signal from the memory and performing splitting processing on the digital signal comprises: The digital signal is obtained from the memory through a driver installed on the operating system of the chip, and the digital signal is split and processed, wherein the corresponding driver is equipped according to different models of the camera.
8. A camera auto-focus device, characterized in that: include: A signal receiving module, used for storing the digital signal in a memory when acquiring the digital signal sent by the camera; An acquisition module, used for acquiring the digital signal from the memory, and performing splitting processing on the digital signal to obtain phase data containing light phase information; A sending module, used for sending the phase data to an image processing unit of a chip; A control module is used to control the focus of the camera according to the calculation result of the phase data by the image processing unit.
9. An electronic device, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; At least one memory connected to the at least one bus, wherein a computer program is stored in the memory, and when the processor executes the computer program, the camera autofocus method described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the camera auto-focus method according to any one of claims 1 to 7 of the present application.