Haar小波轉換的問題 |
答題得分者是:taishyang
|
chrislove87
一般會員 發表:11 回覆:14 積分:5 註冊:2007-05-09 發送簡訊給我 |
日前剛踏入影像處理的領域 還不太熟練
練習了一下3階Haar小波 但是跑出來的結果跟別人跑的不太一樣 這是原圖 這是網路上的範例解 這是我自己寫出來的結果 整個看起來很奇怪,但是程式碼我看不出來哪兒有錯... 還請各位論壇上的高手幫小弟看一下 以下是片段: [code cpp] float R,G,B; Byte *ptr; //rgb to gray & gray histogram compute 0. int grayhist[256]; for(int i=0;i<256;i ) grayhist[i]=0; for(int i=0;i for(int j=0;j G = ptr[j*3 1]; R = ptr[j*3 2]; float clRGB=rgb2gray(R,G,B); y[j][i]=TColor(RGB(clRGB,clRGB,clRGB)); Image3->Picture->Bitmap->Canvas->Pixels[j][i]=y[j][i]; } //for j end } //for i end //******一階小波轉換*************** for(int i=0;i for(int j=0;j y_one[i][b]=y[i][j]-y[i][j 1]; a ;b ; } //for j end } //for i end for(int i=0;i for(int j=0;j y_two[b][i]=y_one[j][i]-y_one[j 1][i]; a ;b ; } //for j end } //for i end for(int i=0;i //*****二階小波轉換**************** for(int i=0;i for(int j=0;j y_one[i][b]=y_two[i][j]-y_two[i][j 1]; a ;b ; } //for j end } //for i end for(int i=0;i for(int j=0;j y_two[b][i]=y_one[j][i]-y_one[j 1][i]; a ;b ; } //for j end } //for i end //*****三階小波轉換***************** for(int i=0;i for(int i=0;i for(int j=0;j y_one[i][b]=y_two[i][j]-y_two[i][j 1]; a ;b ; } //for j end } //for i end for(int i=0;i for(int j=0;j y_two[b][i]=y_one[j][i]-y_one[j 1][i]; a ;b ; } //for j end } //for i end Bitmap2->Height=H; Bitmap2->Width=W; for(int i=0;i //Bitmap2->Canvas->Pixels[i][j]=TColor(RGB(y_two[i][j],y_two[i][j],y_two[i][j])); } //Image3->Picture->Assign(Bitmap2); [/code] 編輯記錄
chrislove87 重新編輯於 2009-03-23 17:38:34, 註解 無‧
|
taishyang
站務副站長 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
|
chrislove87
一般會員 發表:11 回覆:14 積分:5 註冊:2007-05-09 發送簡訊給我 |
|
taishyang
站務副站長 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
|
chrislove87
一般會員 發表:11 回覆:14 積分:5 註冊:2007-05-09 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |