본문 바로가기
Computer Vision

BVH File Format

by wisejlog 2022. 8. 12.

 

참고 페이지: 

https://research.cs.wisc.edu/graphics/Courses/cs-838-1999/Jeff/BVH.html

 

Biovision BVH

Biovision BVH The BVH file format was originally developed by Biovision, a motion capture services company, as a way to provide motion capture data to their customers. The name BVH stands for Biovision hierarchical data. This format mostly replaced an earl

research.cs.wisc.edu

https://gofo-coding.tistory.com/entry/Character-Animation

 

Character Animation, BVH Format

Cel Animation 과거 computer animation과 관련된 기술이 발전하기 전에는 손으로 한장한장 그려서 연결하였다. 이를 hand-drawn cel animation이라 한다. Computer Animation 현재는 labor-intensive animation..

blog.gofo.me

https://v22.wiki.optitrack.com/index.php?title=Data_Export:_BVH 

 

Data Export: BVH - NaturalPoint Product Documentation Ver 2.2

Main Page → Motive Documentation → Data Export → Data Export: BVH BVH File Format Motive can export tracking data in BioVision Hierarchy (BVH) file format. Exported BVH files do not include individual marker data. Instead, a selected skeleton is expo

v22.wiki.optitrack.com

https://www.cs.cityu.edu.hk/~howard/Teaching/CS4185-5185-2007-SemA/Group12/BVH.html

 

BVH motion capture data

BVH motion capture data Motion capture data is a two-dimensional representation of motion that takes place in a three-dimensional world. A popular way to store such data to represent human motion is the Biovision Hierarchy (BVH for short) file format. A BV

www.cs.cityu.edu.hk

 

 

BVH: Biovision File Format

 

간단하게 요약하면, Motion Capture Data를 전달하기 위한 파일 포맷

skeleton 정보와 motion 데이터로 이루어져있다.

bvh의 단점은 basis 포즈 자체가 parent node에 대한 각 children의 offset으로 이루어져있다는 것이다. (각각에 대한 rotation은 없다.) 

 

 

bvh file 들은 Right handes coordinate 기반임 

https://learn.microsoft.com/en-us/previous-versions/windows/desktop/bb324490%28v=vs.85%29

의 첫번째 그림 참조 

 

 

3-D Coordinate Systems

Table of contents 3-D Coordinate Systems Article 11/06/2009 2 minutes to read In this article --> Typically, 3-D graphics applications use two types of Cartesian coordinate systems: left-handed and right-handed. In both coordinate systems, the positive x-a

learn.microsoft.com

BVH File Structure

1) Hierarchy Section: (Header)

https://www.researchgate.net/publication/242308869_Motion_Capture_File_Formats_Explained

 

skeleton의 hierarchy와 initial pose information 

Initial Pose (T Pose) 상태를 기준으로 잡고, 각 joint들이 root(parent)로 부터 recursive 하게 child를 정의한다. offset 이라는 parent로 부터의 상대적인 위치로 이루어져있다.

그후에 channel header 정보가 주어지는데, CHANNELS 다음으로 채널의 수와 각 이름이 주어진다. 나중에 motion데이터를 각 채널에 할당하고 각 이름이 뭔지에 따라 다르게 적용하여 child 위치를 만든다. (채널이 주어지는 순서대로 motion에서 유지된다.)

channel 다음으로 joint나 end site 에 관련된 정보가 나오는데 joint root와 비슷한 정보들을 가지고 있어서 recursive 하게 child로 계속 정보를 전달한다고 보념되고 end site는 recursive의 마지막으로 children이 없다는 걸 나타낸다. 그래서 end site에서는 offset 처럼 parent로 부터 나온 하나의 끝점에 대한 표시를 해준다.

 

HIERARCHY
ROOT	Hips
{
	OFFSET	0.000	0.000	0.000
	CHANNELS	6	Xposition	Yposition	Zposition	Yrotation	Xrotation	Zrotation
	JOINT	LeftThigh
	{
		OFFSET	8.100	0.000	-0.000
		CHANNELS	3	Yrotation	Xrotation	Zrotation
		JOINT	LeftShin
		{
			OFFSET	0.000	-43.200	0.000
			CHANNELS	3	Yrotation	Xrotation	Zrotation
			JOINT	LeftFoot
			{
				OFFSET	0.000	-43.300	-0.063
				CHANNELS	3	Yrotation	Xrotation	Zrotation
				End Site
				{
					OFFSET	0.000	-13.169	6.239
				}
			}
		}
	}
	JOINT	RightThigh
	{
		OFFSET	-8.100	0.000	-0.000
		CHANNELS	3	Yrotation	Xrotation	Zrotation

- joint 에 대한 Tree 형태로 구성, offset + channel list (motion-transform list)

joint의 offset은 parent로 부터의 X, Y, Z offset ( 처음 위치 같은 건가 )

 

+ Offset:

컴퓨터 과학에서 배열이나 자료 구조 오브젝트 내의 오프셋은 일반적으로 동일 오브젝트 안에서 오브젝트 처음부터 주어진 요소나 지점까지의 변위차를 나타내는 정수형이다. [https://ko.wikipedia.org/wiki/%EC%98%A4%ED%94%84%EC%85%8B_(%EC%BB%B4%ED%93%A8%ED%84%B0_%EA%B3%BC%ED%95%99)]

Channels라고 나와있는 부분은 motion 파트에서 사용될 부분에 대한 정의라고 보면 될 듯 하다. 

End Site는 자식 node가 없는 leaf node라고 보면 된다.

 

 

2) Motion Section: motion data

hierarchy 가 끝나고 MOTION 이라는 줄부터 모션 데이터가 주어진다. Frame times 아래부터, 각 frame마다 각 channel 값들이 Skeleton 파트에서 설명했던 순서대로 주어진다. (rotation 의 단위는 degree) 라인당 하나의 시간.

 

 

 

어떻게 변환하는가?/사용하는가?

Position 을 구하기 위해서는 parent -> child (now)로 오는 local transformation matrix가 필요하다. 위에서 본 offset을 translation information 으로 그리고 rotation은 motion section 에서 얻어진 값을 사용한다. root 과 같은 경우 translation + offset + rotation 

 

생각해보면 모든 구조가 root 부터 퍼져나와서 해당 child에 전달되야 하므로 

M = translation matrix 

 

https://stackoverflow.com/questions/21503595/what-are-the-maths-behind-3d-billboard-sprites-was-3d-transformation-matrix-t

 

 

What are the maths behind 3D billboard sprites? (was: 3D transformation matrix to 2D matrix)

I have a 3D point in space. The point's exact orientation/position is expressed through a 4x4 transformation matrix. I want to draw a billboard (3D Sprite) to this point. I know the projected posi...

stackoverflow.com

$$ M_{child}@M_{parent}@M_{parent's parent) ....  $$ 

등 처럼 recursive 하게 이어진다. 

 

함수를 직접보면 이해하기 더 쉬운데 https://github.com/facebookresearch/fairmotion/blob/e400e564deac93bb74ffecd9c366d76b3406e217/fairmotion/core/motion.py#L223

 

GitHub - facebookresearch/fairmotion: Tools to load, process and visualize motion capture data

Tools to load, process and visualize motion capture data - GitHub - facebookresearch/fairmotion: Tools to load, process and visualize motion capture data

github.com

를 보면 된다. 

 

 

BVH in hand

이미지 참고

https://www.nature.com/articles/s41597-020-00635-7#Fig3

 

mano joint 위치 

더보기
https://wisejlog.tistory.com/

 

 

'Computer Vision' 카테고리의 다른 글

[Python] Triangle Mesh to Pointcloud  (0) 2023.09.09
OpenGL 공부  (0) 2022.12.27