[問題] RGB彩色轉灰階
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
c++ builder 6
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
mil Lib (類似opencv的影像lib)
問題(Question):
彩色轉灰階異常
程式碼(Code):(請善用置底文網頁, 記得排版)
http://ideone.com/vNZw5k
結果圖片如下,左邊是image1 右邊是image2
http://dropcanvas.com/nyrl5/1 圖B
http://dropcanvas.com/nyrl5/2 圖A
image1是直接讀取現成的圖片,image2是透過mil截取image1資料放入buffer
再將buffer匯出成一張bmp,再將圖放入TImageBox(image2內)顯示出來
參考這個網頁的寫法
http://sean1223.blogspot.tw/2010/01/bcb-pixel-rgb.html
再對照程式碼
image1和image2的寫法是一樣的
1.采用網頁的方法一,結果如圖A
2.采用網頁的方法二和三,結果如圖B
請問會造成這樣的結果是為什麼呢?
謝謝
※ 編輯: tyc5116 來自: 220.134.238.4 (11/06 14:27)
→
11/06 14:42, , 1F
11/06 14:42, 1F
→
11/06 14:51, , 2F
11/06 14:51, 2F
推
11/06 15:07, , 3F
11/06 15:07, 3F
→
11/06 15:19, , 4F
11/06 15:19, 4F
→
11/06 15:19, , 5F
11/06 15:19, 5F
推
11/06 15:22, , 6F
11/06 15:22, 6F
→
11/06 15:29, , 7F
11/06 15:29, 7F
→
11/06 15:29, , 8F
11/06 15:29, 8F
→
11/06 15:40, , 9F
11/06 15:40, 9F
→
11/06 15:41, , 10F
11/06 15:41, 10F