vvvv / VL.OpenCV

A VL wrapper for OpenCVSharp
BSD 3-Clause "New" or "Revised" License
43 stars 15 forks source link

added ExtrinsicsToMatrix (CV) operation #57

Open mhusinsky opened 2 years ago

mhusinsky commented 2 years ago

can be useful when no conversion to Stride-space is wanted.

grafik

mhusinsky commented 2 years ago

I might have been a little quick with putting this here as PR, but would like to spark a discussion.

Simplification I just updated this slightly as the patch could be simplified by removing a rotation which I believe is unnecessary (when applied, it needs to be undone like in the "Calculate a camera position using Aruco" help patch).

Before: grafik grafik (Note that the two rotations ("Important" and "Rotate around world origin") are actually 2 sequential rotations around 180° and therefore cancel each other out).

After: grafik

Name Change The name ExtrinsicsToViewMatrix makes sense when applying the Matrix to the camera. When applying it to a scene object, it might be confusing. I therefore changed it to the more general ExtrinsicsToMatrix . Another freedom I took was to create two versions of this node, one called ExtrinsicsToMatrix (CV) and one called ExtrinsicsToMatrix (CV to Stride). The latter one does perform a conversion to Stride coordinate convention (180° rotation around X-axis), while the first does not. This is because there might be cases where one wants to stay in CV space to perform multiple operations and only wants to move to Stride in the end.

Naming and usefulness is up for discussion...

grafik

ravazquez commented 2 years ago

Hello @mhusinsky,

Thanks for this!

I finally had the time to give it a closer look and it is all making sense so far, tests included.

My only two concerns are:

  1. Introducing a breaking change for this now seems a bit drastic. However, I believe that if we add the two nodes as you suggest, and keep ExtrinsicsToViewMatrix as a Legacy node to ensure people's old patches keep running, while also updating all help patches and docs to point at the new versions, we might be OK.
  2. The category naming does not feel quite right yet. Let me try and come up with an alternative.

Cheers.