Sunday, January 10, 2010

Measuring the difference between two meshes

Computing the geometric difference between two 3D models is a quite common task in mesh processing. In our lab, many years ago (11 !), we developed and freely distributed the standard tool for such task, Metro, whose paper has been cited more than 500 times . While Metro is still a small open source standalone command line program available at our web site, its functionality have been integrated into MeshLab in the filter Sampling->Hausdorff Distance, and they can be used in a variety of ways.
So here is a short basic tutorial.

Start with a mesh (in the following the well known Stanford Happy Buddha (1087716 triangles). Aggressively simplify it in a significant way to just 50k tris (e.g. 1/20 of the original size). Reload the original mesh as a new layer. At this point you should have two approximation of the same shape well aligned in the same space. Toggling the visibility on and off of each mesh you should easily see the difference between the two meshes (tip: ctrl+click over the eye icon in the layers window turn off all the other layers).

Now you are ready to start the Hausdorff distance filter.  First of all remember that the Hausdorff Distance between two meshes is a the maximum between the two so-called one-sided Hausdorff distances (technically not they are not a distance):
These two measures are not symmetric (e.g. the results depends on what mesh you set as X or Y).
In the Hausdorff filters MeshLab computes only the one-sided version
leaving the task of getting the maximum of the two to the user.

Now on the practical side. MeshLab uses a sampling approach to compute the above formula taking a bunch of points over a mesh X and searching for each x the closest point y on a mesh Y. That means that the result is strongly affected on how many points do you take over X and there are a lot of option on for that. A common very simple approach is just to use the vertexes of the highest density mesh as sampling points (e.g. the original Buddha vertexes): to do this simply leave checked only the "vertex sampling" option in the filter dialog and be sure that the number of samples is greater or equal than the vertex number. After a few secs the filter ends writing down in the layers log windows the collected info. Something like:

: Hausdorff Distance computed
: Sample 543652
: min : 0.000000 max 0.001862
: mean : 0.000029 RMS : 0.000083
: Values w.r.t. BBox Diag (0.229031)
: min : 0.000000 max 0.008128
: mean : 0.000126 RMS : 0.000361

For sake of human readability the filter reports the values in the mesh units (whatever they are) and with respect to the diagonal of the bounding box of the mesh that is something you are always able to understand without knowing anything about the model units. For example in this case you can see that the maximum error between the two mesh is approximately 1% of the bbox diag, but on the average the two meshes are almost in the 1/10000 range.


The filter save in the all-purpose quality field of the vertexes of the sampled mesh the computed distance values. To better visualize the error you can simply convert these values (for the high resolution mesh) into colors using the Color->Colorize by quality filter that maps them in to a rather red-green-blue colormap. Usually given the non uniform distribution of the values you have to play a bit with the filter parameters clamping the mapping range to something meaningful (only a few points have the maximum so with a linear mapping of the values over the whole range will result into a almost uniform red mesh. Note that it is a red-green-blu map, so red is min and blue is max, so in our case red means zero error (good) and blue high error (bad).
The next image sequence report just a small detail of the one of the points with higher error. During the simplification we removed some topological noise, (the thin tubes connecting the two side of the hole)  from a Hausdorff point of view it is a rather large error: the points in the middle of the thin tubes has nothing in the simplified mesh that is close to them; so they bring up the maximum error significantly. Luckily enough they represent only a small portion of the whole mesh so the average error remains low.


Note that if you measure the other one-sided Hausdorff distance, that specific mesh portion will not denote any particular error, because in that case you sample the simplified mesh and for each point of the simplified mesh there are points of the original mesh that are quite close to them. In other words, in this case the simplified mesh is close to the original one, but the original one is not close to the simplified one.

Next post will discuss some remaining issues including the sampling of the surface, looking at all the taken samples and the found closest points and how to colorize the low resolution mesh...
Second part of the tutorial here.

66 comments:

天天月月年年 said...

hi, this is useful. But I still do not know to to get a color map for the Hausdorf distances between two meshes. Can you give a list of operations like 1) File->open 2) File->open as a new layer 3)...

Thank you very much !!!

ALoopingIcon said...

In summary the operations are:

1) Load two meshes as layers
2) Sampling->Hausdorff Distance: checking only the "sample vertexes" option. You get the result in the log window
3) Color->Colorize by Quality, Adjust the range to get the interesting values well mapped in the red-green-blue colormap

Let me know for what part of the above you need more info.

Cheers
P.

Olivier said...

Hey there, great stuff this MeshLab! I just found out about it, it seems pretty nice. Any idea when the next post will be? Because I'd be quite interested to know how to colorise the low resolution mesh as well. Color->Colorize by Quality does not work in that case.

Esfahlan said...

Hi
Which one represent Hausdorff distance? max, min, RMS or mean?

ALoopingIcon said...

@Esfahlan

By definition, the Hausdorff distance is the one-sided max of the min distance. However in practice the mean or RMS measures are quite useful (much less sensible to outliers).

Cheers
P.

Stuart Dunning said...

Hi, very useful, but for me it is also the direction of difference, I have negative and positive distances (before and after image) - in some parts Mesh 1 protrudes beyond Mesh 2, and in others it is behind. Is there a way to get at that rather than pure 'distance'? I guess this might mean defining a direction?

Ke Jiang said...
This comment has been removed by the author.
Ke Jiang said...

Hi, I have two meshes that are not very similar to compare. They are reconstructed from the point cloud of a wooden boat. I try to see the difference of the boat over time, since wood is sensitive and would transform due to the environment... Anyway, I aligned and used the Hausdorff distance filter with my meshes, but the result seems not right. The filter report says no point is sampled from the mesh.

What should I do with this condition? Or is it because these two meshes are too different (seems not)?

Aurore said...

Hi!

How can I display a scale showing the differences between the distances?

Thanks in advance!

vaggos said...

Dear Aurore,
if you mean how to show up the color-map scale, you may go Edit -> Quality Mapper. There you can find a range of choices.

markus dreck said...

Since this description is a little outdated, i took the time to do a in detail procedure for computing the Housdorff Dist. in Meshlab V1.3.3

Since i am not an expert in MeshLab you are welcome to suggest better ways. It seems rather complicated to me!

1)load or generate the two meshes. (Let's say A and B, where B is the mesh you want colored).
2)right click on B in the Layer Dialog (Ctrl-L if invisible) and select "Define new Per Vertex Attribute"
choose a name (e.g "Quality") and choose "q" as the Function.
3)Make sure that B is selected in the Layer Dialog
3)Compute the Hausdorff Distance (Filters: Sampling->Hausdorff Distance) With Sampled Mesh = B and Target Mesh = A
4)repeat 3) and Click the colored Rabit (or Edit:QualityMapperDialog) and Click Apply
5)Make A invisible (click the eye in the Layer Dialog)

Cheerz M

MedZag said...

Hi,

Is there a way I can know the positive and negative mesh surface differencse rather than absolute differences?

Thank you in advance.
Dalia

Swapnil Mali said...

Can anyone provide command to compare two mashes ?

Thanks

Angad Bajwa said...

I saw that error percentage was calculated. Can anyone elaborate as to what parameters were used to do that?

Were the rms , mean , min and max values used for it?
Could you give the formula for this?

Anonymous said...

You have already made my day. By submitting this post you do me a fever. There are some post I have seen but not like this. You have submit the article with some good image. I have a blog with full of post in this category. You all can visit my blog. paper comparison checker.

Sanaa Ibraham said...

Hello Sir,
How can I benefit from the measurements in the comparison and what does RMS means?

bigclasses 04 said...

I'm very happy to search out this information processing system. I would like to thank you for this fantastic read!!
Data Science Online Training in Hyderabad

Anbarasan14 said...

Thanks for sharing steps. This is really helpful. Keep doing more.

IELTS Classes in Mumbai
IELTS Coaching in Mumbai
Best IELTS Coaching in Mumbai
IELTS Center in Mumbai
IELTS Training in Mumbai
IELTS Coaching Classes in Mumbai
IELTS Classes in near me

sandy star said...



Hello! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done an outstanding job.

Best AWS Training in Chennai | Amazon Web Services Training in Chennai


AWS Training in Bangalore | Amazon Web Services Training in Bangalore

AWS Training in Pune | Best Amazon Web Services Training in Pune


Amazon Web Services Training in OMR , Chennai | Best AWS Training in OMR,Chennai

Unknown said...

Thanks for the explanation. It’s really helpful. Please keep sharing
DevOps Online Training

gowthunan said...

But he’s trying none the less. I’ve been using Movable-type on several websites for about a year and am anxious about switching to another platform.
nebosh course in chennai

Ananya Krishnan said...

Good job in presenting the correct content with the clear explanation. The content looks real with valid information. Good Work

DevOps is currently a popular model currently organizations all over the world moving towards to it. Your post gave a clear idea about knowing the DevOps model and its importance.

Good to learn about DevOps at this time.


devops training in chennai | devops training in chennai with placement | devops training in chennai omr | devops training in velachery | devops training in chennai tambaram | devops institutes in chennai | devops certification in chennai | trending technologies list 2018

Gunika Dawar said...

Hey there, great stuff this MeshLab! I just found out about it, it seems pretty nice.
check out https://ayevainstitute.com/

namma lab said...

nice post..best online blood test
best online lab testing
lab test results online
online blood sugar test

FerCris said...

Hi all,

First of all thanks for the post.
I need to know the sign of the distance, there is some way to preserve the sign of the distance? I see that when the quality histogram is displayed (render -> show the quality histogram) the measurements are shown in absolute values.

Thanks in advance.

Praylin S said...

This is really unique. Thanks for sharing this with us.
Tally Course in Chennai
Tally Training in Chennai
Mobile Testing Training in Chennai
Mobile Testing Course in Chennai
Manual Testing Training in Chennai
Manual Testing Courses in Chennai
Tally Course in Adyar
Tally Course in Velachery

harish sharma said...

whatsapp group links list

jenifer irene said...

Very interesting post! Thanks for sharing your experience suggestions.
Aviation Academy in Chennai
Air hostess training in Chennai
Airport management courses in Chennai
Ground staff training in Chennai
aviation institute in chennai
air hostess course in chennai
airline management courses in chennai
airport ground staff training courses in chennai

service care said...

Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
samsung mobile service center in chennai
samsung mobile service center
samsung mobile service chennai
samsung mobile repair
samsung mobile service center near me
samsung service centres in chennai
samsung mobile service center in velachery

VRITPROFESSIONALS said...

Nice post. Thanks for sharing! I want people to know just how good this information is in your article. It’s interesting content and Great work.
Thanks & Regards,
VRIT Professionals,
No.1 Leading Web Designing Training Institute In Chennai.

And also those who are looking for
Web Designing Training Institute in Chennai
SEO Training Institute in Chennai
Photoshop Training Institute in Chennai
PHP & Mysql Training Institute in Chennai
Android Training Institute in Chennai

No said...

https://letrons.org/whatsapp-group-links/

teena bhabhi said...

Unlimited whatsapp groups for join . click here and get unlimited whatsapp groups links for join and you can also promote your groups in this website - http://whatscr.com

teena bhabhi said...

The best indian dating website in world . you will get unlimited mobile numbers of girls . click here to get girls mobile numbers
























































...................................
Post a comment




















.

ajay said...

mp4moviez

Basudev said...

Great post
Premium Android Apps

lampungservice.com said...

http://servicehpterdekat.blogspot.com/
http://servicehpterdekat.blogspot.com/http://servicehpterdekat.blogspot.com/
iPhone
https://kursusservicehplampung.blogspot.com/
http://lampungservice.com/
http://lampungservice.com/
http://lampungservice.com/
https://cellularlampung.blogspot.com/

Aaditya said...

Excellent blog, great explanation of difference between two meshes.

ExcelR Data Science Course Bangalore

zaintech99 said...

it was awesome to read about Measuring the difference between two meshes:
ExcelR Data science courses in Bangalore

Priyanka said...

Attend The Python training in bangalore From ExcelR. Practical Python training in bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Python training in bangalore.
python training in bangalore

Data Science Course said...

I was just browsing through the internet looking for some information and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject. Bookmarked this page, will come back for more.

Data Science Course

Unknown said...

I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.data science course in dubai

Unknown said...

I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.data science course in dubai

istiaq ahmed said...

The material and aggregation is excellent and telltale as comfortably.
Data Science Course in Pune

Denise Scott said...

I know the topic now quantum manifestation code pdf
my back pain coach review
the vertigo and dizziness program pdf
15 MINUTE MANIFESTATION EDDIE SERGEY
the lost ways book pdf
lost book of remedies pdf

technical raja said...

technologytipsraja.com



IndiaYojna.in


ItechRaja.com

Unknown said...

It has fully emerged to crown Singapore's southern shores and undoubtedly placed her on the global map of residential landmarks. I still scored the more points than I ever have in a season for GS. I think you would be hard pressed to find somebody with the same consistency I have had over the years so I am happy with that.data science course in dubai

Unknown said...

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates.data science course in dubai

Unknown said...

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.data science course in dubai

Unknown said...

After reading your article I was amazed. I know that you explain it very well. And I hope that other readers will also experience how I feel after reading your article.data science course in dubai

Unknown said...

I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article.data science course in dubai

Unknown said...

Really I Appreciate The Effort You Made To Share The Knowledge. This Is Really A Great Stuff For Sharing. Keep It Up . Thanks ForQuality posts is the crucial to invite the visitors to visit the web page, that's what this web page is providing. data science course in singapore

anusha said...



Selenium Training in Chennai Searching for Best Selenium Training in Chennai ?.BITA Academy is the Best Selenium Training Institute in Chennai.. Our Selenium testing course is taught by Experts.Become a Selenium Certified Professional.

Komalpreet Singh said...

Go Health Science is the best resource to get all kinds of Knowledge about Health and Science updates on Healthy Life ideas.

saurav said...

very nice
Top 10 cars under 5 lakhs
Top 10 cars under 6 lakhs
top 5 light weight scooty
best suv under 10 lakhs

Chiến SEOCAM said...

Ojalá seas siempre feliz y afortunado. Espero que tengas más buenos artículos.

giảo cổ lam giảm cân

giảo cổ lam giảm béo

giảo cổ lam giá bao nhiêu

giảo cổ lam ở đâu tốt nhất

Unknown said...

I have express a few of the articles on your website now, and I really like your style of Python classes in pune blogging. I added it to my favorite’s blog site list and will be checking back soon…

Admin said...

how to vote online

hanuman chalisa aarti english lyrics

lost_in_woods said...

thank u for your post very informative and helpfull,
for any help link below:
Point Cloud to BIM conversion

Point Cloud to BIM conversion in USA

lucy88 said...


I am looking for and I love to post a comment that "The content of your post is awesome" Great work!
Data Science Courses

technewworld said...

This is also a very good post which I really enjoyed reading. It is not every day that I have the possibility to see something like this,I love it thanks fo sharing.

IT Tutorials said...

Get the most advanced RPA Course by RPA Professional expert. Just attend a FREE Demo session about how the RPA Tools get work.
For further details call us @ 9884412301 | 9600112302
RPA training in chennai | UiPath training in chennai

Saurabh Jindal said...

Thanks for the Valuable information.Really useful information. Thank you so much for sharing.It will help everyone.Keep Post. Find Some Indian Memes.

Entertainment News

jaanu said...

Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.
machine learning course malaysia

Raga Designers said...

I have read your excellent post. Thanks for sharing

aws training in chennai
big data training in chennai
iot training in chennai
data science training in chennai
blockchain training in chennai
rpa training in chennai
security testing training in chennai

Unknown said...


Daily News

Manipriyan said...

This is also a very good post which I really enjoyed reading


Splunk Training in Chennai

Tableau Training in Chennai

Automation anywhere Training in Chennai

AWS Training in Chennai