#๐Ÿ”’ How to extract the transformation to apply to 2D image

23 messages ยท Page 1 of 1 (latest)

fluid warrenBOT
#

@azure echo

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

azure echo
#

Weird my message was deleted ๐Ÿค”

lunar goblet
#

!paste

fluid warrenBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

lunar goblet
#

You should have received a message from the bot about why your message was deleted

#

Original message: ```
Hi !

I did build a small streamlit app that takes an image as input. (a rug in my case but it could be any flat surface)
I would like to let a user put it in a chosen angle using the 3D viewer.

What's missing:
I would like to have an algo that would compute the transformation to apply to the original image to have the image in the same position an in the original flat image.

Could you help me on this ๐Ÿค”

azure echo
#

thanks for the message repaste was writing it again ๐Ÿ˜…

lunar goblet
#

What does "to have the image in the same position an in the original flat image" mean?

azure echo
#

After reading it again it's not clear

I would like to have an algo that would compute the transformation to apply to the original image 2D image to have it in the same orientation as the 3D viewer.

The goal would be for me to get some "precomputed" position that would fit the user

#

Like I'm trying go have a function taking either a camera matrix relative to the original position or one taking params like x_angle, y_angle z_angle, x_translation, y_translation, z_translation but I'm having a hard time with 3D geometry x)

#

Don't know if it's clear enough ๐Ÿ˜„

lunar goblet
#

I understand that the 3D viewer allows you to rotate the image in 3D, I don't understand what part you need to do here. What is the output? Isn't the rotated image already given by the 3D viewer?

#

Are you implementing the 3D viewer yourself?

azure echo
#

my initial goal was to have a function taking

move_rug(np.array[h, w, 3], transformation_information, size=(1024,1024)) -> np.array[1024, 1024, 3]

The 3D view should be optional meaning I wanted to use it myself to find the transformation information to apply to get some interesting base view for the user (like 3 viable transformation). Only if those are not good I want to display the 3D viewer and allow the user to eventually interact with the 3D viewer.

If possible the user would even not need to use the viewer. The other issue is that I don't know how to extract the 2D image from the 3D viewer as a 1024*1024 RGBA image. I tried several things but stumbled through different errors

#

I would like to forward the resulting 2D image png to another algorithm that's why I'm not satisfied with just having the 3D viewer displaying the image

lunar goblet
#

If you could pull the image from the viewer, would that be enough for you, or would you still want an algorithm?

azure echo
#

I really would like to manage a way to get to the algorithm ๐Ÿค”

#

I had this other code that I started but the transformation are not behaving like I would like

https://paste.pythondiscord.com/ZWBQ

The rotation should be centered on the middle of the input object

lunar goblet
fluid warrenBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.