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

請問處理JPEG圖檔的問題

尚未結案
chj
一般會員


發表:14
回覆:17
積分:6
註冊:2003-08-09

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-02-17 14:04:28 IP:61.219.xxx.xxx 未訂閱
大家好,我目前在弄JPEG影像轉正的問題,因為之前之研究過BMP,所以有一些地方想請教一下。 我要利用JPEG裡帶的EXIF資訊,裡頭有一個紀錄orientation的欄位來做判別 再進而將影像轉正。想法是這樣,不知道有沒有錯 1.讀取EXIF orientation值,判斷正確方向 2.JPEG decode成BMP 3.進行長寬方向的轉換 4.BMP encode成JPEG 因為我研究了一下,如果要對壓縮的JPEG進行處理,要先轉成BMP才可以 不知道我的觀點這樣對嗎? 或是有其他比較好的做法? 謝謝
arisaka_matsuri
高階會員


發表:25
回覆:205
積分:231
註冊:2003-10-19

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-02-17 16:52:52 IP:140.113.xxx.xxx 未訂閱
dear chj:    你的第一個步驟可能就有問題。根據EXIF 2.2的定義,orientation代表影像資料顯示的順序。以下節錄自EXIF 2.2的規格書:    Orientation The image orientation viewed in terms of rows and columns. Tag = 274 (112.H) Type = SHORT Count = 1 Default = 1 1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side. 2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side. 3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side. 4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side. 5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top. 6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top. 7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom. 8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom. Other = reserved    可以參考http://www.exif.org/specifications.html
chj
一般會員


發表:14
回覆:17
積分:6
註冊:2003-08-09

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-02-17 17:11:08 IP:61.219.xxx.xxx 未訂閱
Dear arisaka_matsuri: 我之前有大概先看過EXIF的SPEC了。 我先說一下我的想法 我主要針對是DC拍出來的影像來做處理(假設此DC有智慧感測方向的功能,像一些Canon的DC) 一般正拍的話,orientation 的值應該是1吧 假設我今天抓的的值是8,那我判斷一下他正確row和column要怎樣安置。 不知道這樣的想法問題點在哪 再請指教一下 謝謝
CoffeeX
中階會員


發表:18
回覆:121
積分:72
註冊:2005-02-18

發送簡訊給我
#4 引用回覆 回覆 發表時間:2005-02-18 23:45:54 IP:140.125.xxx.xxx 未訂閱
既然你以經會處理Bitmap可用下法處理: #include "jpeg.h" TJPEGImage *TempJPEG; TempJPEG=new TJPEGImage; TempJPEG->LoadFromFile(OpenPictureDialog1->FileName); Image1->Picture->Bitmap->Assign(TempJPEG); 之後直接處理Image1中的Bitmap即可,在Assign的過程中TempJPEG就被轉換成 Bitmap
------
=.=???
系統時間:2024-05-17 10:30:10
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!