資源簡介
相機(jī)原生bayer圖像raw文件轉(zhuǎn)成DNG文件,支持8位、10位、12位和16位raw轉(zhuǎn)8位、10位、12位和16位的DNG。
語言Python 3.6.8,有兩個(gè)項(xiàng)目支持CUDA加速轉(zhuǎn)換。詳情查看README文件。
代碼片段和文件信息
#項(xiàng)目來源于github的開源項(xiàng)目https://github.com/schoolpost/PyDNG???個(gè)人稍作修改
#?image?specs??Need?to?be?modified?depending?on?the?picture?視圖片情況需要修改
#本人使用華為P9相機(jī)進(jìn)行測試,與其它相機(jī)可能存在數(shù)據(jù)出入,請以自己相機(jī)的為準(zhǔn)
#相機(jī)元數(shù)據(jù)信息獲取使用Android的camera2類庫進(jìn)行相機(jī)測試
#安裝pucuda前請安裝好CUDA?Toolkit?9.0/9.1/9.2/10.0/10.1
#這個(gè)項(xiàng)目使用GPU進(jìn)行加速計(jì)算,顯卡不是NVIDIA的或無CUDA的請用CPU計(jì)算的項(xiàng)目:raw10ToDNG8or10or12or16.py
from?timeit?import?default_timer?as?timer
from?pydng.core?import?RAW2DNG?DNGTags?Tag
import?numpy?as?np
import?struct?collections
import?threading
import?pycuda.autoinit
import?pycuda.driver?as?drv
from?pycuda.compiler?import?SourceModule
global_time?=?timer()????#開始計(jì)時(shí)
width?=?1920?????????????#圖片寬度
height?=?1080????????????#圖片高度
bpp?=?10???#輸出位深只有8、10、12、14和16這5種數(shù)值可選??Only?8?10?12?14?and?16?are?available
#低位深轉(zhuǎn)高位深僅僅填充0在高位,無實(shí)際意義!?高位深轉(zhuǎn)低位深,可以減少文件大小。
#Low?depth?to?high?depth?only?fill?0?in?the?high?no?practical?significance!?High?depth?to?low?depth?can?reduce?the?file?size.
ccm1?=?[[19549?10000]?[-7877?10000]?[-2582?10000]
????????[-5724?10000]?[10121?10000]?[1917?10000]
????????[-1267?10000]?[?-110?10000]?[?6621?10000]]
ccm2?=?[[13244?10000]?[-5501?10000]?[-1248?10000]
????????[-1508?10000]?[9858?10000]?[1935?10000]
????????[-270?10000]?[-1083?10000]?[4366?10000]]
fm1?=?[[612?1024]?[233?1024]?[139?1024]
????????[199?1024]?[831?1024]?[-6?1024]
????????[15?1024]?[-224?1024]?[1049?1024]]
fm2?=?[[612?1024]?[233?1024]?[139?1024]
????????[199?1024]?[831?1024]?[-6?1024]
????????[15?1024]?[-224?1024]?[1049?1024]]
“““nccm1?=?[[10000?10000]?[0?10000]?[0?10000]
?????????[0?10000]?[10000?10000]?[0?10000]
?????????[0?10000]?[?0?10000]?[?10000?10000]]
nccm2?=?[[10000?10000]?[0?10000]?[0?10000]
?????????[0?10000]?[10000?10000]?[0?10000]
?????????[0?10000]?[?0?10000]?[?10000?10000]]“““
#neutralColorPoint?=?[[273355][11][91256]]??#白熾燈
#自動????[[1092?1951]?[1?1]?[1092?2129]]??自動的矩陣值根據(jù)場景不同發(fā)生變化
#熒光燈??[[1092?2117]?[1?1]?[1092?2305]]
#暖熒光??[[1092?2435]?[1?1]?[91?207]]
#日光????[[78?163]?[1?1]?[52?89]]
#多云????[[546?1367]?[1?1]?[364?509]]
#黃昏????[[546?815]?[1?1]?[182?537]]
#陰天????[[182?489]?[1?1]?[7?9]]
mod?=?SourceModule(“““
__global__?void?func10(unsigned?short?*runsigned?char?*isize_t?L)
{
????const?int?index?=?blockIdx.x?*?blockDim.x?+?threadIdx.x;
????if(index?>=?L)
????{
?????return;
????}
????const?int?yushu?=?index?%?4;
????const?int?shang?=?index?/?4;
????if(yushu?==?0)
????{
?????r[index]?=?(i[index+shang]?|?(i[index+shang+1]?&?0xC0)?<2);
????}
?????else?if(yushu?==?1)
????{
????r[index]?=?((i[index+shang]?&?0x3F)?|?(i[index+shang+1]?&?0xF0)?<2);
????}
?????else?if(yushu?==?2)
????{
????r[index]?=?((i[index+shang]?&?0x0F)?|?(i[index+shang+1]?&?0xFC)?<2);
????}
?????else?if(yushu?==?3)
????{
?????r[index]?=?((i[index+shang]?&?0x03)?|?i[index+shang+1]?<2);
????}
}
__global__?void?func8(u
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????????9??2020-11-28?12:11??bayerRaw2DNG\.git\COMMIT_EDITMSG
?????文件????????306??2020-11-07?19:57??bayerRaw2DNG\.git\config
?????文件?????????73??2020-11-07?19:57??bayerRaw2DNG\.git\desc
?????文件?????????19??2020-11-28?12:09??bayerRaw2DNG\.git\HEAD
?????文件????????478??2020-11-07?19:57??bayerRaw2DNG\.git\hooks\applypatch-msg.sample
?????文件????????896??2020-11-07?19:57??bayerRaw2DNG\.git\hooks\commit-msg.sample
?????文件???????4655??2020-11-07?19:57??bayerRaw2DNG\.git\hooks\fsmonitor-watchman.sample
?????文件????????189??2020-11-07?19:57??bayerRaw2DNG\.git\hooks\post-update.sample
?????文件????????424??2020-11-07?19:57??bayerRaw2DNG\.git\hooks\pre-applypatch.sample
?????文件???????1643??2020-11-07?19:57??bayerRaw2DNG\.git\hooks\pre-commit.sample
?????文件????????416??2020-11-07?19:57??bayerRaw2DNG\.git\hooks\pre-merge-commit.sample
?????文件???????1374??2020-11-07?19:57??bayerRaw2DNG\.git\hooks\pre-push.sample
?????文件???????4898??2020-11-07?19:57??bayerRaw2DNG\.git\hooks\pre-reba
?????文件????????544??2020-11-07?19:57??bayerRaw2DNG\.git\hooks\pre-receive.sample
?????文件???????1492??2020-11-07?19:57??bayerRaw2DNG\.git\hooks\prepare-commit-msg.sample
?????文件???????3650??2020-11-07?19:57??bayerRaw2DNG\.git\hooks\update.sample
?????文件???????2011??2020-11-28?12:11??bayerRaw2DNG\.git\index
?????文件????????240??2020-11-07?19:57??bayerRaw2DNG\.git\info\exclude
?????文件????????959??2020-11-28?12:11??bayerRaw2DNG\.git\logs\HEAD
?????文件????????341??2020-11-07?20:17??bayerRaw2DNG\.git\logs\refs\heads\main
?????文件????????303??2020-11-19?00:51??bayerRaw2DNG\.git\logs\refs\heads\v1
?????文件????????301??2020-11-28?12:11??bayerRaw2DNG\.git\logs\refs\heads\v2
?????文件????????190??2020-11-07?19:57??bayerRaw2DNG\.git\logs\refs\remotes\origin\HEAD
?????文件????????145??2020-11-07?20:17??bayerRaw2DNG\.git\logs\refs\remotes\origin\main
?????文件????????145??2020-11-19?00:52??bayerRaw2DNG\.git\logs\refs\remotes\origin\v1
?????文件????????145??2020-11-28?12:12??bayerRaw2DNG\.git\logs\refs\remotes\origin\v2
?????文件???????2856??2020-11-19?00:49??bayerRaw2DNG\.git\ob
?????文件????????145??2020-11-19?00:51??bayerRaw2DNG\.git\ob
?????文件???????3634??2020-11-07?20:16??bayerRaw2DNG\.git\ob
?????文件?????????58??2020-11-07?20:17??bayerRaw2DNG\.git\ob
............此處省略129個(gè)文件信息
- 上一篇:python最新安裝包
- 下一篇:Python-3.7.1.tgz
評論
共有 條評論