david-cattermole / mayaMatchMoveSolver

A Bundle Adjustment solver for MatchMove related tasks.
https://david-cattermole.github.io/mayaMatchMoveSolver/
Other
101 stars 29 forks source link

Can't get solver to run #205

Closed mswed closed 3 years ago

mswed commented 3 years ago

Hi, I'm trying to get a solve running on and object track and for some reason, I keep getting the following warning:

Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve

And it looks like the solver just stops without actually solving.

Here's what I've done:

  1. Created fresh scene (under the assumption my original file got corrupted somehow)
  2. Imported a camera from 3de.
  3. Imported an obj file (which lines up with my plate)
  4. Imported 2D tracks from 3de using the Export 3D Tracks (MM Solver) v1.7 (I also tried Copy 2D tracks (MM Solver) v1.8, with the same results)
  5. Selected the markers in the mmSolver UI and then hit tools > Project Marker on Mesh (Ray-Cast)
  6. Most of the markers hit the geo
  7. selected the obj file, and keyed all channels.
  8. Clicked the + sign near Output Attributes in the mmSolver UI which added all of the channels to the UI.
  9. Hit solve.

Software Versions

Any idea what I might be doing wrong?

Thanks,

Moshe

david-cattermole commented 3 years ago

Hello Moshe,

Thank you for your detailed description - it makes things a lot faster and easier to debug for me :)

The reason the solve is not working is that you need to have more 2D points for the number of attributes to solve.

For example to solve 6 attributes per-frame (translate XYZ and rotate XYZ) you need a minimum of 3 points (2 x 6 - X and Y for each 2D Marker) on each frame.

In v0.3.11 the "validate" button has been hidden by default, however this button can help spot these problems. To turn it on: 1) Open the menu mmSolver > General Tools > User Preferences... (right at the bottom) 2) Set Show Validate Button to Yes. 3) Press "Save" button 4) Re-open the Solver UI. 5) Press Validate button.

User Preferences: image

Solver UI Validate button: image

The numbers in the text will give you some helpful information.

Something else check/test which might have gone wrong is to make sure your 2D Markers have a non-zero weight and are enabled (unlikely but it could catch you out if your 2D points in 3DE had a weight of 0.0 - because this is copied over to Maya too). image

I hope this helps - let me know how you go.

David

mswed commented 3 years ago

Hi David,

Thank you for your quick reply! I enabled the validate button and added a few additional points. I have 22 overall and 10 points per frame. Yet when I validate I get the following: Valid Solves 5 | Invalid Solves 28 | Deviations 0 | Parameters 0| Frames 28

Is there a way to get more info on where exactly the solve is breaking?

Thanks,

Moshe

david-cattermole commented 3 years ago

Hello Moshe,

What you describe sounds a bit strange to me. In this text: Valid Solves 5 | Invalid Solves 28 | Deviations 0 | Parameters 0| Frames 28

It tells me that the Marker deviations are not being detected, and the same as the Attribute parameters, because they are both zero. Can you please send a screenshot of the Solver UI window with the Attributes and Markers added to the UI? For example it should look similar to this: image

Perhaps the markers are disabled during the frame range you are solving? That's why the Solver is not detecting and deviations (because the Markers are disabled).

If it is due to the frame ranges, something else that might trip you up is that the 3DE Export 2D Tracks (and Copy 2D Tracks) tools will use the "First Frame is Frame" value to automatically set the frame offset from 3DEqualizer's frame numbers to Maya's frame numbers. I would recommend setting the "First Frame is Frame" attribute in the 3DE Attribute Editor to the start frame of your image sequence - this will allow the tools to automatically convert into the image sequence frame values, rather than 3DE's default behaviour to start at frame 1.

David

mswed commented 3 years ago

Hi David,

That is indeed strange. I'm hoping I'm just doing something wrong :) but I can't figure out what it might be. Some of the markers are disabled during different parts of the track, but overall at least in 3de, I should have at least 10 enabled points per frame. In 3de I'm also able to get a solve using both the default solver and the lsf solver.

Here's my UI: mmsolver

And this is what I get when I hit Solve: // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1001] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1038] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1041] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1043] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1046] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1050] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1052] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1059] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1063] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1064] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1074] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1075] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1078] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1079] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1084] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1085] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1086] // // Warning: mmSolver._api.execute : Invalid parameters and errors, skipping solve: [1089] // // mmSolver.tools.solver.lib.collection : Total Time: 7.222 seconds // // mmSolver.tools.solver.lib.collection : Max Frame Deviation: -0.00 pixels at frame None // // mmSolver.tools.solver.lib.collection : Average Deviation: 0.00 pixels // // Warning: mmSolver.tools.solver.lib.collection : 2021-01-19 17:47:53 | Solved | Average Deviation 0.00px | Max Deviation -0.00px at None | Time 7.222sec //

Thanks for you help!

Moshe

david-cattermole commented 3 years ago

Hmm... initially, looking at the screenshot it looks ok. The script editor output is also helpful. Do you get any messages in the Maya Output Window (on Windows)?

Would it be possible to also get a screenshot of the Maya Outliner with the camera node, markers and locator1?

I'll need to investigate more...

mswed commented 3 years ago

Cool. Thanks so much. I will send you a screenshot and whatever I can find in the Output tomorrow.

mswed commented 3 years ago

So.... I found out what I was doing wrong. I never put the bundles under the object I was animating. :( I will now go hang my head in shame in the corner and mark this as closed.

david-cattermole commented 3 years ago

Oh great! I'm glad it's working for you.

I did think of that this morning and I was going to post this:

One important thing is to ensure your Bundles (the green locators) are parented under the transform node you are solving (in your case locator1.)

Have fun and I hope mmSolver can save you some time.

David

david-cattermole commented 3 years ago

It seems obvious in retrospect, however another indicator is the "Status" column in the Input Objects and Output Attributes. image

In your screenshot the status was a cross mark (❌), where as my screenshot above shows a tick mark (✓). These Status icons display if a marker or attribute are "used" by the solver.

For example if an attribute is added to the solve but cannot be affected by any Marker then the Solver automatically detects this and disables the Attribute (with a cross mark❌). (If the solver does not automatically disable the attribute then the solver can get confused because "changing the attribute does not affect the deviation at all").

Hopefully information will help in future.

Thanks, David.

mswed commented 3 years ago

It's super helpful, thank you!