請問處理JPEG圖檔的問題 |
尚未結案
|
chj
一般會員 發表:14 回覆:17 積分:6 註冊:2003-08-09 發送簡訊給我 |
大家好,我目前在弄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 發送簡訊給我 |
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 發送簡訊給我 |
|
CoffeeX
中階會員 發表:18 回覆:121 積分:72 註冊:2005-02-18 發送簡訊給我 |
既然你以經會處理Bitmap可用下法處理: #include "jpeg.h"
TJPEGImage *TempJPEG;
TempJPEG=new TJPEGImage;
TempJPEG->LoadFromFile(OpenPictureDialog1->FileName);
Image1->Picture->Bitmap->Assign(TempJPEG); 之後直接處理Image1中的Bitmap即可,在Assign的過程中TempJPEG就被轉換成
Bitmap
------
=.=??? |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |