欧美男女网站_18禁网站免费无遮挡无码中文_国产人妻777人伦精品hd_91超级碰碰_国产三级大全_精品无码国模私拍视频

以文本方式查看主題

-  曙海教育集團論壇  (http://m.scarborough.cn/bbs/index.asp)
--  DSP系統和硬件開發討論區  (http://m.scarborough.cn/bbs/list.asp?boardid=5)
----  李現路:DSP6000圖像位置移動與變形的典型算法(四)  (http://m.scarborough.cn/bbs/dispbbs.asp?boardid=5&id=85)

--  作者:admin
--  發布時間:2009-12-3 13:49:29
--  李現路:DSP6000圖像位置移動與變形的典型算法(四)

  李現路:DSP6000圖像位置移動與變形的典型算法(四)

 

五、圖像的旋轉實驗


數學表達式原理:


下面我們來推導一下旋轉運算的變換公式。如下圖所示,點(x0,y0)經過旋轉θ度后

坐標變成(x1,y1)。其數學表達式為:

X0=x1cos(θ)+y1sin(θ)+ccos(θ)-dsin(θ)+a ;

Y0=-xsin(θ)+y1cos(θ)+csin(θ)-dcos(θ)+ b


算法的C語言代碼:


/*圖像旋轉參數*/

Float fAngle=3.1415927/3; //旋轉的角度

*畫矩形邊框函數*/

Void drawRectangle();

*計算圖像旋轉參數*/

Void computeParameter();

/*進行圖像旋轉處理*/

void rotate()

{

         int i,j,intInc;

         int intCapYInc;

         int intCapX,intCapY;

        

         /*進行圖像旋轉,重新賦值*/

         //方框內奇數行

         for(i=intALines;i<intDLines;i++)

         {

             for(j=intAPixels;j<intDPixels;j++)

             {

            intInc = i*2;  


            intCapX    = (int)(j*cosAngle + intInc*sinAngle + f1 + 0.5);

            intCapYInc = (int)(intInc*cosAngle - j*sinAngle + f1 + 0.5);          

                     

            if((intCapYInc%2)==0)

            {

                     intCapY = intCapYInc/2;

            }

            else

            {

                     intCapY = (intCapYInc-1)/2+numLines/2;

            }

            

            //判斷是否在原圖范圍內

            if((intCapX>=0) && (intCapX<numPixels) && (intCapY>=0) && (intCapY<numLines))  

            {

                                //傳送亮度信號

                                *(Uint8 *)(tempYbuffer + i*numPixels + j) = *(Uint8 *)(capYbuffer + intCapY*numPixels + intCapX);                                                                         

                 }

            else

            {

                      *(Uint8 *)(tempYbuffer + i*numPixels + j) = 0xFF;

            }

                                

                   }       

         }

                          

         //方框內偶數行

         for(i=numLines/2+intALines;i<numLines/2+intDLines;i++)

         {

             for(j=intAPixels;j<intDPixels;j++)

             {                

            intInc = (i-numLines/2)*2 + 1;


            intCapX    = (int)(j*cosAngle + intInc*sinAngle + f1 + 0.5);

            intCapYInc = (int)(intInc*cosAngle - j*sinAngle + f1 + 0.5);          

                     

            if((intCapYInc%2)==0)

            {

                     intCapY = intCapYInc/2;

            }

            else

            {

                     intCapY = (intCapYInc-1)/2+numLines/2;

            }            


            //判斷是否在原圖范圍內

            if((intCapX>=0) && (intCapX<numPixels) && (intCapY>=0) && (intCapY<numLines))  

            {

                                //傳送亮度信號

                                *(Uint8 *)(tempYbuffer + i*numPixels + j) = *(Uint8 *)(capYbuffer + intCapY*numPixels + intCapX);                                                                         

                 }

            else

            {

                      *(Uint8 *)(tempYbuffer + i*numPixels + j) = 0xFF;

            }

                                

                   }       

         }       

}



                                              曙海教育


                                            曙海嵌入式學院


                        (課程:DSP培訓,FPGA培訓,MTK培訓,Android培訓,iPhone培訓)


                                           電話:021-51875830


                                           網址:http://www.51qianru.cn


                                              講師:李現路


                          版權所有-曙海教育 歡迎轉摘,轉摘請注明作者和出處


主站蜘蛛池模板: 婷婷亚洲综合 | 黄色在线免费播放 | 久久久久麻豆v国产精华液好用吗 | 蜜臀久久99精品久久久久久 | 四虎影视在线免费观看 | 久久精品第一页 | 成人自拍网 | 黄色小说乱 | 久久久午夜 | 国产精品亚洲天堂 | 成人国产精品 | 欧美顶级毛片在线播放 | 奇米影视999 | 日韩综合一区二区 | 日韩中文字幕亚洲 | 亚洲国产精品女人久久久 | 日韩网站免费观看高清 | 国产11页| 欧美又粗又大又爽 | 黑人巨大猛烈捣出白浆 | www.欧美在线观看 | 天天爽天天射 | 亚洲性视频 | 国产日韩免费视频 | 91精品久久香蕉国产线看观看 | 亚洲综合一二三 | 天天操夜夜操狠狠操 | av一区二区三区 | 国产五月天婷婷 | 国产大学生自拍 | 天天爽天天干 | 国产精品成人在线视频 | 中文日韩在线观看 | 久久影院视频 | 青青操国产| 国产suv精品一区二区69 | 亚洲美女久久 | 欧美精品四区 | 好吊妞这里只有精品 | 欧美成人精品在线观看 | 日本不卡在线视频 |