-
Notifications
You must be signed in to change notification settings - Fork 18
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
point cloud data #147
Comments
Yeah, right now, there isn't any mechanism in the SDK to decode the contents from the URL that |
So, it means that there is no solution to decode the contents of this url? I wonder if I could know it encoding type, then Maybe I can try to decode myself? |
@neverland-haha, there is a way to decode the contents. I meant to say that this solution has not yet been integrated into the SDK. The Can you please share the file here that you have right now? I can look into this and integrate a solution to decode the SFM as well. |
This this the url tha |
@neverland-haha, I was able to write a quick import requests
import json
import zlib
def main():
# change URL here as per need
sfm_content_url = 'https://scontent-iad3-1.xx.fbcdn.net/m1/v/t0.40383-6/An8Lx-3QlYDKv2YxzpOgOEJeMdx1v4mm8Xvczm4oxncKAIlA_cmDpxwXsy65cnsTUmM6mgq9dpooROG658tIhEyOIrA8uHcqeFK5gB9TMikR9788Ku_awoEbtFHGJg2X2jPKjy0padhn0w?ccb=10-5&oh=00_AT_Tar_zzekzP0jDvbYAeHCNxU7GITO5m5HtEYy95wwm2w&oe=632180A9&_nc_sid=0f319a'
# decompress sfm content, and return dict
print(decompress_sfm_content(sfm_content_url))
def decompress_sfm_content(sfm_content_url: str) -> dict:
# make get request with python and get content
response = requests.get(sfm_content_url)
content = response.content
# decompress zlib content
return json.loads(zlib.decompress(content).decode('utf-8'))
if __name__ == '__main__':
main() I'll be adding this function soon in the SDK. Please let me know if this resolves your concern. And thanks for opening this issue! I learned something new today. |
It does solve my problem, Thank you very much! |
@neverland-haha, I'll close when I finally merge the PR for this function in the SDK. Reopening for now. |
The |
Hi, @neverland-haha! I haven't yet had the time to explore this, but some intuition that I can help with maybe. After storing the data as a JSON, I found there are 4 keys in the dictionary. The I'm not sure myself what to do for the @cbeddow what would you suggest to do here in this case? |
@Rubix982 @neverland-haha in the latest JSON example above, if you need the camera bearing angle, you will work with the rotation of the image: https://opensfm.org/docs/cam_coord_system.html It should be the Z-Axis is telling you which angle the camera is facing. I am not sure if that is a 0 to 360 value though. The full data there you see is designed to work with OpenSfM library in Python so I suggest to go from Mapillary Python SDK to OpenSfM to work with the results you get from the JSON: https://opensfm.org/docs/dataset.html#reconstruction-file-format |
Thanks, I' ll try and give you the answer. But As the doc says: Y-Axis is telling the angle the camera is up or down, however, when I change the units from rad to degree,some angle even greater than 90°. I'll check the process again. |
What feature or requirment is this related to? Please describe
This code example relates to the feature or requirement mentioned on #<github_issue_here>
I want to get the point of cloud of each image so I can reconstruction the camera position and get better visualization, positioning, however. When I try to get the url that links to sfm_cluster, it returns to me a binary stream. After that , I write it content into a txt file,
but it becomes messy code. Is there any way to decode the messy code or api that I can get the *.ply format file?
Thank you!
Additional context
The text was updated successfully, but these errors were encountered: