Image definition extraction circuit for camera focusing
By designing an image definition extraction circuit for the camera, including interval selection control, differential absolute value, sub-maximum and maximum value extraction circuits, the problem of high computing resources and energy consumption when the camera auto-focuses in the existing technology is solved, achieving It achieves fast, low-energy image definition extraction, simplifies the circuit structure, and improves the efficiency of the camera focusing function.
Patent Information
- Application Number
- CN202322970431.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-03
- Publication Date
- 2024-10-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology requires a large amount of computing resources, time and energy consumption when implementing camera autofocus, and relies on large-capacity random access memory, resulting in slow operation speed and complex circuit structure.
An image definition extraction circuit for camera focusing is designed, including interval selection control and clock signal generator, differential absolute value circuit, sub-maximum value extraction circuit and maximum value extraction circuit. Image definition extraction is achieved through these circuits. , avoids dependence on random access memory, uses digital circuit implementation, and simplifies the circuit structure.
It achieves rapid image definition extraction, reduces computing resources, time and energy consumption, simplifies the circuit structure, improves computing speed, and is suitable as an external device for the camera focusing function.
Smart Images

Figure CN221862973U_ABST
Abstract
Description
Technical Field
[0001] The utility model relates to the field of image signal processing, in particular to an image clarity extraction circuit used for camera focusing. Background Art
[0002] When the camera acquires images at different distances, the focal length needs to be adjusted accordingly to get a clear image, so achieving autofocus is a very important function of the camera. In order to quickly capture specific images or moving targets, the requirement for autofocus is that the faster the better.
[0003] Autofocus can generally drive the motor to move the lens to change the focus position to obtain the best image quality according to the clarity of the image. In principle, the defocus of the image can be described by the point spread function (PSF). Defocus will cause the imaging point to spread, and the degree of diffusion is proportional to the degree of defocus. On the contrary, the better the focus, the more concentrated the energy of the light spot, the steeper the edge of the PSF and the greater the slope. The imaging of an object on the optical sensor can be regarded as the convolution of the real object and the PSF. The focused image presents clearer edges than the blurred image.
[0004] Therefore, the extraction of image clarity can be based on the gradient of the image or the first-order derivative gradient to measure the degree of focusing. Such algorithms are generally two-dimensional operators, such as Sobel, which require hundreds of thousands of bytes. For example, an image with a resolution of 640*480 requires about 300KByte of random access memory (RAM) to temporarily store image data. Therefore, the two-dimensional algorithm consumes considerable computing resources, time and energy. Using one-dimensional gradients, such as row differences, can also obtain a value proportional to the PSF edge slope, which reflects the degree of energy concentration of image pixels, that is, image clarity. Based on this principle, the utility model designs an image clarity extraction circuit for camera focusing. Utility Model Content
[0005] The utility model aims to provide an image definition extraction circuit for camera focusing, which solves the problem of automatic focusing of the camera.
[0006] To achieve the above-mentioned purpose, the utility model provides the following technical solutions: an image clarity extraction circuit for camera focusing, comprising an interval selection control and clock signal generator, a differential absolute value circuit, a second maximum value extraction circuit and a maximum value extraction circuit.
[0007] Preferably, the interval selection control and clock signal generator generates the signals required by other modules to control their operation according to the pixel clock PCLK, line reference HREF, line synchronization HSYNC, and field synchronization VSYNC signals input by the image sensor, and its control signals include data valid VALID, line count enable (HCNTEN), pixel count enable (PCNTEN), frame clock enable (VEN), line clock enable (HEN), clock signal CLKA of the digital differential absolute value circuit, clock signal CLKB of the next largest value extraction circuit and the maximum value extraction circuit, and reset signal RESETB.
[0008] Preferably, the interval selection control and clock signal generator includes a pixel counter, a row counter and corresponding setting registers and comparison logic circuits to generate a frame clock enable (VEN), a row clock enable (HEN), a clock signal CLKB and a reset signal RESETB for the next maximum value extraction circuit and the maximum value extraction circuit.
[0009] Preferably, the differential absolute value circuit comprises an n-bit input register, an n-bit delay register, an n-bit NOT gate, an n-bit adder and an n-bit XNOR gate, wherein the operating clock signal CLKA is obtained by ANDing PCLK and HREF, the signal of the n-bit input register is input to the n-bit delay register to realize a delay of one clock cycle, the output signal of the n-bit delay register is inverted bit by bit and used as the input of the n-bit adder with the output signal of the n-bit input register, the highest carry output CMSBa of the n-bit adder is fed back to its lowest carry input, CMSBa serves as a common input of the n-bit XNOR gate, and the output signal of the n-bit adder is another input of the n-bit XNOR gate, and the output of the XNOR gate is the differential absolute value.
[0010] Preferably, the next-largest value extraction circuit comprises an m-bit next-largest value input register A, an m-bit next-largest value output register B, an m-bit NOT gate, and an m-bit adder C. The clock signal of the next-largest value input register is CLKB, that is, the output signal of the differential absolute value circuit is latched each time the rising edge of CLKB arrives. The output A of the next-largest value input register is connected to the input of the next-largest value output register. The signal B of the next-largest value output register is inverted bit by bit and added to the signal of the next-largest value input register. The highest-order carry output CMSBb of the adder C is used as the clock signal of the next-largest value output register. When the next-largest value input is greater than the original value in the next-largest value output register, CMSBb will change from 0 to 1, driving the next-largest value output register to update to the next-largest value input register value A. After the update, the value of the next-largest value output register is equal to the value of its input register. After inversion and addition, the highest-order carry output CMSBb of the adder is restored to 0, and the signal of the next-largest value output register is output to the maximum value extraction circuit for comparison with the maximum value.
[0011] Preferably, the maximum value extraction circuit includes an m-bit maximum value output register, an m-bit NOT gate, and an m-bit adder. The clock signal of the maximum value input register is CLKB, that is, the output signal from the next largest value is latched each time the rising edge of CLKB arrives. The output of the maximum value input register is connected to the input of the maximum value output register. The signal of the maximum value output register is inverted bit by bit and then added to the signal of the maximum value input register. The highest carry output CMSBc of the adder is used as the clock signal of the maximum value output register. When the maximum value input is greater than the value in the original next largest value output register, CMSBc will change from 0 to 1, driving the maximum value output register to update to the value A of the maximum value input register. The value of the maximum value output register is equal to the value of its input register. Therefore, after inverting and adding again, the highest carry output CMSBb of the adder is restored to 0.
[0012] Compared with the prior art, the beneficial effects of the utility model are as follows:
[0013] 1. The image clarity extraction circuit for camera focusing implemented by the utility model structure can avoid the use of large-capacity random access memory, reduce the required computing resources, time and energy consumption, and improve the computing speed.
[0014] 2. The image clarity extraction circuit for camera focus implemented by the structure of the utility model does not need to read and write random access memory (RAM), has a fast running speed, does not need to occupy too much operation time of the single-chip microcomputer, and can be used as an external device of the overall control single-chip microcomputer to assist in realizing the camera focus function.
[0015] 3. The image clarity extraction circuit for camera focusing implemented by the structure of the utility model does not require random access memory (RAM), has a relatively simple circuit structure, can be implemented using digital circuits such as programmable logic FPGA, CPLD or application-specific integrated circuits, and has a flexible implementation method. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a block diagram of the circuit structure of image clarity extraction for camera focusing;
[0017] Figure 2 It is a signal timing relationship of an image clarity extraction circuit used for camera focusing;
[0018] Figure 3 It is an interval control signal generator for an image clarity extraction circuit used for camera focus;
[0019] Figure 4 It is a differential absolute value circuit for an image clarity extraction circuit used for camera focusing;
[0020] Figure 5 The invention relates to a sub-maximum value extraction circuit of an image clarity extraction circuit used for camera focusing;
[0021] Figure 6 The utility model relates to a maximum value extraction circuit of an image clarity extraction circuit used for camera focusing. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the utility model to clearly and completely describe the technical solutions in the embodiments of the utility model. Obviously, the described embodiments are only part of the embodiments of the utility model, not all of the embodiments. Based on the embodiments in the utility model, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the utility model.
[0023] Figure 1 This is a structural block diagram of the utility model; the described image clarity extraction circuit for camera focusing includes an interval selection control and clock signal generator, a digital differential absolute value circuit, and a sub-maximum value and maximum value extraction circuit.
[0024] Figure 2 This is a signal timing relationship diagram of an image clarity extraction circuit for camera focusing described in the present invention. The processing flow of each module is described in detail below.
[0025] like Figure 3 The interval selection control and clock signal generator of the utility model generates the signals required by other modules according to the pixel clock PCLK, line reference HREF, line synchronization HSYNC, and field synchronization VSYNC signals input by the image sensor to control its operation. Its control signals include data valid VALID, line count enable (HCNTEN), pixel count enable (PCNTEN), frame enable (VEN), row enable (HEN), clock signal CLKA of the digital differential absolute value circuit, clock signal CLKB of the next maximum value and maximum value extraction circuit, and reset signal RESETB. The timing relationship is as follows: Figure 2 As shown, its output signal mainly controls the second maximum value and maximum value extraction circuits.
[0026] like Figure 4 As shown, the differential absolute value circuit includes an n-bit input register, an n-bit delay register, an n-bit NOT gate, an n-bit adder and an n-bit XNOR gate. Its structure is as follows Figure 4As shown, the output signal B of the n-bit delay register is inverted bit by bit and then used as the input of the n-bit adder together with the output signal A of the n-bit input register. The highest carry output CMSBa of the n-bit adder is fed back to its lowest carry input. In addition, CMSBa serves as a common input of the n-bit XNOR gate, and the output signal of the n-bit adder is the other input of the n-bit XNOR gate. The output of the XNOR gate is the absolute value of the difference.
[0027] like Figure 5 As shown, the next largest value extraction circuit includes an m-bit next largest value input register, an m-bit next largest value output register, an m-bit NOT gate, and an m-bit adder. Its structure is as follows Figure 5 As shown, the clock signal of the next-largest value input register is CLKB, that is, the output signal of the differential absolute value circuit is latched every time the rising edge of CLKB arrives, the output A of the next-largest value input register is connected to the input of the next-largest value output register, the signal B of the next-largest value output register is inverted bit by bit and added to the signal of the next-largest value input register, the highest carry output CMSBb of the adder C is used as the clock signal of the next-largest value output register, when the next-largest value input is greater than the original value in the next-largest value output register, CMSBb will change from 0 to 1, driving the next-largest value output register to update to the next-largest value input register value A, after the update, the value of the next-largest value output register is equal to the value of its input register, so, after inversion and addition, the highest carry output CMSBb of the adder is restored to 0, and the signal of the next-largest value output register is output to the maximum value extraction circuit for comparison with the maximum value.
[0028] like Figure 6 As shown, the maximum value extraction circuit includes an m-bit maximum value output register A, an m-bit NOT gate, and an m-bit adder. Its structure is as follows Figure 6 As shown, the clock signal of the maximum value input register is CLKB, that is, each time the rising edge of CLKB arrives, the output signal from the second largest value is latched, the output of the maximum value input register is connected to the input of the maximum value output register, the signal of the maximum value output register is inverted bit by bit and added to the signal of the maximum value input register, the adder's highest carry output CMSBc is used as the clock signal of the maximum value output register, when the maximum value input is greater than the value in the original second largest value output register, CMSBc will change from 0 to 1, driving the maximum value output register to update to the value of the maximum value input register, after the update, the value of the maximum value output register is equal to the value of its input register, so after inverting and adding again, the adder's highest carry output CMSBb is restored to 0.
[0029] The above is only a specific implementation method of the utility model, but the design concept of the utility model is not limited to this. Any non-substantial changes to the utility model using this concept shall be deemed as an infringement of the protection scope of the utility model.
[0030] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An image clarity extraction circuit for camera focusing, characterized in that: It includes an interval selection control and clock signal generator, a maximum value input register, a differential absolute value circuit, a second maximum value extraction circuit and a maximum value extraction circuit; The interval selection control and clock signal generator generates the signals required by other modules according to the pixel clock PCLK, line reference HREF, line synchronization HSYNC, and field synchronization VSYNC signals input by the image sensor to control its operation, and its control signals include data valid VALID, line count enable (HCNTEN), pixel count enable (PCNTEN), frame clock enable (VEN), line clock enable (HEN), clock signal CLKA of the digital differential absolute value circuit, clock signal CLKB of the next maximum value extraction circuit and the maximum value extraction circuit, and reset signal RESETB; The interval selection control and clock signal generator includes a pixel counter, a row counter, and corresponding setting registers and comparison logic circuits to generate a frame clock enable (VEN), a row clock enable (HEN), a clock signal CLKB for a second maximum value extraction circuit and a maximum value extraction circuit, and a reset signal RESETB; The differential absolute value circuit comprises an n-bit input register, an n-bit delay register, an n-bit NOT gate, an n-bit adder and an n-bit XNOR gate, wherein the operating clock signal CLKA is obtained by performing AND operation of PCLK and HREF, the signal of the n-bit input register is input into the n-bit delay register to realize a delay of one clock cycle, the output signal of the n-bit delay register is inverted bit by bit and used as the input of the n-bit adder together with the output signal of the n-bit input register, the highest carry output CMSBa of the n-bit adder is fed back to its lowest carry input, CMSBa serves as a common input of the n-bit XNOR gate, and the output signal of the n-bit adder is another input of the n-bit XNOR gate, and the output of the XNOR gate is the differential absolute value; The second largest value extraction circuit comprises an m-bit second largest value input register A, an m-bit second largest value output register B, an m-bit NOT gate, and an m-bit adder C. The clock signal of the second largest value input register is CLKB, that is, the output signal of the differential absolute value circuit is latched every time the rising edge of CLKB arrives. The output A of the second largest value input register is connected to the input of the second largest value output register. The signal B of the second largest value output register is added with the signal of the second largest value input register after bit-by-bit inversion. The highest-order carry output CMSBb of the adder C is used as the clock signal of the second largest value output register. When the second largest value input is greater than the value in the original second largest value output register, CMSBb changes from 0 to 1, driving the second largest value output register to update to the value A of the second largest value input register. After the update, the value of the second largest value output register is equal to the value of its input register. After inversion and addition, the highest-order carry output CMSBb of the adder is restored to 0. The signal of the second largest value output register is output to the maximum value extraction circuit for comparison with the maximum value. The maximum value extraction circuit comprises an m-bit maximum value output register, an m-bit NOT gate, and an m-bit adder. The clock signal of the maximum value input register is CLKB, that is, the output signal from the second largest value is latched each time the rising edge of CLKB arrives. The output of the maximum value input register is connected to the input of the maximum value output register. The signal of the maximum value output register is inverted bit by bit and then added to the signal of the maximum value input register. The highest carry output CMSBc of the adder is used as the clock signal of the maximum value output register. When the maximum value input is greater than the value in the original second largest value output register, CMSBc will change from 0 to 1, driving the maximum value output register to update to the value A of the maximum value input register. The value of the maximum value output register is equal to the value of its input register, so after inverting and adding again, the highest carry output CMSBb of the adder is restored to 0.
