• Based on PXA255 automatic focusing and image gathering module design

    Picking   Wanting: This article introduced one kind based on Intel Corporation PXA255 embedded processor’s automatic focusing image gathering system. And introduced in detail the automatic focusing in FPGA realization as well as image gathering in embedded linux system’s realization, and has given this system’s hardware structure drawing.
    Key word: Automatic focusing; Image gathering; V4L video frequency connection; Embedded QT; Discrete cosine transformation

    Introduction
        At present in the market the popular photograph handset does not have the automatic focusing function generally, this affects not in a big way regarding the sensor resolution in 300,000 picture element following photograph handset, but along with 1,000,000 picture element handset’s appearing on the market, as well as handset video recording function use, the people pay attention more and more to camera’s automatic focusing function. This article in the Xhyper255 development board’s foundation, the union project development’s need, transplants QT/embedded on the development board to take embedded GUI, and has designed the automatic focusing and the image gathering submodule, the automatic focusing part realizes through verilog HDL in development board’s FPGA, the image gathering part video which provides using the linux essence 4 linux connections realizes. The final gathering procedure contact surface uses embedded QT design tool designer to carry on the design.


    Figure 1 hardware platform structure drawing


    Figure 2 DCT transformation module


    Figure 3 DCT transformation flow chart


    Figure 4 automatic focusing flow chart

    Based on imagery processing automatic focusing system algorithm
        Compares with the traditional automatic focusing algorithm, realizes based on imagery processing’s automatic focusing algorithm does not need the extra supply oscillator and the corresponding receive sensor, this is advantageous in reduces component’s volume to reduce the cost, and reduces component’s power loss.

        In this kind of algorithm, the analysis processing module to the video image which obtains carries on processing directly, by obtains the corresponding decision function, the actuation control module acts according to the focusing decision function information which obtains to actuate to step-by-step the electrical machinery, leads the lens shuttle, until obtains the focusing clear image. Therefore, constructed the reasonable decision function to become was at based on the imagery processing automatic focusing algorithm key. The ideal focusing decision function should have the unimodality, the unbiasedness and can reflect that being out of focus the polarity, simultaneously should have the strong antijamming ability.

        In makes the corresponding contrast after the present automatic focusing decision function, unifies this system’s feature selection 2D-DCT transformation elimination low frequency ingredient, other parts of adding together take the decision function. 2D-DCT transformation’s formula like type 1 shows.

    (1)
    Here C(0)=1/, C(u)=C(v)   (u, v≠0)

    Automatic focusing system’s realization
        Develops the platform build as shown in Figure 1.

        Uses the Xhyper255 embedded development board, the image gathering subsystem uses the following hardware build: 300,000 picture element CMOS image sensor OV7620, the MCS51 monolithic integrated circuit, USB controller OV511 , step-by-step the electrical machinery and the zoom lens.

        The OV7620 principal characteristic is: Monolithic digital color image sensor; 1/3 optics form; Digital video output format: 1~500 time of automatic to make public scopes; Automatic gain and automatic white balanced; Can carry on brightness, the contrast gradient, the degree of saturation, the gamma adjustment and so on many kinds of adjustment functions. 664×492 the image array scans primitive R, G, the B color picture signal, carries on processing and so on to make public, adjustment, white trimming after the simulation processing electric circuit may transform YUV according to the output request and so on many kinds of signal output form. OV511 is CMOS the image sensor design special-purpose USB interface control chip.

    DCT transformation FPGA realizes
         the 2D-DCT transformation is in the video compression commonly used transformation. In the process of packing, divides into an image many 8×8 scraps to carry on the transformation. 8×8 2D-DCT transformation like type (2) shows:

    (2)
    Here C(0)=1/, C(u)=C(v)=1 (u, v≠0 when).

        After the transformation, removes direct-current ingredient, other part adding together takes the focusing decision function. The function maximum value place namely locates the position for the focal point.

    1. Block preparation: Assigns size for 640×480 the color image matrix, divides into it three matrices, respectively be brightness matrix (Y), each size for 8×8, altogether 4800; Is left over synchronism matrix (I) and the orthogonal matrix (Q) differentiation is two groups of 1200 matrices, each size for 8×8, under the use the column matrix maps the RGB component in the Y, I, Q component:
    Y=0.30R 0.59G 0.11B
    I=0.60R-0.28G-0.32B
    Q=0.21R-0.52G 0.31B

         Calculates DCT to each 8×8 matrix Y, I, Q component, must calculate 2D-DCT, carries on 1D-DCT first to matrix each line, then carries on the 1D-DCT computation to the result matrix according to the row.

    2. DCT module design: The DCT coefficient uses the case sentence to realize with the search table structure, procedure source code not in this specification.

        The DCT transformation realizes the process is: The serial data first puts to the input block (uses ring-like register structure), then carries on the squaring, the summation operation, finally by parallel data form output. These operations must complete under the control module, guarantees the succession correctness.

        DCT transformation module’s diagram as shown in Figure 2. 8×8DCT the transformation in fact is 64 picture element concurrent operation. The operation which does to each picture element institute is: The data-in and the DCT coefficient multiplication, then add together obtain the final output. Flow as shown in Figure 3.

         May know by the formula, needs to calculate 8×8=64 time, calculates every time one from now on, makes the corresponding change i, j, u, v, and in was again in the mathematical table finds the corresponding coefficient, with the recent data multiplication, made the next operation.

    Automatic focusing realization
         Removes in each 8×8 matrix the low frequency ingredient. Then corresponding high-frequency component adding together, obtained and makes for the automatic focusing decision function, transmits CPU. The programming realizes a group PWM signal output, the control step-by-steps electrical machinery’s length of stride and the direction. Realizes the automatic focusing. Automatic focusing’s flow as shown in Figure 4.

    Image gathering realization
         The image gathering procedure’s compilation the Video4Linux connection which provides based on the linux essence. After Video4Linux is 2.2.0 editions, the linux essence provides to the network camera, video frequency equipment software development and so on gathering card, television card interface standards. This standard for the essence, the actuation, the application procedure provides API to carry on the exchange. The present newest Video4Linux edition is V4L2.

    Uses double URB to correspond in turn
         Regarding to the time sensitive and to the data accurate request not high image gathering application, the USB main line defined the ISOC mode of transmission, the USB camera must use this transmission mode. To obtain the image data quickly as far as possible, must assign the USB_ISO_ASAP sign in URB.
    urb->transfer_flags=USB_ISO_ASAP;
    // sends out this URB quickly as far as possible

         In the Linux system any USB transmission realizes through URB. In order to raise the speed, may consider that expands URB the cushion, may also establish two URB, in waited for that URB when recycles, when is the image is gathered by the sensor, processing, initialization another URB, and after recycling sends out immediately it. Two URB uses alternately, reduced the overtime greatly.

    The use memory mapping and raises the efficiency with the pair of frame cushion
      The Linux system and so on realizes through read, write to hardware’s operation, they adopt functions and so on copy_to_user(), copy_from_user() in the essence and the user memory space mutually the copy. But gathered this kind of need massive high speed transmission data regarding the video frequency the application, this method consumption’s hardware source was oversized, might enable this question through the memory mapping’s method to obtain the effective addressing. First uses the vmalloc() application enough big nucleus condition memory, takes it as the image data buffer space, two URB brings back the image data temporarily stores in here; Then uses the remap_page_range() function to map it by the page in the user space. The household condition image gathering disposal procedure uses the mmap() function, direct read-write essence image cushion memory, big reduced overhead. Moreover, to further enhance the frame speed rate, this article selects the pair of frame cushion method to carry on image gathering.

    Conclusion
       This system only need, in DCT algorithm’s realization realizes with the image gathering connection on acts according to the concrete hardware condition to make a revision, may apply in the majority intelligent product development (for example based on embedded linux intelligent handset’s development), therefore has the good market application prospect.

    Share/Save/Bookmark

No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

TOP
Copyright © 2008 51 Research and Design, Electronic Engineers website - Embedded Systems, MCU, DSP, EDA, Test and Measurement, Components, Communications, Power, Microelectronics, Semiconductors
Powered by WordPress | Theme by mg12 | Valid XHTML 1.1 and CSS 3