Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Monstermash28425R1 · Oct 25, 2018 at 09:03 PM · unity 5monobehaviour

OpenCV for unity Camera Motion Estimation via optical flow?

hi guys, im really really newbier with opencv for unity, i have 3.0.0 version and i want to do a camera motion estimation, i know how to do the optical flow estimation and i got rotation for the camera but it isn´t moving the camera and dont rotate arrown Z axis, now i dont have idea about camera reconstruction, can everyone tell me how can i calculate the movement over all points of optical flow?

i got some idea, first i need to get all prev & next points into an array, after i think that i need to calculate the motion across all points and pass te result to the transform. (rotation&position) of the camera to move it around the scene,

but how i said, i can just do the optical flow calculation but i dont have idea about how can i estimate all motion over all points

aside.

can someone translate this code from c++ to work with open CV for unity? there is in oter post:

https://docs.opencv.org/3.4/d5/dab/tutorial_sfm_trajectory_estimation.html

I would appreciate it a lot!!

thanks for take a time to read this question ;)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by SunnyChow · Oct 26, 2018 at 05:50 AM

First, you shouldn't add reply unless you want to post your answer. For other people watching the main page, it looks like the question is answered.

Second, i don't think you will get a simple answer. Using just camera to calculate position/rotation is so difficult that some company's business isbased on it. SLAM is the technology you are probably searching. You can take a look on Kudan, VOID AR or EasyAR. ARKit/ARcore is in this category.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Monstermash28425R1 · Oct 26, 2018 at 11:42 AM 0
Share

oh sorry man, ok i know that itsn't easy but can be done with open cv? or this is unuseful for my target? sorry angain for my bad english and for made these mistake answering my own question

avatar image Monstermash28425R1 · Oct 26, 2018 at 11:44 AM 0
Share

i dont want calculate the motion via markless functions, i did mean, i dont want look over a picture with my camera to make the motion, i want to be free to move over all object infront of me

avatar image Monstermash28425R1 · Oct 26, 2018 at 11:57 AM 0
Share

sorry, but i dont want AR apps, im working in an VR project for mobile and google cardboard oculus rift, i just want to walk around my bedroom and get some movement in my game via motion estimation over ALL trackable points infront of me, btw i wrote a code to calculate te optical flow, and to rotate the camera i get the sum of all points menus all prev points and it return a verctor2, to do rotation i've passed these vector2 to the eulerAngles of my main camera, and its work, but its just rotating over X and Y axis, so i want to do full rotation, and if its possible make motion too ;) but, i dont know how to do that via all points, i think, that i cant get the motion via: thisPoints - prevPoints, and rotation is more complex cuz i need to get the perspective between thisPoints and prevPoints, im getting this via optical flow, ImgProc.goodFeaturesToTrack() void from openCV for unity

avatar image SunnyChow Monstermash28425R1 · Oct 29, 2018 at 03:52 AM 0
Share

The 3d camera position returned from SLA$$anonymous$$ IS the camera movement. Unfortunately the delay between camera signal to rendering is large thatit's uncomfortable for user (I have tried it with google cardboard and AR$$anonymous$$it)

avatar image Monstermash28425R1 · Oct 26, 2018 at 12:11 PM 0
Share

by the way, is possible to translate / convert, the code from https://docs.opencv.org/3.4/d5/dab/tutorial_sfm_trajectory_estimation.html

to work in unity?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

183 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to rotate an array of vectors over a normal vector 1 Answer

Physics without UnityEngine namespace 0 Answers

GameObject is null when assigning to non-monobehaviour public static class 1 Answer

How to add default behavior of OnDestroy function for all MonoBehavior scripts? 1 Answer

Unity3d Dragging object in 3d world 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges