<acronym id="s8ci2"><small id="s8ci2"></small></acronym>
<rt id="s8ci2"></rt><rt id="s8ci2"><optgroup id="s8ci2"></optgroup></rt>
<acronym id="s8ci2"></acronym>
<acronym id="s8ci2"><center id="s8ci2"></center></acronym>
0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
會員中心
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示

FPGA設計中 Verilog HDL實現基本的圖像濾波處理仿真

FPGA技術支持 ? 來源:FPGA技術江湖 ? 作者:FPGA技術江湖 ? 2021-07-13 09:30 ? 次閱讀

今天給大俠帶來基于FPGA的數字視頻信號處理器設計,由于篇幅較長,分三篇。今天帶來第三篇,下篇,程序測試與運行。話不多說,上貨。

之前也有圖像處理相關方面的文章,這里超鏈接幾篇,給各位大俠作為參考。

《岡薩雷斯數字圖像處理MATLAB版》中文版(第二版) 電子

薦讀:FPGA設計經驗之圖像處理

基于FPGA的實時圖像邊緣檢測系統設計(下)

FPGA設計中 Verilog HDL實現基本的圖像濾波處理仿真

導讀

圖像是用各種觀測系統以不同形式和手段觀測客觀世界而獲得的,可以直接或間接作用于人眼進而產生視知覺的實體。

隨著電子技術和計算機技術的飛速發展,數字圖像技術近年來得到極大的重視和長足的發展,并在科學研究、工業生產、醫療衛生、通信等方面得到廣泛的應用。

視頻信號由一系列連續的圖像組成。對視頻信號的處理已經成為數字圖像處理領域中重要的一部分。例如機器人模式識別的過程就是一個視頻信號處理的過程,電視制導導彈識別目標就是充分利用視頻信號處理技術不斷判斷目標是否和預先設定目標圖像一致。本篇將講解如何用 FPGA 技術實現基本的視頻信號處理。本篇的例子可以作為各位大俠進行視頻信號處理時的一個參考,也可以在這個基礎上根據需要進行擴展。

第三篇內容摘要:本篇會介紹程序測試與運行,包括測試程序、測試結果以及總結等相關內容。

五、程序測試與運行

由于整個 FPGA 程序包括 3 部分:處于 TOP 的主體程序,控制其他各個部分程序的運行;視頻圖像數據采集程序,從 SAA7113 獲得數字圖像數據并保存到 SRAM 中;SRAM 讀寫程序實現對 SRAM 的數據讀寫。測試程序需要仿真數據的全部流程。

5.1 測試程序

測試程序代碼如下:

`include “timescale.v”moduletst_saa7113(error,dsprst,xreset,saareset,ARDY,ED_O,ED_OEN_O,SRAM_1_EA,SRAM_2_EA,SRAM_1_O_ED,SRAM_2_O_ED); //內部寄存器 reg reset; reg clk;//50MHz 時鐘 reg llck;//SAA7113 的時鐘 reg [7:0] vpo;//來自 saa7113 的圖像數據 reg capture;//采集數據標志 reg toggle;//總線切換標志 reg [1:0] rst; //輸入 input error; input dsprst,xreset,saareset; input ARDY; input [7:0] ED_O; input ED_OEN_O; input [18:0] SRAM_1_EA; input [7:0] SRAM_1_O_ED; input [18:0] SRAM_2_EA; input [7:0] SRAM_2_O_ED; //來自 dsp 的信號 reg CE3_; reg ARE_; reg AWE_; reg [21:2] EA; reg [7:0] ED_I; //TO SRAM reg [7:0] SRAM_1_IN_ED; reg [7:0] SRAM_2_IN_ED; //wires //from saa7113 wire SRAM_CE_; wire SRAM_OE_; wire SRAM_WE_; wire [18:0] la; wire [7:0] ld; //FROM DSP wire CE_SRAM; wire WE_SRAM; wire OE_SRAM; wire [7:0] ED_SRAM; wire [18:0] EA_SRAM; //連接各個子程序 LWBSAA7113 L_SAA7113 ( .reset(reset), .clk(clk), .llck(llck), .vpo(vpo), .rst(rst), .capture(capture), .error(error), .SRAM_CE_(SRAM_CE_), .SRAM_OE_(SRAM_OE_), .SRAM_WE_(SRAM_WE_), .la(la), .ld(ld) ); LWBDECODE L_DECODE ( .reset(reset), .CE3_(CE3_), .ARE_(ARE_), .AWE_(AWE_), .EA(EA), .ED_I(ED_I), .ED_O(ED_O), .ED_OEN_O(ED_OEN_O), .ARDY(ARDY), .EA_SRAM(EA_SRAM), .ED_SRAM(ED_SRAM), .CE_SRAM(CE_SRAM), .WE_SRAM(WE_SRAM), .OE_SRAM(OE_SRAM), .dsprst(dsprst), .xreset(xreset), .saareset(saareset) ); LWBBUSCHANGE L_BUSCHANGE ( .EA_SRAM(EA_SRAM), .ED_SRAM(ED_SRAM), .CE_SRAM(CE_SRAM), .WE_SRAM(WE_SRAM), .OE_SRAM(OE_SRAM), .la(la), .ld(ld), .SRAM_CE_(SRAM_CE_), .SRAM_WE_(SRAM_WE_), .SRAM_OE_(SRAM_OE_), .SRAM_1_IN_ED(SRAM_1_IN_ED), .SRAM_2_IN_ED(SRAM_2_IN_ED), .toggle(toggle), .SRAM_1_EA(SRAM_1_EA), .SRAM_1_O_ED(SRAM_1_O_ED), .SRAM_2_EA(SRAM_2_EA), .SRAM_2_O_ED(SRAM_2_O_ED) ); //產生時鐘信號 always #10 clk=~clk; always #20 llck = ~llck; initial begin $display(“

status : %t TestBench of saa7113 started!

”,$time); //initial value clk = 0; #7; llck =0; //reset reset = 1; //dsp 初始化 ARE_ = 1; AWE_ = 1; CE3_ = 1; //初始化 capture = 0; toggle = 1; #2; reset = 0; repeat(20) @(posedge clk); reset = 1‘b1; // negate reset //dsp 讀取數據內容 SRAM_1_IN_ED = 8’h1d; SRAM_2_IN_ED = 8‘h2d; //dsp 地址總線 EA[21:16] = 6’b000000; EA[15:7] = 9‘b000000000; EA[6:2]= 5’b00001; #5; CE3_ = 0; ARE_ = 0; //saa7113 輸出內容 capture = 1; #5; @(posedge llck) vpo = 8‘haa; @(posedge llck) vpo = 8’hbb; @(posedge llck) vpo = 8‘hcc; @(posedge llck) vpo = 8’hdd; @(posedge llck) vpo = 8‘hee; //場同步信號 //1 @(posedge llck) vpo = 8’hff;//begin @(posedge llck) vpo = 8‘h00; @(posedge llck) vpo = 8’h00; @(posedge llck) vpo = 8‘b00100000;//sav //2 @(posedge llck) vpo = 8’hff;//begin @(posedge llck) vpo = 8‘h00; @(posedge llck) vpo = 8’h00; @(posedge llck) vpo = 8‘b00100000; //數據開始 @(posedge llck) vpo = 8’hff;//begin @(posedge llck) vpo = 8‘h00; @(posedge llck) vpo = 8’h00; @(posedge llck) vpo = 8‘b00000000; //data @(posedge llck) vpo = 8’h01;//Cb @(posedge llck) vpo = 8‘h02;//Yb @(posedge llck) vpo = 8’h03;//Cr @(posedge llck) vpo = 8‘h04;//Yr--1 @(posedge llck) vpo = 8’h05;//Cb @(posedge llck) vpo = 8‘h06;//Yb @(posedge llck) vpo = 8’h07;//Cr @(posedge llck) vpo = 8‘h08;//Yr--2 @(posedge llck) vpo = 8’h09;//Cb @(posedge llck) vpo = 8‘h0a;//Yb @(posedge llck) vpo = 8’h0b;//Cr @(posedge llck) vpo = 8‘h0c;//Yr--3 @(posedge llck) vpo = 8’h0d;//Cb @(posedge llck) vpo = 8‘h0e;//Yb @(posedge llck) vpo = 8’h0f;//Cr @(posedge llck) vpo = 8‘h10;//Yr--4 @(posedge llck) vpo = 8’h11;//Cb @(posedge llck) vpo = 8‘h12;//Yb @(posedge llck) vpo = 8’h13;//Cr @(posedge llck) vpo = 8‘h14;//Yr--5 @(posedge llck) vpo = 8’h15;//Cb @(posedge llck) vpo = 8‘h16;//Yb @(posedge llck) vpo = 8’h17;//Cr @(posedge llck) vpo = 8‘h18;//Yr--6 @(posedge llck) vpo = 8’h19;//Cb @(posedge llck) vpo = 8‘h1a;//Yb @(posedge llck) vpo = 8’h1b;//Cr @(posedge llck) vpo = 8‘h1c;//Yr--7 @(posedge llck) vpo = 8’h1d;//Cb @(posedge llck) vpo = 8‘h1e;//Yb @(posedge llck) vpo = 8’h1f;//Cr @(posedge llck) vpo = 8‘h20;//Yr--8 @(posedge llck) vpo = 8’h21;//Cb @(posedge llck) vpo = 8‘h22;//Yb @(posedge llck) vpo = 8’h23;//Cr @(posedge llck) vpo = 8‘h24;//Yr--9 @(posedge llck) vpo = 8’h25;//Cb @(posedge llck) vpo = 8‘h26;//Yb @(posedge llck) vpo = 8’h27;//Cr @(posedge llck) vpo = 8‘h28;//Yr--10 @(posedge llck) vpo = 8’h29;//Cb @(posedge llck) vpo = 8‘h3a;//Yb @(posedge llck) vpo = 8’h3b;//Cr @(posedge llck) vpo = 8‘h3c;//Yr--11 //數據結束 @(posedge llck) vpo = 8’hff;//ff @(posedge llck) vpo = 8‘h00;//00 @(posedge llck) vpo = 8’h00;//00 @(posedge llck) vpo = 8‘b01110000;//end of field 1 #20; ARE_ = 1; capture = 0; #200; //開始切換 toggle = 0; #100; ARE_ = 0; //開始采集數據 capture = 1; //vertical blanking stage //1 @(posedge llck) vpo = 8’hff;//begin @(posedge llck) vpo = 8‘h00; @(posedge llck) vpo = 8’h00; @(posedge llck) vpo = 8‘b00100000;//sav //2 @(posedge llck) vpo = 8’hff;//begin @(posedge llck) vpo = 8‘h00; @(posedge llck) vpo = 8’h00; @(posedge llck) vpo = 8‘b00100000; //data start @(posedge llck) vpo = 8’hff;//begin @(posedge llck) vpo = 8‘h00; @(posedge llck) vpo = 8’h00; @(posedge llck) vpo = 8‘b00000000; //data @(posedge llck) vpo = 8’h01;//Cb @(posedge llck) vpo = 8‘h02;//Yb @(posedge llck) vpo = 8’h03;//Cr @(posedge llck) vpo = 8‘h04;//Yr--1 @(posedge llck) vpo = 8’h05;//Cb @(posedge llck) vpo = 8‘h06;//Yb @(posedge llck) vpo = 8’h07;//Cr @(posedge llck) vpo = 8‘h08;//Yr--2 @(posedge llck) vpo = 8’h09;//Cb @(posedge llck) vpo = 8‘h0a;//Yb @(posedge llck) vpo = 8’h0b;//Cr @(posedge llck) vpo = 8‘h0c;//Yr--3 @(posedge llck) vpo = 8’h0d;//Cb @(posedge llck) vpo = 8‘h0e;//Yb @(posedge llck) vpo = 8’h0f;//Cr @(posedge llck) vpo = 8‘h10;//Yr--4 @(posedge llck) vpo = 8’h11;//Cb @(posedge llck) vpo = 8‘h12;//Yb @(posedge llck) vpo = 8’h13;//Cr @(posedge llck) vpo = 8‘h14;//Yr--5 @(posedge llck) vpo = 8’h15;//Cb @(posedge llck) vpo = 8‘h16;//Yb @(posedge llck) vpo = 8’h17;//Cr @(posedge llck) vpo = 8‘h18;//Yr--6 @(posedge llck) vpo = 8’h19;//Cb @(posedge llck) vpo = 8‘h1a;//Yb @(posedge llck) vpo = 8’h1b;//Cr @(posedge llck) vpo = 8‘h1c;//Yr--7 @(posedge llck) vpo = 8’h1d;//Cb @(posedge llck) vpo = 8‘h1e;//Yb @(posedge llck) vpo = 8’h1f;//Cr @(posedge llck) vpo = 8‘h20;//Yr--8 @(posedge llck) vpo = 8’h21;//Cb @(posedge llck) vpo = 8‘h22;//Yb @(posedge llck) vpo = 8’h23;//Cr @(posedge llck) vpo = 8‘h24;//Yr--9 @(posedge llck) vpo = 8’h25;//Cb @(posedge llck) vpo = 8‘h26;//Yb @(posedge llck) vpo = 8’h27;//Cr @(posedge llck) vpo = 8‘h28;//Yr--10 @(posedge llck) vpo = 8’h29;//Cb @(posedge llck) vpo = 8‘h3a;//Yb @(posedge llck) vpo = 8’h3b;//Cr @(posedge llck) vpo = 8‘h3c;//Yr--11 //數據結束 @(posedge llck) vpo = 8’hff;//ff @(posedge llck) vpo = 8‘h00;//00 @(posedge llck) vpo = 8’h00;//00 @(posedge llck) vpo = 8‘b01110000;//end of field 1 #20; //結束數據采集 capture = 0; #200; //測試程序結束 $finish; endendmodule

5.2 測試結果開始的“aa bb cc dd ee ff”是無效數據,“ff 00 20”表示場同步信號。

經過 FPGA 處理后獲得有效圖像數據并產生相應的地址信號,由于只進行灰度運算,只取亮度信息,因此獲得數據為“04 08 0c”,同時產生地址信號“00 01 02”。

仿真結果表明整個視頻信號處理程序完成了預先設定的設計目標。

七、總結

本篇首先介紹了視頻信號的基本原理、組成等,然后講解了進行視頻信號處理的基本過程和框架。接下來結合實例講解用 FPGA 及其他芯片組成視頻處理的電路設計和 FPGA 的程序實現。最后用 Modelsim 仿真和測試了程序。本篇為各位大俠提供了一種視頻信號處理的設計方案,僅供參考。

編輯:jq

聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網站授權轉載。文章觀點僅代表作者本人,不代表電子發燒友網立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規問題,請聯系本站處理。 舉報投訴
  • FPGA
    +關注

    關注

    1608

    文章

    21367

    瀏覽量

    594696

原文標題:原創系統設計精選 | 基于FPGA的數字視頻信號處理器設計(附代碼)

文章出處:【微信號:HK-FPGA_Dep,微信公眾號:FPGA技術支持】歡迎添加關注!文章轉載請注明出處。

收藏 人收藏

    評論

    相關推薦

    FPGA設計 Verilog HDL實現基本的圖像濾波處理仿真

    今天給大俠帶來FPGA設計中用Verilog HDL實現基本的圖像濾波
    發表于 05-20 16:44

    FPGA圖像與視頻處理培訓

    使用FPGA進行圖像和視頻處理的原理、結構、方法和流程,實現視頻處理的重要模塊設計;同時,針對
    發表于 07-16 14:05

    DCT實現Verilog HDL的數字圖像處理源代碼

    DCT實現Verilog HDL的數字圖像處理源代碼
    發表于 08-11 09:30

    如何用VHDL、Verilog HDL實現設計輸入?

    如何在ALTERA公司的Quartus II環境下用VHDL、Verilog HDL實現設計輸入,采用同步時鐘,成功編譯、綜合、適配和仿真,并下載到Stratix系列
    發表于 04-15 06:19

    FPGA雙沿發送之Verilog HDL實現 精選資料推薦

    1.1 FPGA雙沿發送之Verilog HDL實現1.1.1 本節目錄1)本節目錄;2)本節引言;3)FPGA簡介;4)
    發表于 07-26 06:20

    FPGA設計 Verilog HDL實現基本的圖像濾波處理仿真

    發表于 08-05 15:34

    FPGA設計 Verilog HDL實現基本的圖像濾波處理仿真

    帶來FPGA設計中用Verilog HDL實現基本的圖像濾波
    發表于 06-07 14:48

    薦讀:FPGA設計經驗之圖像處理

    系列:基于 FPGA圖像邊緣檢測系統設計(sobel算法) FPGA設計 Verilog HDL
    發表于 06-08 15:55

    基于Verilog HDL語言的FPGA設計

    采用 Verilog HDL 語言在Altera 公司的FPGA 芯片上實現了RISC_CPU 的關鍵部件狀態控制器的設計,以及在與其它各種數字邏輯設計方法的比較下,顯示出使用
    發表于 08-21 10:50 ?69次下載

    Verilog HDL實現I2C總線功能

    簡述了I2C總線的特點;介紹了開發FPGA時I2C總線模塊的設計思想;給出并解釋了用Verilog HDL實現部分I2C總線功能的程序,以及I2C總線主從模式下的
    發表于 10-19 10:49 ?104次下載

    基于FPGA 的方向濾波器指紋圖像增強算法實現

    設計了一種基于FPGA純硬件方式實現方向濾波的指紋圖像增強算法。設計采用寄存器傳輸級(RTL)硬件描述語言(Verilog
    發表于 10-15 09:42 ?29次下載

    Verilog HDL語言在FPGA/CPLD開發中的應用

    摘 要:通過設計實例詳細介紹了用Verilog HDL語言開發FPGA/CPLD的方法,并通過與其他各種輸入方式的比較,顯示出使用Verilog H
    發表于 06-20 11:51 ?1886次閱讀
    <b class='flag-5'>Verilog</b> <b class='flag-5'>HDL</b>語言在<b class='flag-5'>FPGA</b>/CPLD開發中的應用

    基于FPGA Verilog-HDL語言的串口設計

    基于FPGA Verilog-HDL語言的串口設計
    發表于 02-16 00:08 ?35次下載

    教你們如何使用Verilog HDLFPGA上進行圖像處理

    的完整 Verilog 代碼 。 在這個FPGA Verilog項目中,一些簡單的處理操作都是在Verilog
    的頭像 發表于 09-23 16:17 ?3721次閱讀

    FPGA中如何使用Verilog處理圖像

    的完整 Verilog 代碼 。 在這個FPGA Verilog項目中,一些簡單的處理操作都是在Verilog
    的頭像 發表于 09-23 15:50 ?5426次閱讀
    亚洲欧美日韩精品久久_久久精品AⅤ无码中文_日本中文字幕有码在线播放_亚洲视频高清不卡在线观看
    <acronym id="s8ci2"><small id="s8ci2"></small></acronym>
    <rt id="s8ci2"></rt><rt id="s8ci2"><optgroup id="s8ci2"></optgroup></rt>
    <acronym id="s8ci2"></acronym>
    <acronym id="s8ci2"><center id="s8ci2"></center></acronym>