Photogrammetryでなんかやってる人

Photogrammetryから心理学、人類学までいろいろ話したかった

Realtime Photogrammetry Alignment (Realitycapture CLI, Pseudocodeと高速化)

転職してから早半年、最近はちょっとだけ忙しい。頭の中は

以前ワンオペでスキャンする時に使ってたRealtime Photogrammetry Alignmentの作り方を載せたいと思う、もうワンオペでそのまま使う機会があまりないので。
尚、僕はかなり昔は情報系だったが、基本は人類学と映像学の見習いなので自分の書いたコードがかなり雑。

参考1:
Real time photogrammetry alignment - YouTubeReal time photogrammetry alignment - YouTubewww.youtube.com

参考1:
List of CLI commands – RealityCapture Support


作り方 僕の場合
機材とソフト:
 α7R4 USB有線接続 PCリモート機能
 Imaging Edge Desktop Remote 写真の転送先を”imagePath”下記に指定, PC転送はjpg
言語:
 python, GUIは最近PySimpleGUI使ってるけど当時はPyQt

def openRC(logPath): #Realitycaputureを起動
	reset #いろいろをリセット
	realitycapture.exe -setInstanceName RC1 #Instance "RC1"としてRC起動

def checkLog(logPath):
	RealityCapture -getStatus RC1 > log.txt #Write log    #rcのlogを取得, txtに書き込む
	wait
	read log.txt
	if "error: cannot find a running RealityCapture instance":
		openRC()
	elif :
		get 'endEstimation:'   #rc処理の残り時間を取得
				
	return log, endEstimation

def switchFlag():
	rcAutoAlignmentFlag

def autoAlignment(rc.exe, alignSetting, imagePath, rcProjectPath):
	while:
		Stop_realtimeAlignmentFlag:
			Stop

		check imageFolder 
		count Images
			#画像フォルダー内の画像を数えて、もし自動alignの頻度以上あればalign実行
		if ( images - newImages ) > Align frequency: 
			realitycapture.exe -delegateTo RC1 -addFolder imagePath #新規画像をImport
			checkLog()
			wait  #数秒だけ
			realitycapture.exe -delegateTo RC1 -draft 	#-draft or -align
			checkLog()
			alignmentFlag #
			while alignmentFlag :
				if not endEstimation == 0.00 : #rc処理の残り時間が0だったら保存、次の画像追加ループへ
					wait
				if endEstimation == 0.00 :
					RealityCapture -delegateTo RC1 -save projectPath
					alignmentFlag Off #新規画像追加へ


高速化設定 (最近の思いつきなので未テスト)

realitycapture.exe -delegateTo RC1 -addFolder imagePath のあとに

	realitycapture.exe -delegateTo RC1 -selectAllImages 
	realitycapture.exe -delegateTo RC1 -setFeatureSource 1#Use component features 既存componentにある特徴だけを使う

動作:
https://studio.youtube.com/video/ObL1Gdi2uig/editwww.youtube.com



ブログの下書きが溜まりすぎてどれも完成していない....