Versions:
	CPU version:
		For users who do not own a Nvidia GPU which supports CUDA, cuDNN, and TensorRT.

	GPU version:
		For users who own a Nvidia GPU and have CUDA, cuDNN, and TensorRT installed.


System Requirements:
	Minimum:
		OS: Windows 10
		CPU: ?
		Memory: 8GB
		Storage: 4GB free space
		Camera: 2 webcams

	Recommended:
		OS: Windows 10
		CPU: 4.5GHz quad-core processor
		Memory: 16GB
		Storage: 4GB free space
		Camera: 2 webcams
		GPU: Geforce GTX 1080 Ti


How to install:
	
	If you cannot download large files from BOOTH, try these links.
		[CPU version]
			Part2:  https://d3ohm2q3tvfr8c.cloudfront.net/Part2_MocapForAll_CPU_Full_v1.0.1.zip
			Part3:  https://d3ohm2q3tvfr8c.cloudfront.net/Part3_MocapForAll_CPU_Full_v1.0.1.zip
		[GPU version]
			Part2:  https://d3ohm2q3tvfr8c.cloudfront.net/Part2_MocapForAll_GPU_Full_v1.0.1.zip
			Part3:  https://d3ohm2q3tvfr8c.cloudfront.net/Part3_MocapForAll_GPU_Full_v1.0.1.zip

	If you need older versions, use these links.
		v1.0
		[Readme]
			        https://d3ohm2q3tvfr8c.cloudfront.net/readme_full.zip
		[CPU version]
			Part2:  https://d3ohm2q3tvfr8c.cloudfront.net/Part2_MocapForAll_CPU_Full_v1.0.zip
			Part3:  https://d3ohm2q3tvfr8c.cloudfront.net/Part3_MocapForAll_CPU_Full_v1.0.zip
		[GPU version]
			Part2:  https://d3ohm2q3tvfr8c.cloudfront.net/Part2_MocapForAll_GPU_Full_v1.0.zip
			Part3:  https://d3ohm2q3tvfr8c.cloudfront.net/Part3_MocapForAll_GPU_Full_v1.0.zip


	CPU version
		1. Download "Readme.zip", "Part1_MocapForAll_CPU_Full_v1.0.1.zip", "Part2_MocapForAll_CPU_Full_v1.0.1.zip" and "Part3_MocapForAll_CPU_Full_v1.0.1.zip".
		2. Extract "Unzip_CPU_Full_v1.0.1.cmd" from Readme.zip, place it in the same folder with "Part1", "Part2" and "Part3" zips, and execute the cmd file by double clicking it.
			(Or, you can do it manually by unzipping the zip files and overwriting the extracted "MocapForAll_CPU_Full_v1.0.1" folder from one to the other.)
		3. Execute MocapForAll.exe in the "MocapForAll_CPU_Full_v1.0.1" folder.
		4. If the "UE4 Prerequisites" installation screen is displayed, install it.

	GPU version
		1. Download "Readme.zip", "Part1_MocapForAll_GPU_Full_v1.0.1.zip", "Part2_MocapForAll_GPU_Full_v1.0.1.zip" and "Part3_MocapForAll_GPU_Full_v1.0.1.zip".
		2. Execute "Unzip_GPU_Full_v1.0.1.cmd" from Readme.zip, place it in the same folder with "Part1", "Part2" and "Part3" zips, and execute the cmd file by double clicking it.
			(Or, you can do it manually by unzipping the zip files and overwriting the extracted "MocapForAll_GPU_Full_v1.0.1" folder from one to the other.)
		
		3. Install "CUDA 11.0.3" from "https://developer.nvidia.com/cuda-11.0-update1-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exenetwork"
			Please note that the installer may fail to install the NVIDIA driver. In that case, please install the latest NVIDIA driver manually.
		4. Download and unzip "cuDNN v8.0.2 (July 24th, 2020), for CUDA 11.0" from "https://developer.nvidia.com/rdp/cudnn-archive".
			Overwrite "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin"     by unzipped "cudnn-11.0-windows-x64-v8.0.2.39\cuda\bin".
			Overwrite "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include" by unzipped "cudnn-11.0-windows-x64-v8.0.2.39\cuda\include".
			Overwrite "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\lib"     by unzipped "cudnn-11.0-windows-x64-v8.0.2.39\cuda\lib".
			Add an environment variable "CUDNN_PATH", and set its value to "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0".
		5. Download and unzip "TensorRT 7.1.3.4" from "https://developer.nvidia.com/nvidia-tensorrt-7x-download".
			Add the path of lib folder in that to the environment variable "PATH", for example "C:\Program Files\NVIDIA GPU Computing Toolkit\TensorRT-7.1.3.4\lib"
		6. Add an environment variable "ORT_TENSORRT_ENGINE_CACHE_ENABLE" and set its value to "1".
		7. Add an environment variable "ORT_TENSORRT_CACHE_PATH" and set its value to any path where you want to save the cache files, for example "C:\temp".
			(For other options of TensorRT, see https://www.onnxruntime.ai/docs/reference/execution-providers/TensorRT-ExecutionProvider.html#configuration-options)
			
			(Your environment variables will be something like "EnvironmentVariables.png" and "EnvironmentVariables2.png".)
			(Your environment variable "Path" will be something like "Path.png".)

		8. Execute MocapForAll.exe in the "MocapForAll_GPU_Full_v1.0.1" folder.
		9. If the "UE4 Prerequisites" installation screen is displayed, install it.
		
	To use with SteamVR:
		1. Install "Virtual Motion Tracker" from "https://gpsnmeajp.github.io/VirtualMotionTrackerDocument/download/".
			We tested with vmt_012.
			vmt_010 and before are not supported.
			Note that you need to setup "Room matrix" in vmt_manager.exe. See "https://gpsnmeajp.github.io/VirtualMotionTrackerDocument/setup/" for the details.

		***********************
		*****  IMPORTANT  *****
		***********************
		Please note that Virtual Motion Tracker is a separated program from MocapForAll, and is designed for developers who know how to use it.
		DO NOT contact the author of Virtual Motion Tracker for any issues you encountered when using MocapForAll and Virtual Motion Tracker together.


How to use the app:

	0. Move viewport
		Use WASD key and mouse drag to move the viewport.
		(Finding a character can be a little difficult at first...)
		Screen maximization can be turned on and off with F11 key.

	1. Camera calibration
		(See "How_to_calibrate_cameras.mp4" for demonstration.)
		
		1.1. Open camera
			1.1.1. Connect at least two cameras to your PC.
				   You can use applications such as "DroidCam (https://www.dev47apps.com/)" or "Iriun (https://iriun.com/)" that allow you to use smartphones as webcams for PCs.
			1.1.2. Click "Add camera" button.
			1.1.3. Select "Camera" and search for the cameras you connected.
			1.1.4. You can change the image size of the camera by entering the dimensions and clicking "Apply" if camera supports the specified image size.
				   Somtimes it fails to change the image size. In that case, please close camera, wait for a moment, and try again.
		1.2. Intrinsic calibration (Repeat this for all cameras you use)
			1.2.1. Open "IntrinsicCalibration.png" in your favorite app and display the image on the screen in the maximum size. (Alternatively, you may print it on a paper.)
			1.2.2. Click "Start" button under "Calibration > Intrinsic".
			1.2.3. Capture "IntrinsicCalibration.png" image with the camera from various angles for around 10 seconds. When calibration is completed, intrinsic parameters will be displayed on the app's screen.
		1.3. Extrinsic calibration
			1.3.1. Print "ExtrinsicCalibration.png" on a large peice of paper. (A3 or larger is recommended.)
			1.3.2. Place the printed "ExtrinsicCalibration.png" on the floor. This will be the origin of the captured motion.
			1.3.3. Place your cameras where they can see the printed "ExtrinsicCalibration.png" paper.
			1.3.4. Click "Start" button under "Calibration > Extrinsic". When calibration is completed, extrinsic parameters will be displayed.
				   After this step, don't move calibrated cameras and "ExtrinsicCalibration.png" paper. If you move them, you need to redo extrinsic calibration.
				   After finishing calibrations for all cameras, you may remove "ExtrinsicCalibration.png" paper from the floor.
		You can save and load the calibration results by clicking "Save" and "Load" buttons.
		
	2. Start capture
		Click "Start capture" to start motion capture.
		If the captured motion looks wrong, see "3. Motion" of Troubleshooting section.
	
	3. Data export
		You can send tracking positions to other apps via Open Sound Control protocol.
		The message format of "Virtual motion tracker" created by gpsnmeajp is used.
		See "https://gpsnmeajp.github.io/VirtualMotionTrackerDocument/api/" for the details of the definition.
		MocapForAll sends "/VMT/Room/Unity index, enable, timeoffset, x, y, z, qx, qy, qz, qw" 
		or "/VMT/Follow/Unity index, enable, timeoffset, x, y, z, qx, qy, qz, qw, serial" format depending on the option settings.
		
		To send data to other apps, you need to turn on "Settings > Data export > Send bones" or "Settings > Data export > Send tracking points".
		For the details of the data export options, see "4.4. Data export".

		To use with Unreal Engine 4 or Unity, check our "MocapForAll Receiver Plugins" at "https://akiya-souken.booth.pm/items/3026430".

		To use with SteamVR, install "Virtual Motion Tracker" from "https://gpsnmeajp.github.io/VirtualMotionTrackerDocument/download/".
		Always face the orientation in "orientation.png" when you reorient the HMD's tracking space.
		To use with VRChat,
			turn on "Settings > Data export > Send tracking points",
			turn on "Settings > Data export > Send tracking points > As relative position to HMD".
		Also, see "Quick_Start_For_VRChat.mp4".
		
	4. Settings
		4.1. General
			4.1.1. Run DNN on ...
				You can use CPU or GPU for calculation. In general, using a GPU (TensorRT) will improve performance.
			4.1.2. Priority on ...
				You can choose Precision-oriented mode (more CPU / GPU usage) or Speed-oriented mode (less CPU / GPU usage). It is recommended to use GPU for Precision-oriented mode.
			4.1.3. Capture hand
				Check "Capture hand" to capture the movements of your fingers.
				Note that this is an experimental feature. The accuracy is low and CPU / GPU usage is high.
			4.1.4. Capture face
				Check "Capture face" to capture facial expressions. It is recommended not to wear glasses for accurate capture.
				Check "Preview" to show the tracking points of your face in separated windows.
				Note that this is an experimental feature. The accuracy is low and CPU / GPU usage is high.
			4.1.5. Character
				"Empty": No character drawn. This is recommended to use to achieve the best performance.
				"MetaHuman F_Tal_Unw": Simple character which has Epic games' MetaHuman bone.
				"MetaHuman Sample": A character created by Epic games' MetaHuman Creator.
				"VRM runtime load": Automatically selected when using VRM model. To use your VRM model, simply drag and drop the VRM file into the app's window. (This is an experimental feature. There is no warranty that all VRM files work properly.)
			4.1.6. Draw tracking points
				Check this to show the tracking points of your body as yellowish cubes.
			4.1.7. Map
				"Minimum": Floor and poor lighting only. This is recommended to use to achieve the best performance.
				"HDRI------": Some HDRI textures from HDRI Haven (https://hdrihaven.com) are used.
				"Chroma_key": For chroma key compositing.
				
		4.2. Performance
			4.2.1. Show frame rate
				Check "Show frame rate" to show the current frame rate and some stats.
			4.2.2. Limit frame rate to...
				You can set the upper limit of the frame rate. The lower the value, the less CPU / GPU used.
			4.2.3. Set screen percentage to...
				You can specify the internal resolution of the app. The smaller the value, the less CPU / GPU used.
				
		4.3. Coordinates
			4.3.1. Scales
				Change the values under "Scales" to adjust the scales of the captured motion. These values depend on the paper size used in "1.3. Extrinsic calibration".
			4.3.2. Origin position
				Change the values under "Origin position" to adjust the origin of the captured motion. (Z-Up)
			4.3.3. Coord. rotation
				Change the values under "Coord. rotation" to adjust the rotation of the captured motion.
				
		4.4. Data export
			4.4.1. IP address
				If you send data to the app running on the same PC, set this value to "127.0.0.1".
				If you send data to the app running on other PC, set this value to the IP adress of that PC.
			4.4.2. Send bones
				Check this to send bone transforms which is acting in this app. (This does not work with runtime-loaded VRM models.)
				This is used for replicating the exact result of animation of this app to another app.
			4.4.3. Send tracking points
				Check this to send tracking points of your body.
				This is used when you just need raw value of positions and rotations of "trackers", without animation retargetting done by this app.
				(For example, turn this on to use with VRChat.)

				4.4.3.1. As relative position to HMD
					Check this to send tracker positions as relative positions to the head.
					When used with SteamVR and "Virtual Motion Tracker", it is recommended to check this to make the latency of the virtual trackers less noticeable.
				4.4.3.2. Tracking points to be sent
					You can select which joint of your body to be sent, and specify the index of the virtual tracker.
					For the spine and feet, you can adjust the position and rotation offsets of the virtual trackers.
		
		4.5. Animation Post Process
			4.5.1. Force feet grounded
				When checked, inverse kinematics are used to control the positions of the feet so that they do not float in the air or sink into the floor.
			4.5.2. Smoothing on body, finger, and facial expression
				You can turn on/off the smoothing of the captured motion, and specify the smoothing intensity.
				To make motions smoother, decrease the values. For quick motions, increase the values.
				(See https://cristal.univ-lille.fr/~casiez/1euro/ for more information of the parameters)
		
		4.6. Advanced
			4.6.1. Cropping size for hand / face
				You can adjust the crop size of the image used to capture your hands and face.
			4.6.2. Specify facial morph target names
				You can specify the names of facial morph targets.
				This only works when using VRM models.
				To confirm the morph target names of your model, use VRM4U (https://github.com/ruyo/VRM4U) to import your model to UE4 editor and check the skeletal mesh asset.
				(More advanced usage: you can turn off specific morph by specifying invalid names here.)

Troubleshooting:
	1. Crash
		1.1. App crashes at startup
			- If you are using GPU version, check the installation of CUDA, cuDNN, and TensorRT.
			- Check the "MocapForAll_CPU_Full_v1.0.1\MocapForAll" folder (or equivalent one for GPU version). It should look like "MocapForAllInstallation.png".
			  If yours is different from this, redo MocapForAll installation procedure 1 and 2.
			- Try resetting the saved settings. Delete "C:\Users\<username>\AppData\Local\MocapForAll\Saved\SaveGames" folder and restart MocapForAll.
			- The downloaded files may be corrupted. Please download them again.
		
		1.2. App crashes when opening cameras
			We are very sorry that this is a known issue: App sometimes crashes when opening cameras.
			Please restart app.
		
		1.3. App crashes when starting capture
			- If you are using GPU version and using GPU for calculation, CUDA, cuDNN, or TensorRT may not be installed properly.
			  Please confirm the installation.
			- If you are using GPU version and using GPU_TensorRT for calculation, your GPU may not support TensorRT.
			  Please use GPU_CUDA or CPU for calculation.
		
		1.4. App crashes when changing the charcter
			We are very sorry that this is a known issue: App sometimes crashes when changing the charcter.
			Please restart app.
		
		1.5. App crashes when extrinsic calibratin is wrong and "Capture hand" is on.
			We are very sorry that this is a known issue.
			Please restart app.
		
		1.6. App crashes when using VRM models.
			We are very sorry that this is a known issue: App sometimes crashes when using VRM models.
			Please restart app.
			
	2. Calibration
		2.1. I am not sure camera intrinsic parameter is properly calibrated.
			Intrinsic parameter:
				fx  0 px
				0  fy py
				0   0  0
			In general, there is often no significant difference between the values ​​of fx and fy.
			The px and py values ​​are close to about half the width and height of the camera image.
			The parameter fx and fy represents focal length of the camera lens. px and py represents the position of center of the lens.

		2.2. I am not sure camera extrinsic parameter is properly calibrated.
			If calibration finishes within few frames after pressing "Start" button, it is likely to be OK.
			If calibration does not finish for more than seconds after pressing "Start" button, it is not likely to be OK. Please adjust the positions of "ExtrinsicCalibration.png" paper and cameras, or use a larger paper.
	
	3. Motion
		3.1. The captured motion is totally wrong.
			Redo the camera calibration.
			Please note that if you rotate camera by software (changing Landscape or Portrait) or change the resolution, you need to calibrate again.
		
		3.2. The character is floating in the air.
			Decrease the value at "Settings > Coordinates > Scale > Lower body".
			
		3.3. The character is always crunching.
			Increase the value at "Settings > Coordinates > Scale > Lower body".
		
		3.4. The character's shoulder is always facing up / down.
			Adjust the value at "Settings > Coordinates > Scale > Upper body".
		
		3.5. Legs tremble when crunching.
			Try turn off "Settings > Animation Post Process > Force feet grounded".
		
	4. Performance
		4.1. My PC cannot handle this app. / I want to reduce resource consumption to use with other apps.
			Select "Speed+" mode in "Settings > General > Priority on".
			Turn off "Settings > General > Capture hand".
			Turn off "Settings > General > Capture face".
			Select "Empty" character in "Settings > General > Character".
			Select "Minimum" map in "Settings > General > Map".
			Set small value (30% for example) and turn on "Settings > Performance > Set screen percentage to"
			Minimizing the camera preview also improves the performance.
	
	5. Export data
		5.1. No data has been sent.
			Check the firewall settings and make sure that communication is possible with the specified port number.


________________________________________________________________________________________________________

CPU版:
	CUDA、cuDNN、TensorRT をサポートする Nvidia GPU を所有していないユーザー向け。

GPU版:
	Nvidia GPU を所有し、CUDA、cuDNN、および TensorRT がインストールされているユーザー向け。

動作環境:
	最低：
		OS: Windows 10
		CPU: ？
		メモリ: 8GB
		ストレージ: 4GBの空き容量
		カメラ: ウェブカメラ2個
		
	推奨：
		OS: Windows 10
		CPU: 4.5GHz クアッドコアプロセッサ
		メモリ: 16GB
		ストレージ: 4GBの空き容量
		カメラ: ウェブカメラ2個
		GPU: Geforce GTX 1080 Ti

インストール手順:

	もしBoothからのダウンロードがうまくいかない場合は、こちらのリンクをお試しください。
		[CPU version]
			Part2:  https://d3ohm2q3tvfr8c.cloudfront.net/Part2_MocapForAll_CPU_Full_v1.0.1.zip
			Part3:  https://d3ohm2q3tvfr8c.cloudfront.net/Part3_MocapForAll_CPU_Full_v1.0.1.zip
		[GPU version]
			Part2:  https://d3ohm2q3tvfr8c.cloudfront.net/Part2_MocapForAll_GPU_Full_v1.0.1.zip
			Part3:  https://d3ohm2q3tvfr8c.cloudfront.net/Part3_MocapForAll_GPU_Full_v1.0.1.zip

	また、古いバージョンが必要な場合は、こちらからダウンロードしてください。
		v1.0
		[Readme]
			        https://d3ohm2q3tvfr8c.cloudfront.net/readme_full.zip
		[CPU version]
			Part2:  https://d3ohm2q3tvfr8c.cloudfront.net/Part2_MocapForAll_CPU_Full_v1.0.zip
			Part3:  https://d3ohm2q3tvfr8c.cloudfront.net/Part3_MocapForAll_CPU_Full_v1.0.zip
		[GPU version]
			Part2:  https://d3ohm2q3tvfr8c.cloudfront.net/Part2_MocapForAll_GPU_Full_v1.0.zip
			Part3:  https://d3ohm2q3tvfr8c.cloudfront.net/Part3_MocapForAll_GPU_Full_v1.0.zip
			
	CPU版
		1.「Readme.zip」と「Part1_MocapForAll_CPU_Full_v1.0.1.zip」と「Part2_MocapForAll_CPU_Full_v1.0.1.zip」と「Part3_MocapForAll_CPU_Full_v1.0.1.zip」をダウンロードしてください。
		2.「Readme.zip」を展開して中に入っている「Unzip_CPU_Full_v1.0.1.cmd」を「Part1」「Part2」「Part3」と同じフォルダに配置し、cmdファイルをダブルクリックして実行してください。
			（または、Part1,2,3のZipファイルを展開し、展開したできた「MocapForAll_CPU_Full_v1.0.1」フォルダを一方から他方へ上書きする、という作業を手動で実施してもOKです）
		3.「MocapForAll_CPU_Full_v1.0.1」フォルダに入っているMocapForAll.exeを実行してください。
		4.「UE4 Prerequisites」のインストール画面が表示された場合は、インストールを実行してください。

	GPU版
		1.「Readme.zip」と「Part1_MocapForAll_GPU_Full_v1.0.1.zip」と「Part2_MocapForAll_GPU_Full_v1.0.1.zip」と「Part2_MocapForAll_GPU_Full_v1.0.1.zip」をダウンロードしてください。
		2.「Readme.zip」を展開して中に入っている「Unzip_GPU_Full_v1.0.1.cmd」を「Part1」「Part2」「Part3」と同じフォルダに配置し、cmdファイルをダブルクリックして実行してください。
			（または、Part1,2,3のZipファイルを展開し、展開したできた「MocapForAll_GPU_Full_v1.0.1」フォルダを一方から他方へ上書きする、という作業を手動で実施してもOKです）

		3. 「CUDA11.0.3」を「https://developer.nvidia.com/cuda-11.0-update1-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exenetwork」からインストールします。
			インストーラーがNVIDIAドライバーのインストールに失敗する場合があることに注意してください。その場合は、最新のNVIDIAドライバーを手動でインストールしてください。
		4. 「cuDNN v8.0.2 (July 24th, 2020), for CUDA 11.0」を「https://developer.nvidia.com/rdp/cudnn-archive」からダウンロードして展開します。
			展開されてできた「cudnn-11.0-windows-x64-v8.0.2.39\cuda\bin」で    「C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin」を上書きします。
			展開されてできた「cudnn-11.0-windows-x64-v8.0.2.39\cuda\include」で「C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include」を上書きします。
			展開されてできた「cudnn-11.0-windows-x64-v8.0.2.39\cuda\lib」で    「C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\lib」を上書きします。
			環境変数「CUDNN_PATH」を追加し、その値を「C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0」に設定します。
		5. 「TensorRT7.1.3.4」を「https://developer.nvidia.com/nvidia-tensorrt-7x-download」からダウンロードして解凍します。
			上記Zipを展開したフォルダの中のlibフォルダを環境変数「PATH」に追加します（例：「C:\Program Files\NVIDIA GPU Computing Toolkit\TensorRT-7.1.3.4\lib」）。
		6. 環境変数「ORT_TENSORRT_ENGINE_CACHE_ENABLE」を追加し、その値を「1」に設定します。
		7. 環境変数「ORT_TENSORRT_CACHE_PATH」を追加し、その値をキャッシュファイルを保存する任意のパス（「C:\temp」など）に設定します。
			（TensorRTのその他のオプションについては、「https://www.onnxruntime.ai/docs/reference/execution-providers/TensorRT-ExecutionProvider.html#configuration-options」を参照してください）

			（環境変数は「EnvironmentVariables.png」や「EnvironmentVariables2.png」のようになります。）
			（環境変数「Path」は「Path.png」のようになります。）

		8.「MocapForAll_GPU_Full_v1.0.1」フォルダに入っているMocapForAll.exeを実行してください。
		9.「UE4 Prerequisites」のインストール画面が表示された場合は、インストールを実行してください。
		
	SteamVRで利用するには:
		1. "Virtual Motion Tracker" を "https://gpsnmeajp.github.io/VirtualMotionTrackerDocument/download/" からダウンロードしインストールしてください。
			vmt_012でテスト済みです。
			vmt_010以前はサポートされていません。
			vmt_manager.exeで"Room matrix"の設定を行う必要があることに注意してください。詳細は"https://gpsnmeajp.github.io/VirtualMotionTrackerDocument/setup/"をご覧ください。

		**********************
		*****    重要    *****
		**********************
		Virtual Motion Tracker は MocapForAll とは別のプログラムであり、使い方がわかる開発者向けに作成されていることに注意してください。
		MocapForAllとVirtual Motion Trackerを一緒に利用して発生したいかなる問題についても、Virtual Motion Tracker の作成者様に問い合わせしないでください。


アプリの使い方：

	0. ビューポートの移動
		WASDキーとマウスのドラッグでビューポートを移動します。
		（最初はキャラクターを探すのが少し大変かも…）
		画面の最大化は、F11キーでオンオフできます。

	1. カメラキャリブレーション
		("How_to_calibrate_cameras.mp4"にデモ動画があります)
	
		1.1. カメラを開く
			1.1.1 少なくとも2台のカメラをPCに接続します。
				   「DroidCam（https://www.dev47apps.com/）」や「Iriun（https://iriun.com/）」など、スマートフォンをPCのWebカメラとして利用できるアプリも利用可能です。
			1.1.2. 「Add camera」ボタンをクリックします。
			1.1.3. 「Camera」をプルダウンボックスから選択し、接続したカメラを探します。
			1.1.4. サイズを入力し「Apply」をクリックすると、カメラが指定された画像サイズをサポートしていれば、カメラの画像サイズを変更できます。
				   カメラの画像サイズの変更に失敗することがありますが、その場合はカメラを閉じてから少し待って、再度お試しください。
		1.2. カメラ内部パラメータのキャリブレーション（使用するすべてのカメラに対してこれを実行してください）
			1.2.1. 好きなアプリで「IntrinsicCalibration.png」を開き、画像を最大サイズで画面に表示します。 （または、紙に印刷してもOKです）
			1.2.2. 「Calibration > Intrinsic」の下の「Start」ボタンをクリックします。
			1.2.3. 10秒間程度、さまざまな角度からカメラで画像を写してください。キャリブレーションが完了すると、アプリの画面上にパラメータが表示されます。
		1.3. カメラ外部パラメータのキャリブレーション
			1.3.1. 大きな紙に「ExtrinsicCalibration.png」を印刷します。（A3以上が推奨です）
			1.3.2. 印刷した「ExtrinsicCalibration.png」を床に置きます。これがモーションキャプチャの原点になります。
			1.3.3. 床に置いた「ExtrinsicCalibration.png」の紙が見える場所にカメラを設置します。
			1.3.4. 「Calibration > Extrinsic」の下の「Start」ボタンをクリックします。キャリブレーションが完了すると、外部パラメータが表示されます。
				この手順後、全カメラのキャリブレーションが完了するまでは、キャリブレーションされたカメラと「ExtrinsicCalibration.png」用紙をを動かさないでください。これらを動かした場合は、外部パラメータのキャリブレーションをやり直す必要があります。
				すべてのカメラのキャリブレーションが終了したら、「ExtrinsicCalibration.png」用紙を床から取り除いてOKです。
		
		「Save」「Load」ボタンをクリックすると、キャリブレーション結果を保存およびロードできます。
		
	2. キャプチャー開始
		「Start Capture」をクリックしてモーションキャプチャーを開始します。
		キャラクターに正しくモーションが反映されない場合は、Troubleshooting の「3. Motion」をご確認ください。
	
	3. データのエクスポート
		Open Sound Controlプロトコルを介して、キャプチャ結果を他のアプリに送信できます。
		gpsnmeajp様が作成した「バーチャルモーショントラッカー」のフォーマットを使用しています。
		定義の詳細は「https://gpsnmeajp.github.io/VirtualMotionTrackerDocument/api/」を参照してください。
		MocapForAllはオプション設定に応じて「/VMT/Room/Unity index, enable, timeoffset, x, y, z, qx, qy, qz, qw」または「/VMT/Follow/Unity index, enable, timeoffset, x, y, z, qx, qy, qz, qw, serial」の形式でデータを送信します。
		
		他のアプリにデータを送信するには、「Settings > Data export > Send bones」または「Settings > Data export > Send tracking points」をオンにする必要があります。
		データ出力オプションの詳細については、「4.4. データ出力」を参照してください。

		Unreal Engine 4やUnityでのデータ受信の例は、「MocapForAll Receiver Plugins」（https://akiya-souken.booth.pm/items/3026430）を参照してください。
		
		SteamVRで利用するには、「https://gpsnmeajp.github.io/VirtualMotionTrackerDocument/download/」から「Virtual Motion Tracker」をインストールしてください。
		また、トラッキング環境の向きを「orientation.png」の向きに合わせてください。
		VRChat等での利用には、
			「Settings > Data export > Send tracking points」と
			「Settings > Data export > Send tracking points > As relative position to HMD」をオンにしてください。
		「Quick_Start_For_VRChat.mp4」も参考にしてください。
	
	4. 設定
		4.1. General
			4.1.1. Run DNN on ...
				演算にはCPUまたはGPUを使用できます。一般に、GPU (TensorRT) を使用するとパフォーマンスが向上します。
			4.1.2. Priority on ...
				精度重視モード (CPU/GPU 使用率が高い) または速度重視モード (CPU/GPU 使用率が低い) を選択できます。精度指向モードには GPU を使用することをお勧めします。
			4.1.3. Capture hand
				指の動きをキャプチャするには、これをチェックします。
				これは実験的機能であることに注意してください。正確性に欠け、CPU/GPU使用率は高くなります。
			4.1.4. Capture face
				顔の表情をキャプチャするには、これをチェックします。正確なキャプチャのためには、メガネを着用しないことをお勧めします。
				「Preview」にチェックを入れると、顔のトラッキングの状況が別ウィンドウで表示されます。
				これは実験的機能であることに注意してください。正確性に欠け、CPU/GPU使用率は高くなります。
			4.1.5. Character
				「Empty」：キャラクターを描画しません。パフォーマンス最適化のために使用することをお勧めします。
				「MetaHuman F_Tal_Unw」: Epic Games の MetaHuman ボーンを持つシンプルなキャラクター。
				「MetaHuman Sample」: Epic Games の MetaHuman Creator によって作成されたキャラクター。
				「VRM runtime load」：VRMモデル使用時に自動で選択されます。 VRMモデルを使用するには、VRMファイルをアプリのウィンドウにドラッグ&ドロップしてください。（実験的機能です。全てのVRMファイルに対応することを保証するものではありません）
			4.1.6. Draw tracking points
				これをチェックすると、体のトラッキングの座標が黄色い立方体で表示されます。
			4.1.7. Map
				「Minimum」: 床と低精度の照明のみ。パフォーマンス最適化のために使用することをお勧めします。
				「HDRI------」: HDRI Haven (https://hdrihaven.com) の HDRI テクスチャを使用したマップです。
				「Chroma_key」：クロマキー合成用。
				
		4.2. Performance
			4.2.1. Show frame rate
				オンにすると、現在のフレームレートといくつかの統計情報が表示されます。
			4.2.2. Limit frame rate to...
				フレームレートの上限を設定します。値が小さいほど、CPU / GPU の使用が少なくなります。
			4.2.3. Set screen percentage to...
				アプリの内部解像度を指定できます。値が小さいほど、CPU / GPU の使用が少なくなります。
				
		4.3. Coordinates
			4.3.1. Scales
				キャプチャしたモーションのスケールを調整します。これらの値は、「1.3. 外部キャリブレーション」で使用する用紙サイズに依存します。
			4.3.2. Origin position
				キャプチャしたモーションの原点を調整します。(Zが上向きです)
			4.3.3. Coord. rotation
				キャプチャしたモーションの向きを調整します。
				
		4.4. Data export
			4.4.1. IP address
				同一PC上で動作するアプリにデータを送信する場合は、「127.0.0.1」に設定してください。
				他のPCで動作しているアプリにデータを送信する場合は、そのPCのIPアドレスを設定します。
			4.4.2. Send bones
				このアプリで表示している MetaHuman のボーンのトランスフォームを送信します。（VRMモデルを使っている場合は機能しません）
				このアプリでのアニメーションの結果をそのまま別のアプリにコピーするために使用します。
			4.4.3. Send tracking points
				これをチェックすると、体のトラッキング位置が送信されます。
				このアプリでアニメーションのリターゲットを行わずに、「トラッカー」の位置と回転の生の値が必要な場合に使用します。

				4.4.3.1. As relative position to HMD
					トラッカーの位置を頭に対する相対位置として送信します。
					SteamVR および Virtual Motion Tracker と併用する場合は、これをチェックして仮想トラッカーのレイテンシーを目立たなくすることをお勧めします。
				4.4.3.2. Tracking points to be sent
					各トラッキング位置のどれを送信するか、および、仮想トラッカーの番号を指定できます。
					腰と足については、仮想トラッカーの位置と回転のオフセットを調節できます。
		
		4.5. Animation Post Process
			4.5.1. Force feet grounded
				IK（逆運動学）を使用して足の位置を制御し、足が宙に浮いたり床に沈んだりしないようにします。
			4.5.2. Smoothing on body, finger, facial expression
				キャプチャしたモーションのスムージングのオン/オフと、スムージングの強度を指定できます。
				モーションを滑らかにするには、小さな値を指定します。素早い動きの場合は、値を大きくしてください。
				(パラメーターの詳細については、https://cristal.univ-lille.fr/~casiez/1euro/ を参照してください)
		
		4.6. Advanced
			4.6.1. Cropping size for hand / face
				手と顔のキャプチャに使用する画像のトリミング サイズを調整できます。
			4.6.2. Specify facial morph target names
				顔のモーフターゲットの名前を指定できます。
				これは、VRM モデルを使用している場合にのみ機能します。
				モデルのモーフターゲット名を確認するには、VRM4U (https://github.com/ruyo/VRM4U) を使用してモデルを UE4 エディターにインポートし、skeletal meshを確認してください。
				(裏技的な使い方: ここで無効な名前を指定することで、特定のモーフをオフにすることができます。)

トラブルシューティング:
	1. クラッシュ
		1.1. 起動時にアプリがクラッシュする
			- GPU版を使用している場合は、CUDA、cuDNN、TensorRT が正しくインストールされているか確認してください。
			- 「MocapForAll_CPU_Full_v1.0.1\MocapForAll」（あるいはGPU版の同等の）フォルダを確認してください。"MocapForAllInstallation.png"のようになっているのが正しい状態です。
			  お使いのものがこれと異なる場合は、MocapForAll のインストール手順1と2をやり直してください。
			- 設定情報を削除すると起動できるようになる場合があります。「C:\Users\<username>\AppData\Local\MocapForAll\Saved\SaveGames」フォルダを削除してみてください。
			- ダウンロードしたファイルが破損している可能性があります。再度ダウンロードをお試しください。

		1.2. カメラ開くときにアプリがクラッシュする
			申し訳ありません。これは既知の問題です。カメラを開くときにアプリがクラッシュすることがあります。
			アプリを再起動してください。

		1.3. キャプチャの開始時にアプリがクラッシュする
			- GPU版を使用していて、計算に GPU を使用している場合、CUDA、cuDNN、または TensorRT が正しくインストールされない可能性があります。
			  インストールを確認してください。
			- GPU版を使用していて、計算に GPU_TensorRT を使用している場合、GPU が TensorRT をサポートしていない可能性があります。
			  計算にGPU_CUDAまたはCPUを使用してみてください。
		
		1.4. キャラクタ変更するとアプリがクラッシュする
			申し訳ありません。これは既知の問題です。キャラクタを変更するとアプリがクラッシュすることがあります。
			アプリを再起動してください。
		
		1.5. カメラの外部パラメータが間違っていて、手のキャプチャがオンになっていると、アプリがクラッシュする。
			申し訳ありません。これは既知の問題です。
			アプリを再起動してください。

		1.6. VRMモデルを使っていると、アプリがクラッシュする。
			申し訳ありません。これは既知の問題です。VRMモデルを使っていると、まれにアプリがクラッシュすることがあります。
			アプリを再起動してください。
		
	2. 校正
		2.1.カメラの内部パラメーターが適切にキャリブレーションされているかどうかわかりません。
			内部パラメーターの定義:
				fx 0 px
				0 fy py
				0 0 0
			一般に、fx と fy の値に大きな違いはないことが多いです。
			px と py の値は、画像の幅と高さの約半分に近い値になります。
			パラメータ fx および fy は、カメラ レンズの焦点距離を表します。 px と py はレンズの光軸の位置を表します。

		2.2.カメラの外部パラメータが適切にキャリブレーションされているかどうかわかりません。
			「Start」ボタンを押してから数フレーム以内にキャリブレーションが終了すれば、おそらくOKです。
			外部キャリブレーションの「Start」ボタンを押した後、数秒以上キャリブレーションが終了しない場合は、うまくいかない可能性が高いです。
			「ExtrinsicCalibration.png」の用紙とカメラの位置を調整するか、より大きな用紙を使用してください。
	
	3. モーション
		3.1. キャプチャしたモーションが完全に間違っています。
			カメラキャリブレーションをやり直してください。
			ソフトウェアでカメラを回転させた場合 (Landscape と Portrait の変更等) や解像度を変更した場合は、再度キャリブレーションを行う必要があることに注意してください。
		
		3.2. キャラクターが宙に浮いています。
			「Settings > Coordinates > Scale > Lower body」で値を減らします。
			
		3.3. キャラクターが常にしゃがんでいます。
			「Settings > Coordinates > Scale > Lower body」で値を増やします。
		
		3.4. キャラクターの肩が常に上あるいは下を向いています。
			「Settings > Coordinates > Scale > Upper body」で値を調整します。
		
		3.5. しゃがむと足が震えます。
			「Settings > Animation Post Process > Force feet grounded」をオフにすると改善することがあります。
		
	4. パフォーマンス
		4.1. PCのスペックが足りません / 他のアプリと併用するためリソース消費を抑えたいです。
			「Settings > General > Priority on」で「Speed+」モードを試してください。
			「Settings > General > Capture hand」をオフにします。
			「Settings > General > Capture face」をオフにします。
			「Settings > General > Character」で「Empty」キャラクターを選択してください。
			「Settings > General > Map」で「Minimum」マップを選択してください。
			「Settings > Performance > Set screen percentage to」をオンにし、小さな値 (たとえば 30%) を設定します。
			カメラのプレビューを最小化すると、パフォーマンスが若干向上します。
	
	5. データのエクスポート
		5.1. データが送信されてきません。
			ファイアウォールの設定を確認し、指定しているポート番号で通信が可能であることを確認してください。

