RobinMagnet / pyFM

Python implementation of Functional Maps
MIT License
95 stars 20 forks source link

Dimension of p2p #1

Closed ihmc3jn09hk closed 3 years ago

ihmc3jn09hk commented 3 years ago

Hi Robin, thank you for sharing the work. From the main-page, there suggests

mesh1 = TriMesh('data/cat-00.off')
mesh2 = TriMesh('data/lion-00.off')
...
model.fit(descr_mu=descr_mu, lap_mu=lap_mu, descr_comm_mu=descr_comm_mu, verbose=True)

# One can access the functional map FM and vertex to vertex mapping p2p
FM = model.FM
p2p = model.p2p
...

print (p2p.shape)  # shows (5000,) not (7207,) or (7207, 5000)

I am wondering what the p2p is acting on ? Is it a correspondence 'matrix' from mesh1->mesh2 ? Since mesh1 has 7202 vertices, I know there will be some surjective map from mesh1->mesh2. However, when checking the dimension of the returned p2p, the dimension is neither (7207,) or (7207, 5000). How should I get the correspondence correctly?

ihmc3jn09hk commented 3 years ago

Hi Robin, thank you for sharing the work. From the main-page, there suggests

mesh1 = TriMesh('data/cat-00.off')
mesh2 = TriMesh('data/lion-00.off')
...
model.fit(descr_mu=descr_mu, lap_mu=lap_mu, descr_comm_mu=descr_comm_mu, verbose=True)

# One can access the functional map FM and vertex to vertex mapping p2p
FM = model.FM
p2p = model.p2p
...

print (p2p.shape)  # shows (5000,) not (7207,) or (7207, 5000)

I am wondering what the p2p is acting on ? Is it a correspondence 'matrix' from mesh1->mesh2 ? Since mesh1 has 7202 vertices, I know there will be some surjective map from mesh1->mesh2. However, when checking the dimension of the returned p2p, the dimension is neither (7207,) or (7207, 5000). How should I get the correspondence correctly?

I think I found the mistake. I have miss interpreted the p2p as mesh1->mesh2. It actually is mesh2->mesh1.

RobinMagnet commented 3 years ago

Hi,

Yes the p2p map is going to the direction opposite to the functional map.

This is actually the case in the whole code for clarity, but I should mention it somewhere in the main page.