Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
41 Views

3D Scan disable mirror

Hello.

Is it possible to disable the built-in "mirror" functionality of the AcquirePreviewImage method for the 3DScan module?  I've tried the obvious thing:

manager.captureManager.device.SetMirrorMode(PXCMCapture.Device.MirrorMode.MIRROR_MODE_DISABLED);

I did so after the init but it doesn't seem to have any effect on the 3DScan module.

If it's possible in the current SDK, please point me in the right direction.

If not, I'd recommend adding it.  Possibly as part of the "Configuration" object.  The F200 does work brilliantly (technically speaking) in 3DScan mode when hand-holding it in a forward orientation.  But without being able to turn off the automatic mirror in the preview, it's also somewhat maddening to use it this way.  It's nice that it can automatically do this.  It would be better to be able to override it too.

-brad

0 Kudos
5 Replies
Highlighted
Employee
41 Views

Hi Bradley,

If you're developing in C#/WPF, another way to mirror the image is to render it in a WPF Image control and transform it as shown below (where imgMain is the name of the control): 

                    imgMain.RenderTransformOrigin = new System.Windows.Point(0.5, 0.5);
                    ScaleTransform mainTransform = new ScaleTransform();
                    mainTransform.ScaleX = -1;
                    mainTransform.ScaleY = 1;
                    imgMain.RenderTransform = mainTransform;

-Bryan

0 Kudos
Highlighted
Beginner
41 Views

I cannot explain how disturbing it is to be told that the way to handle this is to detect when the SDK is doing a thing, and undo what was done by the SDK, in the display\control layer.  If I were to do this, it would be horrible software design on my part.

Yes, I am aware I can un-mirror a mirrored image with a negative scale in my chosen display/control layer.

I am talking about an SDK level issue.  A reasonable response might be:

"""There is currently no way to have the SDK act as you suggest.  We'll take a look at that for future releases.  For now, if you can't wait, you might consider hacking your control layer to force it, even though that's a bad solution for the long term.  Example WPF code provided:  <code>"""

0 Kudos
Highlighted
Employee
41 Views

Hi Brad,

Here is additional information I received today from the SDK team:

"There is no way to enable mirroring of the preview image with the current release. It would have to be mirrored by the caller if needed. Cameras which expose an orientation of DEVICE_ORIENTATION_ANY (e.g. Creative camera) are treated, by 3DScan module, as if they were DEVICE_ORIENTATION_USER_FACING (preview is mirrored). If a peripheral camera is used in a world facing orientation, the preview would appear to not be mirrored correctly. Can you please let us know which camera model is used in this case?  Is it a built-in, or an attached USB peripheral?  And, if it’s a peripheral camera, is the camera held in a front or rear orientation?"

If you provide the requested information I'll make sure the team has it for future consideration to possibly add this feature.

Thanks, Bryan

0 Kudos
Highlighted
Beginner
41 Views

It's an F200 developer kit.  It says "creative" on the front.  It is indeed a "peripheral camera" that is used in a "world facing" orientation if I'm understanding the nomenclature correctly.  It is not built-in.  It is an attached USB peripheral.

As to the last question:  "is the camera held in a front or rear orientation?"

In this case, if I understand nomenclature correctly, it is being held in a "rear" orientation even though the camera is typically used for "front" orientation.  However, since the camera is external, it can be simply turned around.  And it should be reasonable to do so.  Of course, the camera can't detect if it's been turned around.

Hence, the reason I am requesting the ability to override the automatic mirror at the SDK level.  Essentially telling the SDK, "Thanks for trying but you don't know for sure.  I do.  So always give me raw camera (sensor) oriented data so I can handle it instead of you."

0 Kudos
Highlighted
Valued Contributor II
41 Views

Was this SDK issue resolved? I just tried changing the mirror mode during the 3DScan preview (using latest SDK), and it only mirrors the colour image in the background, not the foreground mask which is based on the depth image. Then when I request a scan it immediately loses tracking as the two images are opposite to each other.

I have noticed that some of the embedded devices we've tested on get the mirror mode wrong by default (ie, an embedded rear camera thinking it's forward facing and setting the mirror accordingly), so we definitely need a manual override for this.

0 Kudos