請問一下影像相減的問題 |
尚未結案
|
89611826
一般會員 發表:2 回覆:0 積分:0 註冊:2006-07-28 發送簡訊給我 |
我搜尋一些板上的文章看到有位大大有發表差異影像的問題~
以下是我搜尋的code Graphics::TBitmap* BMP1 =new Graphics::TBitmap(); Graphics::TBitmap* BMP2 =new Graphics::TBitmap(); BMP1->PixelFormat=pf24bit; BMP2->PixelFormat=pf24bit; Byte *ptr1, *ptr2 = NULL; int temp=0; BMP1->Assign(Image1->Picture->Bitmap); BMP2->Assign(Image2->Picture->Bitmap); Graphics::TBitmap* BMP3 =new Graphics::TBitmap(); BMP3->PixelFormat=pf24bit; Byte *ptr3; BMP3->Assign(Image3->Picture->Bitmap); for (int y=0; yHeight; y ) { ptr1=(Byte*)BMP1->ScanLine[y]; ptr2=(Byte*)BMP2->ScanLine[y]; ptr3=(Byte*)BMP3->ScanLine[y]; for (int x=0; xWidth; x ) { int d=abs((int)ptr1[x]-(int)ptr2[x]); if(d>50) d=0; ptr3[x]=d; } } [/code] 一值出現錯誤 |
taishyang
站務副站長 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |