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

fix: for upsidedown image from oak1 #473

Closed

Conversation

auphofBSF
Copy link

When using the Oak1 in the depthai_demo.py the image is upside down.

 [-cam_model {oakd, oak1}]

The following enables a command line argument to allow specifying the model of camera so as to apply appropriate defaults.

See discussion and relevant links https://discuss.luxonis.com/d/311-oak-1-poe-image-image-upside-down-using-depthai-demo-py

and thanks to @alex-luxonis and Naraka on discord for solution https://discord.com/channels/790680891252932659/799407361986658354/882061206330966117

@alex-luxonis
Copy link
Collaborator

Thank you for the pull request @auphofBSF ! And sorry for the trouble here...

I've created a PR where the depthai library/firmware is modified to auto-detect the OAK-1-PoE device and rotate the camera view accordingly: #474. We should have done this a longer time ago...

An option to manually specify the rotation could still be useful, regardless of the device type, if the user finds it better to mount the device upside down (e.g. for cable management in certain applications).
We could add it, but it would bring a complication for OAK-D devices, when the depth output is used, the calculations would be wrong, as this usecase isn't handled properly yet on firmware side.

@auphofBSF
Copy link
Author

auphofBSF commented Sep 6, 2021

Thanks @alex-luxonis , I will pull #474 and test. Would it be useful to change this PR to allow selection by args of any option for setImageOrientation from dai.CameraImageOrientation.* ie: ROTATE_180_DEG.
To handle the Oak-D no support for depth when rotated suggest this ,

# pseudo code - depthai_demo  args for --camera_rotation
if oak-d 
   if arg --disable_depth and arg --camera_rotation
        setImageOrientation derived from arg --camera_rotation
   else:
       log.warn "On Oak-d Camera Rotation not supported when running Depth algorithms"

@VanDavv
Copy link
Contributor

VanDavv commented Sep 6, 2021

@auphofBSF that's a great suggestion, will definitely be useful if someone wants to use the demo script for cameras in different orientations

@VanDavv
Copy link
Contributor

VanDavv commented Sep 6, 2021

@auphofBSF I've added a PR that allows setting the custom camera orientation - #475

@auphofBSF
Copy link
Author

#474 works great, thanks @VanDavv. Closing this PR

@auphofBSF auphofBSF closed this Sep 11, 2021
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

Successfully merging this pull request may close these issues.

None yet

4 participants