在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > 無線圖像(視頻)傳輸系統(tǒng)ARM9+Atmega16+OV7620+nrf24l01(三)

            無線圖像(視頻)傳輸系統(tǒng)ARM9+Atmega16+OV7620+nrf24l01(三)

            作者: 時間:2012-09-10 來源:網絡 收藏

            支持的像素是:VGA(640*480)、QVGA(320*240),我用的是QVGA模式(配合液晶屏顯示)。使用關鍵還是正確配置其內部寄存器,還有就是SCCB數(shù)據(jù)傳輸協(xié)議的實現(xiàn)。

            本文引用地址:http://www.biyoush.com/article/148440.htm

            首先有必要說下所支持的格式,因為,我對這塊不熟悉,這里只說明OV支持的幾種輸出格式,以及相關寄存器的配置。

            RGB16/8 bit ,這些格式都不是真正的RGB數(shù)據(jù)流,而是Bayer矩陣,所以在終端顯示時,必須將Bayer矩陣轉換為RGB。轉換的核心思想是通過插值算法將Bayer矩陣中的每個像素值(一個字節(jié))轉換為RGB三個字節(jié)(我不懂,只能說出方法,具體算法后面我會貼出)。

            本次采用的是RGB raw16 bit 模式,由于OV7620只引出了Y通道,所以配置為one line mode(這里出現(xiàn)了問題,明明RGB三個分量都有,但是通過插值后顯示出來的盡然還是灰度圖像,后面再分析原因)。下面貼出OV7620相關寄存器的配置:

            unsigned char reg_12_w_reset[2]={0x12,0x80};//先清零

            unsigned char reg_11_w[2]={0x11,0x00}; //配置PCLK速率 PCLK=(CLK_input/(CLK5:0>+1)*2)),本次為1/2時鐘頻率

            unsigned char reg_12_w[2]={0x12,0x2c}; //使能AGC,選擇raw data outtput,并且使能自動白平衡

            unsigned char reg_14_w[2]={0x14,0x24};//QVGA digital output format ,RGB gamma on

            unsigned char reg_28_w[2]={0x28,0xa0}; //one-line RGB data format ,select Progressive scan mode

            下面是Bayer轉RGB24的算法(在液晶屏上顯示時還要轉為RGB16):

            void bayer2rgb24(unsigned char *dst, unsigned char *src, long WIDTH, long HEIGHT)

            {

            long int i;

            unsigned char *rawpt, *scanpt;

            long int size;

            rawpt = src;

            scanpt = dst;

            size = WIDTH*HEIGHT;

            for ( i = 0; i size; i++ )

            {

            if ( (i/WIDTH) % 2 == 0 ) //奇數(shù)行

            {

            if ( (i % 2) == 0 ) //奇數(shù)列

            {

            /* B */

            if ( (i > WIDTH) ((i % WIDTH) > 0) )

            {

            *scanpt++ = ((long int)*(rawpt-WIDTH-1)+(long int)*(rawpt-WIDTH+1)+

            (long int)*(rawpt+WIDTH-1)+(long int)*(rawpt+WIDTH+1))/4; /* R */

            *scanpt++ = ((long int)*(rawpt-1)+(long int)*(rawpt+1)+

            (long int)*(rawpt+WIDTH)+(long int)*(rawpt-WIDTH))/4; /* G */

            *scanpt++ = *rawpt; /* B */

            }

            else /* first line or left column */

            {

            *scanpt++ = *(rawpt+WIDTH+1); /* R */

            *scanpt++ = ((long int)*(rawpt+1)+(long int)*(rawpt+WIDTH))/2; /* G */

            *scanpt++ = *rawpt; /* B */

            }

            }

            else

            {

            /* (B)G */

            if ( (i > WIDTH) ((i % WIDTH) (WIDTH-1)) )

            {

            *scanpt++ = ((long int)*(rawpt+WIDTH)+(long int)*(rawpt-WIDTH))/2; /* R */

            *scanpt++ = *rawpt; /* G */

            *scanpt++ = ((long int)*(rawpt-1)+(long int)*(rawpt+1))/2; /* B */

            }

            else /* first line or right column */

            {

            *scanpt++ = *(rawpt+WIDTH); /* R */

            *scanpt++ = *rawpt; /* G */

            *scanpt++ = *(rawpt-1); /* B */

            }

            }

            }

            else //偶數(shù)行

            {

            if ( (i % 2) == 0 ) //奇數(shù)列

            {

            /* G(R) */

            if ( (i (WIDTH*(HEIGHT-1))) ((i % WIDTH) > 0) )

            {

            *scanpt++ = ((long int)*(rawpt-1)+(long int)*(rawpt+1))/2; /* R */

            *scanpt++ = *rawpt; /* G */

            *scanpt++ = ((long int)*(rawpt+WIDTH)+(long int)*(rawpt-WIDTH))/2; /* B */

            }

            else

            {

            /* bottom line or left column */

            *scanpt++ = *(rawpt+1); /* R */

            *scanpt++ = *rawpt; /* G */

            *scanpt++ = *(rawpt-WIDTH); /* B */

            }

            }

            else

            {

            /* R */

            if ( i (WIDTH*(HEIGHT-1)) ((i % WIDTH) (WIDTH-1)) )

            {

            *scanpt++ = *rawpt; /* R */

            *scanpt++ = ((long int)*(rawpt-1)+(long int)*(rawpt+1)+

            (long int)*(rawpt-WIDTH)+(long int)*(rawpt+WIDTH))/4; /* G */

            *scanpt++ = ((long int)*(rawpt-WIDTH-1)+(long int)*(rawpt-WIDTH+1)+

            (long int)*(rawpt+WIDTH-1)+(long int)*(rawpt+WIDTH+1))/4; /* B */

            } else {

            /* bottom line or right column */

            *scanpt++ = *rawpt; /* R */

            *scanpt++ = ((long int)*(rawpt-1)+(long int)*(rawpt-WIDTH))/2; /* G */

            *scanpt++ = *(rawpt-WIDTH-1); /* B */

            }

            }

            }

            rawpt++;

            }

            }



            評論


            相關推薦

            技術專區(qū)

            關閉