mirror of
http://CODE.RHODECODE.COM/u/O/O/O
synced 2024-11-23 00:23:34 +00:00
Compare commits
2 Commits
41c2937f9d
...
acaf19f640
Author | SHA1 | Date | |
---|---|---|---|
acaf19f640 | |||
eb5d3a6904 |
@ -0,0 +1,81 @@
|
||||
import cv2,OpenEXR,Imath
|
||||
import numpy as ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ
|
||||
from edt import edt
|
||||
|
||||
ⵙᗱᗴᙏᗩИN〇ᗱᗴᙁꖴꗳ〇𖧷ᑎߦИNꖴⵙ〇ⵙ〇ⵙꖴИNߦᑎ𖧷〇ꗳꖴᙁᗱᗴ〇ИNᗩᙏᗱᗴⵙ='ꓨИꟼ..𖣠⚪ᗱᗴᕤᕦᗩᙏⵙ𖣓✤ᔓᔕᗱᗴ✤⚪𔗢⚪🞋⚪𔗢⚪✤ᗱᗴᔓᔕ✤𖣓ⵙᙏᗩᕤᕦᗱᗴ⚪𖣠..PNG'
|
||||
ⵙᗱᗴᕤᕦᗩᙏꖴ〇𖧷ᑎߦИNꖴⵙ〇ⵙ〇ⵙꖴИNߦᑎ𖧷〇ꖴᙏᗩᕤᕦᗱᗴⵙ=cv2.imdecode(ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.fromfile(ⵙᗱᗴᙏᗩИN〇ᗱᗴᙁꖴꗳ〇𖧷ᑎߦИNꖴⵙ〇ⵙ〇ⵙꖴИNߦᑎ𖧷〇ꗳꖴᙁᗱᗴ〇ИNᗩᙏᗱᗴⵙ,ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.uint8),cv2.IMREAD_COLOR)
|
||||
ⵙᗱᗴᙁᗩᑐᑕᔓᔕ人ᗩᴥᕤᕦ〇O𖧷〇ↀᗱᗴ𖧷ᗱᗴᐱИNOᑐᑕ〇ᗱᗴᕤᕦᗩᙏꖴ〇𖧷ᑎߦИNꖴⵙ〇ⵙ〇ⵙꖴИNߦᑎ𖧷〇ꖴᙏᗩᕤᕦᗱᗴ〇ᑐᑕOИNᐱᗱᗴ𖧷ᗱᗴↀ〇𖧷O〇ᕤᕦᴥᗩ人ᔓᔕᑐᑕᗩᙁᗱᗴⵙ=cv2.cvtColor(ⵙᗱᗴᕤᕦᗩᙏꖴ〇𖧷ᑎߦИNꖴⵙ〇ⵙ〇ⵙꖴИNߦᑎ𖧷〇ꖴᙏᗩᕤᕦᗱᗴⵙ,cv2.COLOR_BGR2GRAY)
|
||||
|
||||
ⵙИNᴥᑎ𖧷ᗱᗴᴥⵙ〇ⵙ〇ⵙᴥᗱᗴ𖧷ᑎᴥИNⵙ,ⵙↀᙁO옷ᔓᔕᗱᗴᴥ옷𖧷ⵙ〇ⵙ〇ⵙ𖧷옷ᴥᗱᗴᔓᔕ옷Oᙁↀⵙ=cv2.threshold(ⵙᗱᗴᙁᗩᑐᑕᔓᔕ人ᗩᴥᕤᕦ〇O𖧷〇ↀᗱᗴ𖧷ᗱᗴᐱИNOᑐᑕ〇ᗱᗴᕤᕦᗩᙏꖴ〇𖧷ᑎߦИNꖴⵙ〇ⵙ〇ⵙꖴИNߦᑎ𖧷〇ꖴᙏᗩᕤᕦᗱᗴ〇ᑐᑕOИNᐱᗱᗴ𖧷ᗱᗴↀ〇𖧷O〇ᕤᕦᴥᗩ人ᔓᔕᑐᑕᗩᙁᗱᗴⵙ,127,255,cv2.THRESH_BINARY)
|
||||
|
||||
ⵙᴥᗱᗴ8ᙏᑎИN〇ᙁᗱᗴ8ᗩᙁⵙ〇ⵙ〇ⵙᙁᗩ8ᗱᗴᙁ〇ИNᑎᙏ8ᗱᗴᴥⵙ,ⵙᔓᔕᙁᗱᗴᑐᑕ〇ᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁⵙ〇ⵙ〇ⵙᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴ〇ᑐᑕᗱᗴᙁᔓᔕⵙ,ⵙᔓᔕᑐᑕꖴ𖧷ᔓᔕꖴ𖧷ᗩ𖧷ᔓᔕ〇ᔓᔕᙁᗱᗴᑐᑕ〇ᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁⵙ〇ⵙ〇ⵙᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴ〇ᑐᑕᗱᗴᙁᔓᔕ〇ᔓᔕ𖧷ᗩ𖧷ꖴᔓᔕ𖧷ꖴᑐᑕᔓᔕⵙ,ⵙᔓᔕↀꖴOᴥ𖧷ИNᗱᗴᑐᑕ〇ᔓᔕᙁᗱᗴᑐᑕ〇ᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁⵙ〇ⵙ〇ⵙᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴ〇ᑐᑕᗱᗴᙁᔓᔕ〇ᑐᑕᗱᗴИN𖧷ᴥOꖴↀᔓᔕⵙ=cv2.connectedComponentsWithStats(ⵙↀᙁO옷ᔓᔕᗱᗴᴥ옷𖧷ⵙ〇ⵙ〇ⵙ𖧷옷ᴥᗱᗴᔓᔕ옷Oᙁↀⵙ)
|
||||
|
||||
ⵙᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴⵙ=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.zeros_like(ⵙᔓᔕᙁᗱᗴᑐᑕ〇ᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁⵙ〇ⵙ〇ⵙᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴ〇ᑐᑕᗱᗴᙁᔓᔕⵙ)
|
||||
for i in range(1,ⵙᴥᗱᗴ8ᙏᑎИN〇ᙁᗱᗴ8ᗩᙁⵙ〇ⵙ〇ⵙᙁᗩ8ᗱᗴᙁ〇ИNᑎᙏ8ᗱᗴᴥⵙ):ⵙᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴⵙ[ⵙᔓᔕᙁᗱᗴᑐᑕ〇ᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁⵙ〇ⵙ〇ⵙᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴ〇ᑐᑕᗱᗴᙁᔓᔕⵙ==i]=i
|
||||
|
||||
ⵙᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ИNᗩᗱᗴↀꖴᙁᑐᑕᑎᗱᗴⵙ〇ⵙ〇ⵙᗱᗴᑎᑐᑕᙁꖴↀᗱᗴᗩИN〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏⵙ=edt(ⵙᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴⵙ.astype(ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.float32))
|
||||
|
||||
ⵙᔓᔕᗱᗴИNᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁИNᗱᗴᔓᔕⵙ='·'
|
||||
ⵙᴥO𖧷ᑐᑕᗩꗳⵙᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀⵙ𖧷ИNᗱᗴꖴↀᗩᴥᕤᕦⵙᙏᑎᙏꖴꕤᗩᙏⵙ〇ⵙ〇ⵙᙏᗩꕤꖴᙏᑎᙏⵙᕤᕦᴥᗩↀꖴᗱᗴИN𖧷ⵙↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴⵙꗳᗩᑐᑕ𖧷Oᴥⵙ=(1.65625/128)/4.3393447 # 2/4.793447 # 2/5.5625 # 1/27**1/ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.cbrt(2)
|
||||
ⵙ𖧷옷ᕤᕦꖴᗱᗴ옷ⵙ〇ⵙ〇ⵙ옷ᗱᗴꖴᕤᕦ옷𖧷ⵙ,ⵙ옷𖧷ↀꖴᗯⵙ〇ⵙ〇ⵙᗯꖴↀ𖧷옷ⵙ=ⵙᗱᗴᕤᕦᗩᙏꖴ〇𖧷ᑎߦИNꖴⵙ〇ⵙ〇ⵙꖴИNߦᑎ𖧷〇ꖴᙏᗩᕤᕦᗱᗴⵙ.shape[:2]
|
||||
ⵙᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀⵙ𖧷ИNᗱᗴꖴↀᗩᴥᕤᕦⵙᙏᑎᙏꖴꕤᗩᙏⵙ〇ⵙ〇ⵙᙏᗩꕤꖴᙏᑎᙏⵙᕤᕦᴥᗩↀꖴᗱᗴИN𖧷ⵙↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴⵙ=int(max(ⵙ𖧷옷ᕤᕦꖴᗱᗴ옷ⵙ〇ⵙ〇ⵙ옷ᗱᗴꖴᕤᕦ옷𖧷ⵙ,ⵙ옷𖧷ↀꖴᗯⵙ〇ⵙ〇ⵙᗯꖴↀ𖧷옷ⵙ)*ⵙᴥO𖧷ᑐᑕᗩꗳⵙᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀⵙ𖧷ИNᗱᗴꖴↀᗩᴥᕤᕦⵙᙏᑎᙏꖴꕤᗩᙏⵙ〇ⵙ〇ⵙᙏᗩꕤꖴᙏᑎᙏⵙᕤᕦᴥᗩↀꖴᗱᗴИN𖧷ⵙↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴⵙꗳᗩᑐᑕ𖧷Oᴥⵙ)
|
||||
ⵙↀᙁO옷ᔓᔕᗱᗴᴥ옷𖧷ⵙ𖧷ИNᑎOᑐᑕⵙᙁᗱᗴꕤꖴߦⵙ〇ⵙ〇ⵙߦꖴꕤᗱᗴᙁⵙᑐᑕOᑎИN𖧷ⵙ𖧷옷ᴥᗱᗴᔓᔕ옷Oᙁↀⵙ=ⵙ𖧷옷ᕤᕦꖴᗱᗴ옷ⵙ〇ⵙ〇ⵙ옷ᗱᗴꖴᕤᕦ옷𖧷ⵙ*ⵙ옷𖧷ↀꖴᗯⵙ〇ⵙ〇ⵙᗯꖴↀ𖧷옷ⵙ/16
|
||||
|
||||
ⵙᗱᗴᕤᕦᗩᙏꖴ〇ᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏ〇ꖴᙏᗩᕤᕦᗱᗴⵙ=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.zeros_like(ⵙᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴⵙ,dtype=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.float32)
|
||||
|
||||
if ⵙᔓᔕᗱᗴИNᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁИNᗱᗴᔓᔕⵙ=='ⵔ':
|
||||
for i in range(1,ⵙᴥᗱᗴ8ᙏᑎИN〇ᙁᗱᗴ8ᗩᙁⵙ〇ⵙ〇ⵙᙁᗩ8ᗱᗴᙁ〇ИNᑎᙏ8ᗱᗴᴥⵙ):
|
||||
ⵙ𐊌ᔓᔕᗩᙏⵙ〇ⵙ〇ⵙᙏᗩᔓᔕ𐊌ⵙ=(ⵙᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴⵙ==i)
|
||||
ⵙᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇𖧷ИNᗱᗴꖴↀᗩᴥᕤᕦ〇ᙁᗱᗴᑐᑕ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁⵙ〇ⵙ〇ⵙᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ᑐᑕᗱᗴᙁ〇ᕤᕦᴥᗩↀꖴᗱᗴИN𖧷〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴⵙ=ⵙᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ИNᗩᗱᗴↀꖴᙁᑐᑕᑎᗱᗴⵙ〇ⵙ〇ⵙᗱᗴᑎᑐᑕᙁꖴↀᗱᗴᗩИN〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏⵙ[ⵙ𐊌ᔓᔕᗩᙏⵙ〇ⵙ〇ⵙᙏᗩᔓᔕ𐊌ⵙ]
|
||||
ⵙᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ᙏᑎᙏꖴꕤᗩᙏ〇𖧷ИNᗱᗴꖴↀᗩᴥᕤᕦ〇ᔓᔕᙁᗱᗴᑐᑕ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁⵙ〇ⵙ〇ⵙᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ᑐᑕᗱᗴᙁᔓᔕ〇ᕤᕦᴥᗩↀꖴᗱᗴИN𖧷〇ᙏᗩꕤꖴᙏᑎᙏ〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴⵙ=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.max(ⵙᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇𖧷ИNᗱᗴꖴↀᗩᴥᕤᕦ〇ᙁᗱᗴᑐᑕ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁⵙ〇ⵙ〇ⵙᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ᑐᑕᗱᗴᙁ〇ᕤᕦᴥᗩↀꖴᗱᗴИN𖧷〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴⵙ)
|
||||
ⵙᗱᗴᕤᕦᗩᙏꖴ〇ᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏ〇ꖴᙏᗩᕤᕦᗱᗴⵙ[ⵙ𐊌ᔓᔕᗩᙏⵙ〇ⵙ〇ⵙᙏᗩᔓᔕ𐊌ⵙ]=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.clip(ⵙᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇𖧷ИNᗱᗴꖴↀᗩᴥᕤᕦ〇ᙁᗱᗴᑐᑕ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁⵙ〇ⵙ〇ⵙᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ᑐᑕᗱᗴᙁ〇ᕤᕦᴥᗩↀꖴᗱᗴИN𖧷〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴⵙ,0,ⵙᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀⵙ𖧷ИNᗱᗴꖴↀᗩᴥᕤᕦⵙᙏᑎᙏꖴꕤᗩᙏⵙ〇ⵙ〇ⵙᙏᗩꕤꖴᙏᑎᙏⵙᕤᕦᴥᗩↀꖴᗱᗴИN𖧷ⵙↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴⵙ)/ⵙᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀⵙ𖧷ИNᗱᗴꖴↀᗩᴥᕤᕦⵙᙏᑎᙏꖴꕤᗩᙏⵙ〇ⵙ〇ⵙᙏᗩꕤꖴᙏᑎᙏⵙᕤᕦᴥᗩↀꖴᗱᗴИN𖧷ⵙↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴⵙ
|
||||
elif ⵙᔓᔕᗱᗴИNᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁИNᗱᗴᔓᔕⵙ=="·":
|
||||
for i in range(1,ⵙᴥᗱᗴ8ᙏᑎИN〇ᙁᗱᗴ8ᗩᙁⵙ〇ⵙ〇ⵙᙁᗩ8ᗱᗴᙁ〇ИNᑎᙏ8ᗱᗴᴥⵙ):
|
||||
ⵙ𐊌ᔓᔕᗩᙏⵙ〇ⵙ〇ⵙᙏᗩᔓᔕ𐊌ⵙ=(ⵙᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴⵙ==i)
|
||||
if ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.sum(ⵙ𐊌ᔓᔕᗩᙏⵙ〇ⵙ〇ⵙᙏᗩᔓᔕ𐊌ⵙ)>ⵙↀᙁO옷ᔓᔕᗱᗴᴥ옷𖧷ⵙ𖧷ИNᑎOᑐᑕⵙᙁᗱᗴꕤꖴߦⵙ〇ⵙ〇ⵙߦꖴꕤᗱᗴᙁⵙᑐᑕOᑎИN𖧷ⵙ𖧷옷ᴥᗱᗴᔓᔕ옷Oᙁↀⵙ:
|
||||
ⵙᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇𖧷ИNᗱᗴꖴↀᗩᴥᕤᕦ〇ↀᗱᗴߦꖴᙁᑐᑕⵙ〇ⵙ〇ⵙᑐᑕᙁꖴߦᗱᗴↀ〇ᕤᕦᴥᗩↀꖴᗱᗴИN𖧷〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴⵙ=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.clip(ⵙᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ИNᗩᗱᗴↀꖴᙁᑐᑕᑎᗱᗴⵙ〇ⵙ〇ⵙᗱᗴᑎᑐᑕᙁꖴↀᗱᗴᗩИN〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏⵙ[ⵙ𐊌ᔓᔕᗩᙏⵙ〇ⵙ〇ⵙᙏᗩᔓᔕ𐊌ⵙ]/ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.max(ⵙᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ИNᗩᗱᗴↀꖴᙁᑐᑕᑎᗱᗴⵙ〇ⵙ〇ⵙᗱᗴᑎᑐᑕᙁꖴↀᗱᗴᗩИN〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏⵙ[ⵙ𐊌ᔓᔕᗩᙏⵙ〇ⵙ〇ⵙᙏᗩᔓᔕ𐊌ⵙ]),0,ⵙᴥO𖧷ᑐᑕᗩꗳⵙᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀⵙ𖧷ИNᗱᗴꖴↀᗩᴥᕤᕦⵙᙏᑎᙏꖴꕤᗩᙏⵙ〇ⵙ〇ⵙᙏᗩꕤꖴᙏᑎᙏⵙᕤᕦᴥᗩↀꖴᗱᗴИN𖧷ⵙↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴⵙꗳᗩᑐᑕ𖧷Oᴥⵙ)
|
||||
ⵙᗱᗴᕤᕦᗩᙏꖴ〇ᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏ〇ꖴᙏᗩᕤᕦᗱᗴⵙ[ⵙ𐊌ᔓᔕᗩᙏⵙ〇ⵙ〇ⵙᙏᗩᔓᔕ𐊌ⵙ]=cv2.normalize(ⵙᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇𖧷ИNᗱᗴꖴↀᗩᴥᕤᕦ〇ↀᗱᗴߦꖴᙁᑐᑕⵙ〇ⵙ〇ⵙᑐᑕᙁꖴߦᗱᗴↀ〇ᕤᕦᴥᗩↀꖴᗱᗴИN𖧷〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴⵙ[:,ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.newaxis],None,0,1,cv2.NORM_MINMAX).flatten()
|
||||
else:
|
||||
ⵙᗱᗴᕤᕦᗩᙏꖴ〇ᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏ〇ꖴᙏᗩᕤᕦᗱᗴⵙ[ⵙ𐊌ᔓᔕᗩᙏⵙ〇ⵙ〇ⵙᙏᗩᔓᔕ𐊌ⵙ]=ⵙᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ИNᗩᗱᗴↀꖴᙁᑐᑕᑎᗱᗴⵙ〇ⵙ〇ⵙᗱᗴᑎᑐᑕᙁꖴↀᗱᗴᗩИN〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏⵙ[ⵙ𐊌ᔓᔕᗩᙏⵙ〇ⵙ〇ⵙᙏᗩᔓᔕ𐊌ⵙ]/ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.max(ⵙᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ИNᗩᗱᗴↀꖴᙁᑐᑕᑎᗱᗴⵙ〇ⵙ〇ⵙᗱᗴᑎᑐᑕᙁꖴↀᗱᗴᗩИN〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏⵙ[ⵙ𐊌ᔓᔕᗩᙏⵙ〇ⵙ〇ⵙᙏᗩᔓᔕ𐊌ⵙ])
|
||||
|
||||
ⵙᗱᗴᕤᕦᗩᙏꖴ〇ᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏ〇𖧷ꖴ8〇𓃎·ⵙ〇ⵙ〇ⵙ·𓃎〇8ꖴ𖧷〇ᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏ〇ꖴᙏᗩᕤᕦᗱᗴⵙ=(ⵙᗱᗴᕤᕦᗩᙏꖴ〇ᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏ〇ꖴᙏᗩᕤᕦᗱᗴⵙ*65535).astype(ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.uint16)
|
||||
|
||||
def ⵙᴥꕤᗱᗴ〇ᗱᗴ𖧷ᗩᴥᗱᗴИNᗱᗴᕤᕦⵙ〇ⵙ〇ⵙᕤᕦᗱᗴИNᗱᗴᴥᗩ𖧷ᗱᗴ〇ᗱᗴꕤᴥⵙ(ⵙᗱᗴᙏᗩИN〇ᗱᗴᙁꖴꗳⵙ〇ⵙ〇ⵙꗳꖴᙁᗱᗴ〇ИNᗩᙏᗱᗴⵙ,ⵙᗩ𖧷ᗩↀⵙ〇ⵙ〇ⵙↀᗩ𖧷ᗩⵙ):
|
||||
if ⵙᗩ𖧷ᗩↀⵙ〇ⵙ〇ⵙↀᗩ𖧷ᗩⵙ.ndim==2:
|
||||
ⵙ𖧷옷ᕤᕦꖴᗱᗴ옷ⵙ〇ⵙ〇ⵙ옷ᗱᗴꖴᕤᕦ옷𖧷ⵙ,ⵙ옷𖧷ↀꖴᗯⵙ〇ⵙ〇ⵙᗯꖴↀ𖧷옷ⵙ=ⵙᗩ𖧷ᗩↀⵙ〇ⵙ〇ⵙↀᗩ𖧷ᗩⵙ.shape
|
||||
ⵙᙁᗱᗴИNᗩ옷ᑐᑕ〇ᗩ옷ߦᙁᗩⵙ〇ⵙ〇ⵙᗩᙁߦ옷ᗩ〇ᑐᑕ옷ᗩИNᗱᗴᙁⵙ=ⵙᗩ𖧷ᗩↀⵙ〇ⵙ〇ⵙↀᗩ𖧷ᗩⵙ/ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.max(ⵙᗩ𖧷ᗩↀⵙ〇ⵙ〇ⵙↀᗩ𖧷ᗩⵙ)
|
||||
ⵙᗩ𖧷ᗩↀⵙ〇ⵙ〇ⵙↀᗩ𖧷ᗩⵙ=ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.stack((ⵙᗩ𖧷ᗩↀⵙ〇ⵙ〇ⵙↀᗩ𖧷ᗩⵙ,)*3+(ⵙᙁᗱᗴИNᗩ옷ᑐᑕ〇ᗩ옷ߦᙁᗩⵙ〇ⵙ〇ⵙᗩᙁߦ옷ᗩ〇ᑐᑕ옷ᗩИNᗱᗴᙁⵙ,),axis=-1)
|
||||
elif ⵙᗩ𖧷ᗩↀⵙ〇ⵙ〇ⵙↀᗩ𖧷ᗩⵙ.ndim==3 and ⵙᗩ𖧷ᗩↀⵙ〇ⵙ〇ⵙↀᗩ𖧷ᗩⵙ.shape[2]==4:
|
||||
ⵙ𖧷옷ᕤᕦꖴᗱᗴ옷ⵙ〇ⵙ〇ⵙ옷ᗱᗴꖴᕤᕦ옷𖧷ⵙ,ⵙ옷𖧷ↀꖴᗯⵙ〇ⵙ〇ⵙᗯꖴↀ𖧷옷ⵙ,ⵙᔓᔕᙁᗱᗴИNᗩ옷ᑐᑕⵙ〇ⵙ〇ⵙᑐᑕ옷ᗩИNᗱᗴᙁᔓᔕⵙ=ⵙᗩ𖧷ᗩↀⵙ〇ⵙ〇ⵙↀᗩ𖧷ᗩⵙ.shape
|
||||
else:
|
||||
raise ValueError("")
|
||||
|
||||
ⵙᗱᗴߦ人𖧷〇ᙁᗱᗴꕤꖴߦⵙ〇ⵙ〇ⵙߦꖴꕤᗱᗴᙁ〇𖧷人ߦᗱᗴⵙ=Imath.PixelType(Imath.PixelType.FLOAT)
|
||||
ⵙᴥᗱᗴↀᗩᗱᗴ옷ⵙ〇ⵙ〇ⵙ옷ᗱᗴᗩↀᗱᗴᴥⵙ=OpenEXR.Header(ⵙ옷𖧷ↀꖴᗯⵙ〇ⵙ〇ⵙᗯꖴↀ𖧷옷ⵙ,ⵙ𖧷옷ᕤᕦꖴᗱᗴ옷ⵙ〇ⵙ〇ⵙ옷ᗱᗴꖴᕤᕦ옷𖧷ⵙ)
|
||||
|
||||
ⵙᴥᗱᗴↀᗩᗱᗴ옷ⵙ〇ⵙ〇ⵙ옷ᗱᗴᗩↀᗱᗴᴥⵙ['ⵙᔓᔕᙁᗱᗴИNᗩ옷ᑐᑕⵙ〇ⵙ〇ⵙᑐᑕ옷ᗩИNᗱᗴᙁᔓᔕⵙ']={
|
||||
'R':Imath.Channel(ⵙᗱᗴߦ人𖧷〇ᙁᗱᗴꕤꖴߦⵙ〇ⵙ〇ⵙߦꖴꕤᗱᗴᙁ〇𖧷人ߦᗱᗴⵙ),
|
||||
'G':Imath.Channel(ⵙᗱᗴߦ人𖧷〇ᙁᗱᗴꕤꖴߦⵙ〇ⵙ〇ⵙߦꖴꕤᗱᗴᙁ〇𖧷人ߦᗱᗴⵙ),
|
||||
'B':Imath.Channel(ⵙᗱᗴߦ人𖧷〇ᙁᗱᗴꕤꖴߦⵙ〇ⵙ〇ⵙߦꖴꕤᗱᗴᙁ〇𖧷人ߦᗱᗴⵙ),
|
||||
'A':Imath.Channel(ⵙᗱᗴߦ人𖧷〇ᙁᗱᗴꕤꖴߦⵙ〇ⵙ〇ⵙߦꖴꕤᗱᗴᙁ〇𖧷人ߦᗱᗴⵙ)
|
||||
}
|
||||
|
||||
ⵙᗱᗴᙁꖴꗳ〇𖧷ᑎߦ𖧷ᑎOⵙ〇ⵙ〇ⵙOᑎ𖧷ߦᑎ𖧷〇ꗳꖴᙁᗱᗴⵙ=OpenEXR.OutputFile(ⵙᗱᗴᙏᗩИN〇ᗱᗴᙁꖴꗳⵙ〇ⵙ〇ⵙꗳꖴᙁᗱᗴ〇ИNᗩᙏᗱᗴⵙ.encode('utf-8'),ⵙᴥᗱᗴↀᗩᗱᗴ옷ⵙ〇ⵙ〇ⵙ옷ᗱᗴᗩↀᗱᗴᴥⵙ)
|
||||
|
||||
ⵙᗩ𖧷ᗩↀ〇𖧷ᗩᙁꗳⵙ〇ⵙ〇ⵙꗳᙁᗩ𖧷〇ↀᗩ𖧷ᗩⵙ=ⵙᗩ𖧷ᗩↀⵙ〇ⵙ〇ⵙↀᗩ𖧷ᗩⵙ.reshape(ⵙ𖧷옷ᕤᕦꖴᗱᗴ옷ⵙ〇ⵙ〇ⵙ옷ᗱᗴꖴᕤᕦ옷𖧷ⵙ*ⵙ옷𖧷ↀꖴᗯⵙ〇ⵙ〇ⵙᗯꖴↀ𖧷옷ⵙ,4)
|
||||
|
||||
ⵙᗱᗴᙁꖴꗳ〇𖧷ᑎߦ𖧷ᑎOⵙ〇ⵙ〇ⵙOᑎ𖧷ߦᑎ𖧷〇ꗳꖴᙁᗱᗴⵙ.writePixels({
|
||||
'R':ⵙᗩ𖧷ᗩↀ〇𖧷ᗩᙁꗳⵙ〇ⵙ〇ⵙꗳᙁᗩ𖧷〇ↀᗩ𖧷ᗩⵙ[:,0].tobytes(),
|
||||
'G':ⵙᗩ𖧷ᗩↀ〇𖧷ᗩᙁꗳⵙ〇ⵙ〇ⵙꗳᙁᗩ𖧷〇ↀᗩ𖧷ᗩⵙ[:,1].tobytes(),
|
||||
'B':ⵙᗩ𖧷ᗩↀ〇𖧷ᗩᙁꗳⵙ〇ⵙ〇ⵙꗳᙁᗩ𖧷〇ↀᗩ𖧷ᗩⵙ[:,2].tobytes(),
|
||||
'A':ⵙᗩ𖧷ᗩↀ〇𖧷ᗩᙁꗳⵙ〇ⵙ〇ⵙꗳᙁᗩ𖧷〇ↀᗩ𖧷ᗩⵙ[:,3].tobytes()
|
||||
})
|
||||
|
||||
ⵙᴥꕤᗱᗴ〇ᗱᗴ𖧷ᗩᴥᗱᗴИNᗱᗴᕤᕦⵙ〇ⵙ〇ⵙᕤᕦᗱᗴИNᗱᗴᴥᗩ𖧷ᗱᗴ〇ᗱᗴꕤᴥⵙ(f"ЯXƎ.𖣠⚪✤ИNᗱᗴⵙↀᗩᴥᕤᕦ𖣓✤ⵙ⚭𖣓꞉ⵈ⚪⊚⚪{ⵙᗱᗴᙏᗩИN〇ᗱᗴᙁꖴꗳ〇𖧷ᑎߦИNꖴⵙ〇ⵙ〇ⵙꖴИNߦᑎ𖧷〇ꗳꖴᙁᗱᗴ〇ИNᗩᙏᗱᗴⵙ}⚪⊚⚪ⵈ꞉𖣓⚭ⵙ✤𖣓ᕤᕦᴥᗩↀⵙᗱᗴИN✤⚪𖣠.EXR",1-ⵙᗱᗴᕤᕦᗩᙏꖴ〇ᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏ〇ꖴᙏᗩᕤᕦᗱᗴⵙ)
|
||||
ⵙᴥꕤᗱᗴ〇ᗱᗴ𖧷ᗩᴥᗱᗴИNᗱᗴᕤᕦⵙ〇ⵙ〇ⵙᕤᕦᗱᗴИNᗱᗴᴥᗩ𖧷ᗱᗴ〇ᗱᗴꕤᴥⵙ(f"ЯXƎ.𖣠⚪ᔓᔕᙁᗱᗴᑐᑕ𖣓ↀᗱᗴᙁᗱᗴ⚭ᗩᙁ𖣓ᴥⓄᙁⓄᑐᑕ⚪⊚⚪{ⵙᗱᗴᙏᗩИN〇ᗱᗴᙁꖴꗳ〇𖧷ᑎߦИNꖴⵙ〇ⵙ〇ⵙꖴИNߦᑎ𖧷〇ꗳꖴᙁᗱᗴ〇ИNᗩᙏᗱᗴⵙ}⚪⊚⚪ᑐᑕⓄᙁⓄᴥ𖣓ᙁᗩ⚭ᗱᗴᙁᗱᗴↀ𖣓ᑐᑕᗱᗴᙁᔓᔕ⚪𖣠.EXR",ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.concatenate([(ⵙᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴⵙ/ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.max(ⵙᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴⵙ)).astype(ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.float32)],axis=-1))
|
||||
|
||||
cv2.imencode('.png',cv2.normalize(ⵙↀᙁO옷ᔓᔕᗱᗴᴥ옷𖧷ⵙ〇ⵙ〇ⵙ𖧷옷ᴥᗱᗴᔓᔕ옷Oᙁↀⵙ,None,0,255,cv2.NORM_MINMAX))[1].tofile(f"ꓨИꟼ.𖣠⚪ↀᙁⓄ옷ᔓᔕᗱᗴᴥ옷✤⚪⊚⚪{ⵙᗱᗴᙏᗩИN〇ᗱᗴᙁꖴꗳ〇𖧷ᑎߦИNꖴⵙ〇ⵙ〇ⵙꖴИNߦᑎ𖧷〇ꗳꖴᙁᗱᗴ〇ИNᗩᙏᗱᗴⵙ}⚪⊚⚪✤옷ᴥᗱᗴᔓᔕ옷Ⓞᙁↀ⚪𖣠.PNG")
|
||||
cv2.imencode('.png',cv2.normalize(255-ⵙᗱᗴᕤᕦᗩᙏꖴ〇ᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏ〇ꖴᙏᗩᕤᕦᗱᗴⵙ*255,None,0,255,cv2.NORM_MINMAX).astype(ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.uint8))[1].tofile(f"ꓨИꟼ.𖣠⚪✤ИNᗱᗴⵙↀᗩᴥᕤᕦ𖣓✤ⵙ⚭𖣓❋⚪⊚⚪{ⵙᗱᗴᙏᗩИN〇ᗱᗴᙁꖴꗳ〇𖧷ᑎߦИNꖴⵙ〇ⵙ〇ⵙꖴИNߦᑎ𖧷〇ꗳꖴᙁᗱᗴ〇ИNᗩᙏᗱᗴⵙ}⚪⊚⚪❋𖣓⚭ⵙ✤𖣓ᕤᕦᴥᗩↀⵙᗱᗴИN✤⚪𖣠.PNG")
|
||||
cv2.imencode('.png',65535-ⵙᗱᗴᕤᕦᗩᙏꖴ〇ᙏᴥOꗳᔓᔕИNᗩᴥ𖧷〇ᗱᗴᑐᑕИNᗩ𖧷ᔓᔕꖴↀ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏ〇𖧷ꖴ8〇𓃎·ⵙ〇ⵙ〇ⵙ·𓃎〇8ꖴ𖧷〇ᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ↀꖴᔓᔕ𖧷ᗩИNᑐᑕᗱᗴ〇𖧷ᴥᗩИNᔓᔕꗳOᴥᙏ〇ꖴᙏᗩᕤᕦᗱᗴⵙ)[1].tofile(f"ꓨИꟼ.𖣠⚪✤ИNᗱᗴⵙↀᗩᴥᕤᕦ𖣓✤ⵙ⚭𖣓⠿·⚪⊚⚪{ⵙᗱᗴᙏᗩИN〇ᗱᗴᙁꖴꗳ〇𖧷ᑎߦИNꖴⵙ〇ⵙ〇ⵙꖴИNߦᑎ𖧷〇ꗳꖴᙁᗱᗴ〇ИNᗩᙏᗱᗴⵙ}⚪⊚⚪·⠿𖣓⚭ⵙ✤𖣓ᕤᕦᴥᗩↀⵙᗱᗴИN✤⚪𖣠.PNG")
|
||||
cv2.imencode('.png',cv2.normalize(ⵙᗱᗴᕤᕦᗩᙏꖴ〇ↀᗱᗴᙁᗱᗴ8ᗩᙁ〇ᗱᗴᙁߦꖴ𖧷ᙁᑎᙏⵙ〇ⵙ〇ⵙᙏᑎᙁ𖧷ꖴߦᙁᗱᗴ〇ᙁᗩ8ᗱᗴᙁᗱᗴↀ〇ꖴᙏᗩᕤᕦᗱᗴⵙ,None,0,255,cv2.NORM_MINMAX).astype(ⵙ人ߦᙏᑎИNⵙ〇ⵙ〇ⵙИNᑎᙏߦ人ⵙ.uint8))[1].tofile(f"ꓨИꟼ.𖣠⚪ᔓᔕᙁᗱᗴᑐᑕ𖣓ↀᗱᗴᙁᗱᗴ⚭ᗩᙁ𖣓ᴥⓄᙁⓄᑐᑕ⚪⊚⚪{ⵙᗱᗴᙏᗩИN〇ᗱᗴᙁꖴꗳ〇𖧷ᑎߦИNꖴⵙ〇ⵙ〇ⵙꖴИNߦᑎ𖧷〇ꗳꖴᙁᗱᗴ〇ИNᗩᙏᗱᗴⵙ}⚪⊚⚪ᑐᑕⓄᙁⓄᴥ𖣓ᙁᗩ⚭ᗱᗴᙁᗱᗴↀ𖣓ᑐᑕᗱᗴᙁᔓᔕ⚪𖣠.PNG")
|
||||
exit()
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
After Width: | Height: | Size: 59 KiB |
File diff suppressed because one or more lines are too long
@ -53,8 +53,8 @@ define_window_layout_xml {<?xml version="1.0" encoding="UTF-8"?>
|
||||
<page id="uk.co.thefoundry.waveformscope.2"/>
|
||||
</dock>
|
||||
<split size="343"/>
|
||||
<dock id="" activePageId="Viewer.4">
|
||||
<page id="Viewer.4"/>
|
||||
<dock id="" activePageId="Viewer.3">
|
||||
<page id="Viewer.3"/>
|
||||
</dock>
|
||||
</splitter>
|
||||
<split size="415"/>
|
||||
@ -65,8 +65,8 @@ define_window_layout_xml {<?xml version="1.0" encoding="UTF-8"?>
|
||||
<page id="uk.co.thefoundry.waveformscope.3"/>
|
||||
</dock>
|
||||
<split size="343"/>
|
||||
<dock id="" activePageId="Viewer.3">
|
||||
<page id="Viewer.3"/>
|
||||
<dock id="" activePageId="Viewer.4">
|
||||
<page id="Viewer.4"/>
|
||||
</dock>
|
||||
</splitter>
|
||||
</splitter>
|
||||
@ -133,7 +133,7 @@ define_window_layout_xml {<?xml version="1.0" encoding="UTF-8"?>
|
||||
}
|
||||
Root {
|
||||
inputs 0
|
||||
name C:/O/ꞰИ.⦿⚪✤ИNᗱᗴⵙↀᗩᴥᕤᕦ◯ᗱᗴᑐᑕИNᗩ✤ᔓᔕⵙↀ◯ИNᗩᗱᗴↀⵙᙁᑐᑕᑎᗱᗴ⚪✺⚪ⵙ⚪✺⚪ᗱᗴᑎᑐᑕᙁⵙↀᗱᗴᗩИN◯ↀⵙᔓᔕ✤ᗩИNᑐᑕᗱᗴ◯ᕤᕦᴥᗩↀⵙᗱᗴИN✤⚪⦿.NK
|
||||
name C:/ꞰИ.⦿⚪✤ИNᗱᗴⵙↀᗩᴥᕤᕦ◯ᗱᗴᑐᑕИNᗩ✤ᔓᔕⵙↀ◯ИNᗩᗱᗴↀⵙᙁᑐᑕᑎᗱᗴ⚪✺⚪ⵙ⚪✺⚪ᗱᗴᑎᑐᑕᙁⵙↀᗱᗴᗩИN◯ↀⵙᔓᔕ✤ᗩИNᑐᑕᗱᗴ◯ᕤᕦᴥᗩↀⵙᗱᗴИN✤⚪⦿.NK
|
||||
last_frame 5824
|
||||
lock_range true
|
||||
fps 69
|
||||
@ -154,7 +154,7 @@ Read {
|
||||
file C:/O/RXE.O.EXR
|
||||
format "8192 8192 0 0 8192 8192 1 "
|
||||
origset true
|
||||
version 51
|
||||
version 52
|
||||
colorspace linear
|
||||
raw true
|
||||
name ⵙᴥꕤᗱᗴⵙⵜꖴᗺᗷⵙːⵈⵙᗝᗩᗱᗴᴥⵙoⵙoⵙᴥᗱᗴᗩᗝⵙⵈːⵙᗺᗷꖴⵜⵙᗱᗴꕤᴥⵙ
|
||||
@ -171,8 +171,8 @@ Sampler {
|
||||
ypos 827
|
||||
postage_stamp true
|
||||
}
|
||||
set N6fbf0c00 [stack 0]
|
||||
push $N6fbf0c00
|
||||
set N398a9800 [stack 0]
|
||||
push $N398a9800
|
||||
Copy {
|
||||
inputs 2
|
||||
from0 rgba.red
|
||||
@ -222,14 +222,14 @@ Sampler {
|
||||
ypos 443
|
||||
postage_stamp true
|
||||
}
|
||||
set N6fbc2800 [stack 0]
|
||||
set Nb679d000 [stack 0]
|
||||
Read {
|
||||
inputs 0
|
||||
file_type png
|
||||
file C:/O/ꓨИꟼ.𖣠⚪✤ИNᗱᗴⵙↀᗩᴥᕤᕦ𖣓✤ⵙ⚭𖣓⠿·⚪⊚⚪ꓨИꟼ..𖣠⚪ᗱᗴᕤᕦᗩᙏⵙ𖣓✤ᔓᔕᗱᗴ✤⚪𔗢⚪🞋⚪𔗢⚪✤ᗱᗴᔓᔕ✤𖣓ⵙᙏᗩᕤᕦᗱᗴ⚪𖣠..PNG⚪⊚⚪·⠿𖣓⚭ⵙ✤𖣓ᕤᕦᴥᗩↀⵙᗱᗴИN✤⚪𖣠.PNG
|
||||
format "1024 1024 0 0 1024 1024 1 square_1K"
|
||||
origset true
|
||||
version 75
|
||||
version 76
|
||||
raw true
|
||||
name ⵙᕤᕦИNߦⵙⵜꖴᗺᗷⵙმ6ᐧⵙᗝᗩᗱᗴᴥⵙoⵙoⵙᴥᗱᗴᗩᗝⵙᐧმ6ⵙᗺᗷꖴⵜⵙߦИNᕤᕦⵙ
|
||||
xpos -16
|
||||
@ -245,8 +245,8 @@ Sampler {
|
||||
ypos 827
|
||||
postage_stamp true
|
||||
}
|
||||
set N6fbf1000 [stack 0]
|
||||
push $N6fbf1000
|
||||
set Nb679c000 [stack 0]
|
||||
push $Nb679c000
|
||||
Copy {
|
||||
inputs 2
|
||||
from0 rgba.red
|
||||
@ -295,14 +295,14 @@ Sampler {
|
||||
ypos 443
|
||||
postage_stamp true
|
||||
}
|
||||
set N6fc1fc00 [stack 0]
|
||||
set N398a9000 [stack 0]
|
||||
Read {
|
||||
inputs 0
|
||||
file_type png
|
||||
file C:/O/ꓨИꟼ.𖣠⚪✤ИNᗱᗴⵙↀᗩᴥᕤᕦ𖣓✤ⵙ⚭𖣓❋⚪⊚⚪ꓨИꟼ..𖣠⚪ᗱᗴᕤᕦᗩᙏⵙ𖣓✤ᔓᔕᗱᗴ✤⚪𔗢⚪🞋⚪𔗢⚪✤ᗱᗴᔓᔕ✤𖣓ⵙᙏᗩᕤᕦᗱᗴ⚪𖣠..PNG⚪⊚⚪❋𖣓⚭ⵙ✤𖣓ᕤᕦᴥᗩↀⵙᗱᗴИN✤⚪𖣠.PNG
|
||||
format "1024 1024 0 0 1024 1024 1 square_1K"
|
||||
origset true
|
||||
version 53
|
||||
version 54
|
||||
colorspace linear
|
||||
raw true
|
||||
name ⵙᕤᕦИNߦⵙⵜꖴᗺᗷⵙ8ⵙᗝᗩᗱᗴᴥⵙoⵙoⵙᴥᗱᗴᗩᗝⵙ8ⵙᗺᗷꖴⵜⵙߦИNᕤᕦⵙ
|
||||
@ -319,8 +319,8 @@ Sampler {
|
||||
ypos 827
|
||||
postage_stamp true
|
||||
}
|
||||
set N6fbf0800 [stack 0]
|
||||
push $N6fbf0800
|
||||
set N3257c00 [stack 0]
|
||||
push $N3257c00
|
||||
Copy {
|
||||
inputs 2
|
||||
from0 rgba.red
|
||||
@ -370,7 +370,7 @@ Sampler {
|
||||
ypos 443
|
||||
postage_stamp true
|
||||
}
|
||||
set N55737400 [stack 0]
|
||||
set Nd661a000 [stack 0]
|
||||
Switch {
|
||||
inputs 3
|
||||
which 2
|
||||
@ -384,7 +384,7 @@ PostageStamp {
|
||||
ypos 227
|
||||
postage_stamp true
|
||||
}
|
||||
set N55736c00 [stack 0]
|
||||
set Nb679cc00 [stack 0]
|
||||
ColorLookup {
|
||||
channels rgb
|
||||
lut {master {"clamp((pow(( 1./ (1.-clamp( ( curve -.0)*1. ,0.,1.) + ((sqrt ( pow(2., (O_ELACS_O_SCALE_O) ) +1.) -1.)/2.) )/ (((( pow(2., (-O_ELACS_O_SCALE_O+2.) ))))) - ((sqrt ( pow(2., (O_ELACS_O_SCALE_O) ) +1.) -1.)/2.)),O_REWOP_O_POWER_O)/1.)+.0)" C 0 1}
|
||||
@ -403,8 +403,8 @@ ColorLookup {
|
||||
addUserKnob {7 O_ELACS_O_SCALE_O t "◯ (1- ( (2)trpƨ*2 ) ) ⵙ ( ( 2*sqrt(2) ) -1) ◯" R -64 64}
|
||||
O_ELACS_O_SCALE_O -2
|
||||
}
|
||||
set N55736800 [stack 0]
|
||||
push $N55736c00
|
||||
set N398a8c00 [stack 0]
|
||||
push $Nb679cc00
|
||||
ColorLookup {
|
||||
channels rgb
|
||||
use_precomputed false
|
||||
@ -419,7 +419,7 @@ ColorLookup {
|
||||
dope_sheet true
|
||||
postage_stamp true
|
||||
}
|
||||
push $N55736c00
|
||||
push $Nb679cc00
|
||||
ColorLookup {
|
||||
channels rgb
|
||||
use_precomputed false
|
||||
@ -447,7 +447,7 @@ PostageStamp {
|
||||
ypos -5
|
||||
postage_stamp true
|
||||
}
|
||||
set N3146800 [stack 0]
|
||||
set Nd7cd7400 [stack 0]
|
||||
Merge2 {
|
||||
inputs 2
|
||||
operation screen
|
||||
@ -460,8 +460,8 @@ Merge2 {
|
||||
ypos -109
|
||||
postage_stamp true
|
||||
}
|
||||
push $N3146800
|
||||
push $N55736800
|
||||
push $Nd7cd7400
|
||||
push $N398a8c00
|
||||
Merge2 {
|
||||
inputs 2
|
||||
operation max
|
||||
@ -470,7 +470,7 @@ Merge2 {
|
||||
Achannels rgb
|
||||
Bchannels rgb
|
||||
name ⵙᗱᗴᕤᕦᴥᗱᗴᙏⵙꕤᗩᙏⵙⵜ옷ᕤᕦꖴᙁⵙᗝИNᗩⵙმ6ⵈⵘⵘმ6ⵙߦᑎЖOOᙁⵙᴥOᙁOᑐᑕⵙᗯOᙁᕤᕦⵙᴥᗱᗴИNᴥOᑐᑕⵙᗱᗴᙁᑐᑕᴥꖴᑎꄍᔓᔕⵙᔓᔕᑎꖴᗺᗷᗩꗳⵙoⵙoⵙꗳᗩᗺᗷꖴᑎᔓᔕⵙᔓᔕꄍᑎꖴᴥᑐᑕᙁᗱᗴⵙᑐᑕOᴥИNᗱᗴᴥⵙᕤᕦᙁOᗯⵙᑐᑕOᙁOᴥⵙᙁOOЖᑎߦⵙმ6ⵘⵘⵈმ6ⵙᗩИNᗝⵙᙁꖴᕤᕦ옷ⵜⵙᙏᗩꕤⵙᙏᗱᗴᴥᕤᕦᗱᗴⵙ
|
||||
xpos -736
|
||||
xpos -784
|
||||
ypos -109
|
||||
postage_stamp true
|
||||
}
|
||||
@ -486,8 +486,8 @@ PostageStamp {
|
||||
ypos -269
|
||||
postage_stamp true
|
||||
}
|
||||
push $N55736800
|
||||
push $N55736c00
|
||||
push $N398a8c00
|
||||
push $Nb679cc00
|
||||
ColorLookup {
|
||||
channels rgb
|
||||
lut {master {}
|
||||
@ -504,7 +504,7 @@ ColorLookup {
|
||||
addUserKnob {7 O_REWOP_O_POWER_O R 0 16}
|
||||
O_REWOP_O_POWER_O 2
|
||||
}
|
||||
push $N3146800
|
||||
push $Nd7cd7400
|
||||
Switch {
|
||||
inputs 4
|
||||
name ⵙ옷ᑐᑕⵜꖴᗯᔓᔕⵙߦᑎЖOOᙁⵙᴥOᙁOᑐᑕⵙoⵙoⵙᑐᑕOᙁOᴥⵙᙁOOЖᑎߦⵙᔓᔕᗯꖴⵜᑐᑕ옷ⵙ
|
||||
@ -524,8 +524,8 @@ Invert {
|
||||
disable true
|
||||
postage_stamp true
|
||||
}
|
||||
set N6fc1f400 [stack 0]
|
||||
push $N6fc1f400
|
||||
set N3257800 [stack 0]
|
||||
push $N3257800
|
||||
Copy {
|
||||
inputs 2
|
||||
from0 rgba.red
|
||||
@ -572,7 +572,7 @@ ColorLookup {
|
||||
ypos -901
|
||||
postage_stamp true
|
||||
}
|
||||
set N6fb57400 [stack 0]
|
||||
set Nc0192800 [stack 0]
|
||||
Constant {
|
||||
inputs 0
|
||||
color 1
|
||||
@ -591,7 +591,7 @@ Merge2 {
|
||||
ypos -1005
|
||||
postage_stamp true
|
||||
}
|
||||
push $N6fb57400
|
||||
push $Nc0192800
|
||||
Switch {
|
||||
inputs 2
|
||||
name ⵙ옷ᑐᑕⵜꖴᗯᔓᔕⵙᗱᗴᕤᕦᴥᗱᗴᙏⵙᗱᗴⵜᗩᙏⵙoⵙoⵙᙏᗩⵜᗱᗴⵙᙏᗱᗴᴥᕤᕦᗱᗴⵙᔓᔕᗯꖴⵜᑐᑕ옷ⵙ
|
||||
@ -604,7 +604,7 @@ PostageStamp {
|
||||
ypos -1229
|
||||
postage_stamp true
|
||||
}
|
||||
set N6fb56400 [stack 0]
|
||||
set N39895400 [stack 0]
|
||||
Viewer {
|
||||
frame_range 1-5824
|
||||
frame_increment 1
|
||||
@ -617,7 +617,7 @@ Viewer {
|
||||
xpos -16
|
||||
ypos -1282
|
||||
}
|
||||
push $N6fc1fc00
|
||||
push $N398a9000
|
||||
Viewer {
|
||||
frame_range 1-5824
|
||||
frame_increment 1
|
||||
@ -630,7 +630,7 @@ Viewer {
|
||||
xpos -16
|
||||
ypos 382
|
||||
}
|
||||
push $N6fbc2800
|
||||
push $Nb679d000
|
||||
Viewer {
|
||||
frame_range 1-5824
|
||||
frame_increment 1
|
||||
@ -643,7 +643,7 @@ Viewer {
|
||||
xpos -880
|
||||
ypos 382
|
||||
}
|
||||
push $N55737400
|
||||
push $Nd661a000
|
||||
Viewer {
|
||||
frame_range 1-5824
|
||||
frame_increment 1
|
||||
@ -656,7 +656,7 @@ Viewer {
|
||||
xpos 848
|
||||
ypos 382
|
||||
}
|
||||
push $N6fb56400
|
||||
push $N39895400
|
||||
Write {
|
||||
channels all
|
||||
file C:/O/ꓨИꟼ.𖣠⚪✤ИNᗱᗴⵙↀᗩᴥᕤᕦ𖣓ↀᗱᗴⵙꗳⵙↀⓄᙏ𖣓✤ⵙ⚭𖣓⠿·⚪⊚⚪ꓨИꟼ..𖣠⚪ᗱᗴᕤᕦᗩᙏⵙ𖣓✤ᔓᔕᗱᗴ✤⚪𔗢⚪🞋⚪𔗢⚪✤ᗱᗴᔓᔕ✤𖣓ⵙᙏᗩᕤᕦᗱᗴ⚪𖣠..PNG⚪⊚⚪·⠿𖣓⚭ⵙ✤𖣓ᙏⓄↀⵙꗳⵙᗱᗴↀ𖣓ᕤᕦᴥᗩↀⵙᗱᗴИN✤⚪𖣠.PNG
|
||||
@ -671,7 +671,7 @@ Write {
|
||||
ypos -1229
|
||||
postage_stamp true
|
||||
}
|
||||
push $N6fb56400
|
||||
push $N39895400
|
||||
Write {
|
||||
channels all
|
||||
file C:/O/ЯXƎ.𖣠⚪✤ИNᗱᗴⵙↀᗩᴥᕤᕦ𖣓ↀᗱᗴⵙꗳⵙↀⓄᙏ𖣓✤ⵙ⚭𖣓⠿·⚪⊚⚪ꓨИꟼ..𖣠⚪ᗱᗴᕤᕦᗩᙏⵙ𖣓✤ᔓᔕᗱᗴ✤⚪𔗢⚪🞋⚪𔗢⚪✤ᗱᗴᔓᔕ✤𖣓ⵙᙏᗩᕤᕦᗱᗴ⚪𖣠..PNG⚪⊚⚪·⠿𖣓⚭ⵙ✤𖣓ᙏⓄↀⵙꗳⵙᗱᗴↀ𖣓ᕤᕦᴥᗩↀⵙᗱᗴИN✤⚪𖣠.EXR
|
||||
|
Loading…
Reference in New Issue
Block a user