Forum

Author Topic: Export confidence as a texture map?  (Read 4831 times)

splanchnocranium

  • Newbie
  • *
  • Posts: 3
    • View Profile
Export confidence as a texture map?
« on: October 20, 2023, 08:58:04 PM »
Hi - is there any way to export the confidence values as a texture map that I could use in a 3D app (to apply to the model - just as a demonstration of this value)? I scan anatomical models, and it would be useful to show my colleagues which areas of the model are constructed from fewer photos (or none at all - if the surface is just filled in, in the absence of photo date). There is another thread on this subject but it refers to data stored in the the LAS/LAZ format.
Thanks

jeffreyianwilson

  • Newbie
  • *
  • Posts: 28
  • Technical Director at Rendered.AI
    • View Profile
    • Portfolio Webpage
Re: Export confidence as a texture map?
« Reply #1 on: October 20, 2023, 09:04:16 PM »
Texture the model as usual then you can export the mesh as a PLY file (odd that support is not in FBX or OBJ) and bake the confidence value as vertex colors.  Tools like xnormal can bake vertex normals into a texture map.

Jeff
Jeffrey Ian Wilson
Technical Director 3D
Rendered AI
www.rendered.ai

splanchnocranium

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Export confidence as a texture map?
« Reply #2 on: October 20, 2023, 09:07:33 PM »
Thank you! I'll give this a try. I hadn't tried PLY so didn't see this option. Much appreciated.

janosch1234

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Export confidence as a texture map?
« Reply #3 on: December 20, 2023, 08:16:03 PM »
btw. if you are interested to get the confidence values as a mask into ZBrush (what interested me the most)
you can also import the confidence with ply in cloud compare as intensity and then export it again and import it into ZBrush with vertex colors.

That way you can mask the confident parts out and only sculpt on the non confident parts.
 
« Last Edit: December 21, 2023, 01:08:07 AM by janosch1234 »

jkova96

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: Export confidence as a texture map?
« Reply #4 on: December 25, 2023, 08:34:07 PM »
Hi splanchnocranium,
Can you please tell me if these advices actually works for you?
I'm interested in, also to get model confidence as texture map.
Don't know how exactly to use these advices cause, I'm not familiar with terminology.
 
Advice from jeffreyianwilson sounds good, but if you read this jeff...On what you exactly mean when you wrote this: "you can export the mesh as a PLY file (odd that support is not in FBX or OBJ) and bake the confidence value as vertex colors.  Tools like xnormal can bake vertex normals into a texture map."?
Is xnormal some sort of program or what? Is it free if so? How to "bake the confidence value as the vertex colors"?
I'm sorry, maybe these are stupid questions but I'm newbie - who still wants to know how to do these things?
Thanks for understanding !

Bye :)
J.K.

jkova96

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: Export confidence as a texture map?
« Reply #5 on: December 26, 2023, 07:31:06 PM »
Hi,
How to know if this stuff actually works?
There's no anything from anyone...no any feedback.
I'm bit disappointed with you guys.
Can someone refer with actually steps needed to do in order to get model confidence as texture map.
I'm sorry if I bother you with these things, but I just want to do the same for same purpose as splanchnocranium.
I just exported model, and I choose almost everything in EXPORT options, but still don't know what to do in order to get model confidence?
Second thing, I don't know what is the workflow inside that "xNormal" software but I've just downloaded it.
Don't know how can I use this software in order to make "model confidence" as texture.
I think that this software also needs two meshes...don't know why is that, cause this is like double job.
If anyone have better software how to do these things or any other method different to this xNormal.
Please help 🙏

jkova96

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: Export confidence as a texture map?
« Reply #6 on: December 26, 2023, 08:01:20 PM »
anyone?!

jkova96

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: Export confidence as a texture map?
« Reply #7 on: December 26, 2023, 09:17:49 PM »
:/
« Last Edit: December 26, 2023, 10:03:41 PM by jkova96 »

jkova96

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: Export confidence as a texture map?
« Reply #8 on: December 26, 2023, 11:25:11 PM »
Ok guys here's the thing,
Don't know like I already said...if this really works, cause for me - all your advices just does not work.
Reason for this is because I don't see any texture which represents model confidence.
Only texture map which I can see, at least when I'm using version 1.8.5 for exporting, is texture map which contains texture.
Don't know why you can choose so much export model option in Agisoft Metashape, while is only one texture map actually exported.

For those xnormal software, it seems that these software is quite useless for this task (or at least - I thought so) cause It obviously needs mtl file related to texture.
When exporting model in ply format - this is related to jeffreyianwilson advice, there's no exported mtl file....so when trying to do anything with xnormal software I just get this message:
"(file location) has no texture coords assigned! Please Export them!"

I tried for exercise, just in xnormal, to export model in OBJ format and then put anything to bake in xnormal and it seems that this works.
Reason for this lays in exported mtl file which comes when exporting OBJ.

I don't want to make any explicit conclusions now, but It seems that no one from you guys manage to get model confidence as texture map.

I would really like that someone from you can deny my thoughts. You should, all of you, instead of guesswork actually provide or give us exactly workflow (step-by-step)
how to get exportable model confidence in whatever 3D format...except Agisoft(s) of course.

Have a nice day :/
Bye :/
J.K.
 

tazzo

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Export confidence as a texture map?
« Reply #9 on: December 27, 2023, 01:29:07 AM »
Ahaha give us time to digest panettone

Confidence baked into the model means that every vertex contains an additional field with the confidence value.
If you export a PLY model with the confidence data only in a non-binary format, you can open with notepad the file and see the confidence value for each vertex. From there you have to build a texture, Meshlab maybe can do this (you probably have to rescale values first). If no commercial software works, you have to write your own software for this.

Edit: when bake the confidence value as vertex colors @jeffreyianwilson probably means to rename the field and treat the confidence as a color so that xnormal works fine
« Last Edit: December 27, 2023, 02:22:05 AM by tazzo »

jkova96

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: Export confidence as a texture map?
« Reply #10 on: December 27, 2023, 10:38:06 AM »
Hi tazzo,
Finally someone who explaind this on more scientific way.
Okay, from your senteces I can only conclude that is necessary to play with the values when exported to non-binary format.

Is that correct? Can Metashape actually export 3D model in non-binary format?

Also to treat texture as confidence, to me that sounds easier that actually is...
Problem is, or issue is, that if you tried to work with xnormal it needs texture map first, or I think so. Don't know how to obey that or even is it possible to obey textures and mtl file when importing 3D model - for everything to work properly.

Maybe I should pay someone to make a proper program who will able to extract texture from these values if you can really find any informations about confidence value.
Check for the picture below - why I'm suspicious about non-binary format. Or maybe better question will be how to export in non-binary program?
Will then model be able to open in some 3D viewer,
I mean inside "MeshLab" or maybe some other 3D viewer, after using non-binary format?

I'm sorry for aksing you this...
Cause I'm not programmer...unfortunately.

Best regards :)

J.K.







e.spiridonova

  • Agisoft Technical Support
  • Newbie
  • *****
  • Posts: 38
    • View Profile
Re: Export confidence as a texture map?
« Reply #11 on: December 27, 2023, 01:59:23 PM »
Good afternoon,

We can suggest testing our script as a workaround (recommend testing the script on a small project). 

The script colors the vertices by confidence, and then bake texture. Also please note that the model is built from depth maps and with vertex colors.

Select Tools > Run script... and choose the script. After that select Scripts > Texture Model with Confidence.

Best regards,
Elizaveta Spiridonova,
Agisoft LLC

tazzo

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Export confidence as a texture map?
« Reply #12 on: December 27, 2023, 03:18:07 PM »
Hi tazzo,
Finally someone who explaind this on more scientific way.
Okay, from your senteces I can only conclude that is necessary to play with the values when exported to non-binary format.

Yes, if you uncheck binary coding, the file will be exported in ASCII format (= plain text)

Once you export the file you can open it with notepad, see attached screenshoot.
There is a row:

property double confidence

that you can change with

property double quality

if you want to use for example MeshLab to work on the Quality attribute. Keep in mind that should be rescaled and that MeshLab is not user friendly if you are not into computer graphics. This may be more complex than developing a custom program to bake the confidence data into vertex colors.

Now what you want is to convert this confidence to a vertex color, maybe you don't need a texture at all. This involve mapping a single confidence value to an RGB color according to some scaling, as Metashape is doing. In this way every 3D viewer that support vertex colors can show you model.

I don't know about xnormals, but I can help you with this if you need a custom software to bake the confidence data into vertex colors.

Try first the script they sent you, maybe is enough to solve your issue.

jkova96

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: Export confidence as a texture map?
« Reply #13 on: December 27, 2023, 06:42:15 PM »
Hi tazzo,

Thanks for your reply and detailed explanations on what should I do.
Unfortunately, neither I'm some sort of programmer, neither I have knowledge into computer graphics.
Only I can is to follow non-so-hard and useful advices from some smart people in this forum.

Btw, Can I ask you something - you wrote this:
Quote
Try first the script they sent you, maybe is enough to solve your issue.

Can you tell me how did you know that they must send me a script?!
Are you working for Agisoft or?!
Or if you some kind of programmer, not to say hacker.
I assume that I did not ask anyone for any script.
Only, what I've done was contacted Agisoft support and that's it.
Sorry, but this is very strange, not to mention - very odd.

I want to know what's the background for these sentences. That's all.
Nothing personally.

Have a nice day !

J.K.


tazzo

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Export confidence as a texture map?
« Reply #14 on: December 27, 2023, 07:55:35 PM »
Hi jkova96,

How are you?

I'm not working for Agisoft and I'm not an hacker or anything. I answer to the forum as unpaid hobby, sharing some knowledge I gathered in these years to help people, only because I like to help them.

They sent the script to all actually, it's in the post before mine as attachment. I was referring to that.
« Last Edit: December 27, 2023, 09:13:53 PM by tazzo »