線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:3454
推到 Plurk!
推到 Facebook!

我找到Hough transform的語法!只是有些問題可以幫我解答嘛??

尚未結案
librarext
一般會員


發表:22
回覆:4
積分:5
註冊:2005-05-26

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-10-09 12:46:00 IP:61.230.xxx.xxx 未訂閱
#include  #include <math.h> #include "array.h" #define feature_point 0 #define background 255 class HoughLineDetector { float sin_tab[180],cos_tab[180]; public: HoughLineDetector()// Generate sin and cos look-up table { float theta; for(int angle=0;angle<180;angle ) { theta=angle*3.14159265358979/180.0; cos_tab[angle]=cos(theta); sin_tab[angle]=sin(theta); } } void Transform(uc2D &im,uc2D &hough); }; void HoughLineDetector::Transform(uc2D &im, uc2D &hough_ima) { float rmax=sqrt((float)im.nr*(float)im.nr (float)im.nc*(float)im.nc); hough_ima.Initialize(2*rmax,180); for(int j=0;j
taishyang
站務副站長


發表:377
回覆:5490
積分:4563
註冊:2002-10-08

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-10-09 21:03:33 IP:218.168.xxx.xxx 未訂閱
您好:    PO程式碼的方式與版規說明請參考下面連結,煩請修改謝謝您的配合 >
Stallion
版主


發表:52
回覆:1600
積分:1995
註冊:2004-09-15

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-10-10 15:53:08 IP:211.22.xxx.xxx 未訂閱
#include 
#include <math.h>
#include "array.h"
#define feature_point 0
#define background 255    ---define as HoughLineDetector.h---
class HoughLineDetector
{
 float sin_tab[180],cos_tab[180];
 public:
        HoughLineDetector()// Generate sin and cos look-up table
        {
         float theta;
         for(int angle=0;angle<180;angle  )
         {
          theta=angle*3.14159265358979/180.0;
          cos_tab[angle]=cos(theta);
          sin_tab[angle]=sin(theta);
         }    
        }
        void Transform(uc2D &im,uc2D &hough);
};    ---define as HoughLineDetector.cpp---
#include "HoughLineDetector.h"
 
void  HoughLineDetector::Transform(uc2D &im, uc2D &hough_ima)
{
 float rmax=sqrt((float)im.nr*(float)im.nr 
 (float)im.nc*(float)im.nc);
 hough_ima.Initialize(2*rmax,180);
 for(int j=0;j
看完這段CODE,更本不需要改,直接用HoughLineDetector這個CLASS就好了,只是不知到你的標頭檔中array.h是啥?但還是建議將HoughLineDetector的宣告和程式定義分開才好。 ----------------------- Practice makes perfect. 發表人 - stallion 於 2005/10/10 15:54:42
系統時間:2024-04-28 23:28:36
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!