MyFPGA Forum

 找回密码
 注册
搜索
查看: 5385|回复: 3
打印 上一主题 下一主题

在DE0上如何计算处理图片的时间(fps)

[复制链接]
跳转到指定楼层
1#
发表于 2010-7-16 10:47:29 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
在D5M中 CCD_Capture有 output oFrame_cont ,这是用来计算cmos input fps 的,
在LTM中 touch_tcon有output oVD,这是用来计算LTM output fps 的,
现在的问题是我看了那个代码,但是不知道具体怎么计算?
请高手帮忙举个例子算算。。。
2#
发表于 2010-7-16 11:59:00 | 只看该作者
我剛好有寫了一個計算FPS程式給你參考看看..


/*
2009 Intellignet Control Laborator of Tamkang University. All rights reserved
Filename    :         ShowFPS.v
Compiler    :         Quartus II 9.0
Description :         Show CMOS and LTM FPS
Author      :        Shih-An Li
Release     :         04/29/2009 1.0   
                               
*/

module ShowFPS        (         iCLK_50,
                                        iCMOS_V,
                                        iLTM_V,
                                        oShowCMOSfps,
                                        oShowLTMfps );

//===========================================================================
// PARAMETER declarations
//===========================================================================
parameter SystemClk = 50000000; // 50Mhz


//===========================================================================
// PORT declarations
//===========================================================================                       
input                         iCLK_50;
input                         iCMOS_V;  // CMOS V sync
input                         iLTM_V;   // LTM V Sync
output         [7:0]        oShowCMOSfps;
output         [7:0]        oShowLTMfps;
//=============================================================================
// REG/WIRE declarations
//=============================================================================
reg pre_CMOS_V,pre_LTM_V;

reg  [31:0] CMOS_V_cnt, LTM_V_cnt, Count,pre_CMOS_Frame_Cont,pre_LTM_Frame_Cont;
reg  [31:0] CMOS_FPS, LTM_FPS;
reg  [7:0]  CMOS_FPS0,CMOS_FPS1;
reg  [7:0]  LTM_FPS0,LTM_FPS1;

//=============================================================================
// Structural coding
//=============================================================================
always@(posedge iCLK_50) begin

        // Calculate the CMOS Frame
        pre_CMOS_V <= iCMOS_V;
        if({pre_CMOS_V,iCMOS_V}==2'b10) begin
                CMOS_V_cnt <= CMOS_V_cnt + 1;
        end
        // Calculate the LTM Frame
        pre_LTM_V <= iLTM_V;
        if({pre_LTM_V,iLTM_V}==2'b10) begin
                LTM_V_cnt <= LTM_V_cnt + 1;
        end
end

always@(posedge iCLK_50) begin
        if (Count >=SystemClk) begin
                Count <= 0;
                pre_CMOS_Frame_Cont <= CMOS_V_cnt;
                CMOS_FPS <= CMOS_V_cnt - pre_CMOS_Frame_Cont;
               
                pre_LTM_Frame_Cont <= LTM_V_cnt;
                LTM_FPS <= LTM_V_cnt - pre_LTM_Frame_Cont;
        end
        else begin
                Count <= Count +1;
        end
               
end




assign oShowCMOSfps = CMOS_FPS;
assign oShowLTMfps= LTM_FPS ;

endmodule
/////////////////////////////////////end////////////////////////////////////


CMOS_FPS, LTM_FPS 就是你要的.
3#
 楼主| 发表于 2010-7-16 14:53:52 | 只看该作者
回复 2# lishyhan

谢谢
4#
 楼主| 发表于 2010-7-17 15:22:32 | 只看该作者
在D5M中 CCD_Capture有 output oFrame_cont ,这是用来计算cmos input fps 的,
在LTM中 touch_tcon有output ...
xiaojun5123 发表于 2010-7-16 10:47


在友晶公司   提供的示例代码中,CCD_Capture中 oFrame_cont 的接口是 直接接入 SEG7_LUT_8 模块,在接入数码管的。
为什么要接数码管呢?
可以不接吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|MyFPGA

GMT+8, 2024-5-5 21:33 , Processed in 0.045230 second(s), 15 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表