- 軟件大小:26KB
- 軟件語言:中文
- 軟件類型:國產軟件
- 軟件類別:免費軟件 / 圖(tú)像處理
- 更新時(shí)間:2017-06-01 18:00
- 運行環境(jìng):WinAll, WinXP, Win7, Win8
- 軟件等級:
- 軟件廠商:
- 官方網站:http://www.ynaad.com/


2.50M/英文(wén)/0.0
732KB/中文/10.0
1.29M/中文/6.0
3.40M/中文/10.0
405KB/中文/0.0
yuv420轉bmp工具免費版是一款方便用戶進行yuv420 轉bmp的便捷圖像處理軟件,讓你能夠快速的進行格式轉換,能夠方便用戶能夠更加清晰明確的觀看(kàn)圖像,從而更好的查看圖(tú)像,獲得不錯的(de)使用效果,綠色資源網提供yuv420轉bmp工具下載!
基(jī)本支持所(suǒ)有(yǒu)YUV方麵的轉(zhuǎn)換.不過(guò)全部是exe方式的, 如果你打開win32目錄的話,支持vs2003和VS2005 ,也支持其他c++編輯器,如果不會c,那就用下(xià)麵的方法弄就行了!本程序是由其他程序修改而來,為了避免麻煩,對其中一些沒有用的地(dì)方並沒有刪除,但是這樣不會影響使用。
我找到了一(yī)個c寫的exe ,但是c的水(shuǐ)平我實在是不敢去修改那個源碼,所以我幹脆就(jiù)調用這個dll,在c#裏建(jiàn)立了下麵這個類, 然後(hòu)調用 Y2b.exe 來轉換, 而且不會顯示(shì)出來那個黑(hēi)屏.要知道(dào)怎麽回事,就看代碼吧!嗬嗬.
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Drawing;
using System.IO;
namespace JXImage
{
public class YUV2BMP
{
/// <summary>
/// 檢查程序(xù)配置是否正常, 比如exe路徑,圖(tú)片文件夾等. 一般情況下設置了路徑和圖片文件路徑以及圖片後,應該(gāi)使(shǐ)用屬性取得是否可以執行命令.
/// </summary>
public bool CanUse
{
get
{
if (System.IO.File.Exists(System.Windows.Forms.Application.StartupPath + "//Y2B.exe") )
{
return true;
}
return false;
}
}
private string bmpfile = null;
/// <summary>
/// bmp文件名(míng), 在(zài)成功執行轉換後可以用此獲(huò)得文件路徑..
/// </summary>
/// <returns>返回(huí)文件名</returns>
public string GetBmpFileName()
{
return bmpfile;
}
/// <summary>
/// BMP數據流,成功轉換後可以從此獲得流 .
/// </summary>
/// <returns>數據(jù)流形式的BMP </returns>
public MemoryStream GetBmpFileStream()
{
try
{
return new MemoryStream(System.IO.File.ReadAllBytes(bmpfile));
}
catch (Exception)
{
return null;
}
}
/// <summary>
/// Image 成功轉換後可以用此來獲得文件.
/// </summary>
/// <returns>返回一個圖片</returns>
public Image GetBmp()
{
try
{
return Image.FromFile(bmpfile);
}
catch (Exception)
{
return null;
}
}
/// <summary>
/// YUV轉BMP
/// </summary>
/// <param name="yuvfilename">YUV文件名</param>
/// <returns>返回是否成(chéng)功</returns>
public bool YUVtoBMP(string yuvfilename)
{
if (CanUse)
{
string ret = Execute(yuvfilename);
if (ret.IndexOf("OK")>=0)//從0字符開始會有個OK
{
if (System.IO.File.Exists(yuvfilename.Replace(".yuv", ".bmp")))
{
bmpfile = yuvfilename.Replace(".yuv", ".bmp");
return true;
}
}
}
return false;
}
/// <summary>
/// 執行DOS命令.
/// </summary>
/// <param name="canmand">命令(lìng)</param>
/// <returns>返回執行結果 </returns>
public static string Execute(string yuvfilename)
{
int milliseconds = 2 * 1000;//兩秒
string output = ""; //輸出字(zì)符串
if (yuvfilename != null && yuvfilename != "")
{
Process process = new Process(); //創建(jiàn)進程對象
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName =System.Windows.Forms.Application.StartupPath +"//Y2B.exe" ; //設定需要執行的命令
startInfo.Arguments = "/h352 /v288 /""+yuvfilename+"/" /"" +yuvfilename.Replace(".yuv",".bmp"); //設定(dìng)參數,其中(zhōng)的“/C”表示執行完命令後馬上退出
startInfo.UseShellExecute = false; //不使用(yòng)係統外殼程(chéng)序啟動
startInfo.RedirectStandardInput = false; //不重定向輸入
startInfo.RedirectStandardOutput = true; //重定向輸出
startInfo.CreateNoWindow = true; //不創建窗口
process.StartInfo = startInfo;
try
{
if (process.Start()) //開始(shǐ)進程
{
if (milliseconds == 0)
process.WaitForExit(); //這裏無限等待進程結束
else
process.WaitForExit(milliseconds); //這裏等待進程結束,等待時間為指定的(de)毫秒
output = process.StandardOutput.ReadToEnd();//讀取進程的輸出
}
}
catch
{
}
finally
{
if (process != null)
process.Close();
}
return output;
}
return null;
}
}
}
1、讀取akiyo_qcif.yuv YUV420文件,按幀讀取(qǔ),轉RGB,並存(cún)儲到BMP文件。
2、暫時實現讀取一幀並存儲一張BMP圖片。若要讀取YUV序列,寫成循環方式即可。
3、生成的BMP文件還有(yǒu)一點小問(wèn)題:圖像的倒立(lì)的,而且紅色偏多。
YUV是(shì)qcif分(fèn)辨率。
紅色的問題已經解決,采用的變換公式不正確(què)。
但是還是有一些橫紋,不知道是怎麽回事。 .
估計是YUV到RGB的計算公式有點問題(tí)。
解決中圖像倒立問題已經解決(jué)。
估計和UV的差值方式也有關係。
紅色不知道是不是公式變換和RGB數值(zhí)區間限製的時候產生的。
請描(miáo)述您所遇(yù)到的錯誤,我們將盡快予以修(xiū)正,謝謝!
*必填項,請輸入內容