Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symmetry information in model_info.json ? #50

Closed
maedhril opened this issue Jan 25, 2021 · 12 comments
Closed

Symmetry information in model_info.json ? #50

maedhril opened this issue Jan 25, 2021 · 12 comments

Comments

@maedhril
Copy link

I am trying to use my own models and I used 'calc_model_info.json' script. However, The script does not generate some property called "symmetry_discrete" that I do not know what it means. Do you know what it is or how can I generate this information for my own model?

#48

@bertid
Copy link
Collaborator

bertid commented Jan 25, 2021

This field contains a list of 3D poses (each represented as 4x4 matrix) under which your model is symmetric. The identity pose is omitted. In other words, if the model is transformed by one of the listed poses, it does not change (too much).

For example, a cereal box would have three poses in that list, if texture is ignored (flip over the long side, flip over the short side, flip over long and short side).

@maedhril
Copy link
Author

maedhril commented Jan 26, 2021

@bertid First of all, thanks for the answer!

How about more complex objects that have symmetry transformation beyond simple axis flips. For example; in YCB-V dataset there are some objects that have symmetry transformation as following;

    "symmetries_discrete": [
      [0.00179515,
      -0.999956,
      -0.00918835,
      -0.451143,
      0.99999,
      0.00175811,
      0.00403816,
      -0.140551,
      -0.00402183,
      -0.00919551,
      0.99995,
      -0.00311599,
      0,
      0,
      0,
      1],

I mean this matrix must be calculated from a script or library but I did not have any luck finding any library or method to calculate these values.

@bertid
Copy link
Collaborator

bertid commented Jan 26, 2021

@maedhril Right, there is a script but it is unfortunately not released. It is a semi-manual process, where you first define the symmetry class of the object (there aren't that many, usually boxes, n-fold rotations around an axis which is usually the z-axis etc.), and then ICP is used to further improve those initial poses.

If your models are manually created CAD models and the coordinate frame is nicely aligned (center in the object center, axis aligned with whatever symmetry you have), you can also often come up with the poses yourself. If the models are the result of some scanning this is more difficult.

The scripts are not really a secret and I can send them to you, but they are undocumented and require a license for the HALCON library. Free licenses are available for universities, but there is a steep initial learning curve. Alternatively, if you just have a few objects you can send them to me and I can annotate them and send you back the symmetries. Be advised that you might have to filter those symmetries to account for texture. The script only takes geometry into account, and depending on what you want to measure you might want to remove some symmetries for which the texture changes drastically. That is highly domain dependent, though,

@maedhril
Copy link
Author

@bertid If you can send me the scripts that would be fantastic because besides the objects currently I have, I will probably try new objects in the future. Besides, I think looking at the script will be helpful whether I will try to create my own script or I will try to integrate HALCON. So if you can send me the script to my mail account cptmaa@gmail.com; I would be very thankful.

@bertid
Copy link
Collaborator

bertid commented Jan 26, 2021

@maedhril Sure - I'll clean up the scripts a bit and send them to you in the next days.

@HamilkarBrq
Copy link

Hey @bertid,
I am facing similar problems like @maedhril described at the moment as well. Could you send me the script to my university mail account j.schons@wzl.rwth-aachen.de ?
Thanks in advance.

@bertid
Copy link
Collaborator

bertid commented Feb 2, 2021

@maedhril @HamilkarBrq The mail is on its way - let me know if you have any issues with the scripts (which is quite likely, they really are spaghetti code, no need to comment because I will run this one time only scripts).

@bertid bertid closed this as completed Feb 2, 2021
@YyYyYong0331
Copy link

Hey @bertid,
I am facing similar problems, too. Could you send me the script?
The mail account: wyong233@gmail.com
Thanks

@bertid
Copy link
Collaborator

bertid commented Apr 21, 2021

@YyYyYong0331 The mail is on its way.

@baichuan05
Copy link

Hey @bertid,
I am facing similar problems, too. Could you send me the script?
We are trying to extend ycbv to a larger one with other ycb objects.
The mail account: baichuan.huang@rutgers.edu
Thanks

@bertid
Copy link
Collaborator

bertid commented Aug 23, 2021

Hi @baichuan05 - apologies for the delay.

Attached are the HALCON scripts that were used to build the symmetries for the BOP objects.

Please note again that they are not very polished. The idea is to first run script #1, where you can use sort of a GUI to set the object symmetries. Different types are available (box, n-fold symmetry etc.). They usually work out of the box if (1) the model’s symmetry axis is the z-axis and (2) the center of the coordinate frame is also the center of symmetry. If that is not the case, you will have to manually adjust those values in the code for your object.

Script #2 will take all the symmetries and produce the json file.

I’m quite sure that they will not run out of the box for you, so please just let me know if you run into any issues or need a quick walkthrough. In any case, you can produce the symmetries with any program of your choice, or even manually in some cases if the model is well behaved.

bop_symmetries.zip

@baichuan05
Copy link

Hi @baichuan05 - apologies for the delay.

Attached are the HALCON scripts that were used to build the symmetries for the BOP objects.

Please note again that they are not very polished. The idea is to first run script #1, where you can use sort of a GUI to set the object symmetries. Different types are available (box, n-fold symmetry etc.). They usually work out of the box if (1) the model’s symmetry axis is the z-axis and (2) the center of the coordinate frame is also the center of symmetry. If that is not the case, you will have to manually adjust those values in the code for your object.

Script #2 will take all the symmetries and produce the json file.

I’m quite sure that they will not run out of the box for you, so please just let me know if you run into any issues or need a quick walkthrough. In any case, you can produce the symmetries with any program of your choice, or even manually in some cases if the model is well behaved.

bop_symmetries.zip

Thank you for the code! I really appreciate it! I see the original YCB objects are not aligned to the center of symmetry, I have used meshlab to relocate the center.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants