wavelet 的問題! |
尚未結案
|
s2323528
一般會員 發表:5 回覆:3 積分:1 註冊:2004-07-07 發送簡訊給我 |
程式出錯了,可是不知哪裡錯了?
好像是記憶體發生衝突?
// 主程式片段
void __fastcall TForm1::WaveletTransform1Click(TObject *Sender)
{
Graphics::TBitmap *Bmp1=new Graphics::TBitmap();
Graphics::TBitmap *Bmp2=new Graphics::TBitmap();
Bmp1->Assign(Image3->Picture->Bitmap);
Bmp2->Assign(Image3->Picture->Bitmap); float ***WTCoef;
int *WTImgHeight, *WTImgWidth;
Byte *ptr,*ptr1;
double **Pixel_value;
Pixel_value= new double*[256];
for(int i=0; i<48; i++){
Pixel_value[i]= new double[256];
} double **bmp3;
bmp3= new double*[256];
for(int i=0; i<48; i++){
bmp3[i]= new double[256];
} for(int y=0; y<48; y++){ // Bmp1->Pixel_value
ptr=(Byte *) Bmp1->ScanLine[y];
for(int x=0; x<256; x++){
Pixel_value[y][x]=ptr[x];
}
} DWT2(Pixel_value, WTCoef, 2, 48, 256);
for(int y=0; y<48; y++){ // bmp3->Bmp2
ptr1=(Byte *) Bmp2->ScanLine[y];
for(int x=0; x<256; x++){
ptr1[x]=WTCoef[0][y][x];
}
} Image3->Picture->Bitmap->Assign(Bmp2); // 秀圖 delete []bmp3;
delete []Pixel_value;
delete Bmp1,Bmp2;
} // 副程式
void DWT2(BYTE **SourceImg,float ***WTCoef,int Levels,
int ImgHeight,int ImgWidth,int *WTImgHeight,int *WTImgWidth)
{ *WTImgHeight=ImgHeight; // 程式出錯這嗎?
*WTImgWidth=ImgWidth; *WTCoef=new float *[*WTImgHeight];
for(int i=0;i<*WTImgHeight;i++)
WTCoef[0][i]=new float [*WTImgWidth]; for(int i=0;i<*WTImgHeight;i++)
for(int j=0;j<*WTImgWidth;j++)
WTCoef[0][i][j]=(float)SourceImg[i][j]; int Height=*WTImgHeight;
int Width=*WTImgWidth; for(int i=0;i
|
geniustom
版主 發表:100 回覆:303 積分:260 註冊:2003-01-03 發送簡訊給我 |
|
iolcst
一般會員 發表:2 回覆:2 積分:0 註冊:2006-11-10 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |