Skip to content

Camera backside problem solved and visualizing resolution control added#8

Open
Lee-Jun-Hyuk-37 wants to merge 3 commits intoMM4SPA:mainfrom
Lee-Jun-Hyuk-37:backside_problem
Open

Camera backside problem solved and visualizing resolution control added#8
Lee-Jun-Hyuk-37 wants to merge 3 commits intoMM4SPA:mainfrom
Lee-Jun-Hyuk-37:backside_problem

Conversation

@Lee-Jun-Hyuk-37
Copy link

Dear maintainer,

Thank you so much for creating a very useful project.
I have solved one problem and added one feature.

  1. While utilizing your project, I found one problem: when the vertex of the soccer field goes to backside of the camera, the line is drawn on the opposite side of the field from where it was intended. It is fine when both end vertices of the line go to the backside, but the problem occurs when only one of them goes to the backside. I have implemented all the exception handling for this.

When the vertex of the field went to the backside of the camera, it would look like this.
problem
problem2

However, after I fixed the problem, it looks like below, just like we expected.
problem_solved
problem_solved2

  1. I also added one more feature. Previously, when visualizing the results, we could only display the output images in 256*455 resolution that the model receives as input, but I have added an option to change the resolution of the displayed image. The "ratio_width" and "ratio_height" parameters from draw_reprojection function are the options, and if you use the default settings, you'll get the same results as before.

Followings are the examples for the options.

Let's say shape of the raw input image is (1080, 1920), and we resample the image as shape (256, 455) for input to the model.
raw_shape = (1080, 1920)
resampled_shape = (256, 455)

we can use the options as below

fig, ax = viz.init_figure(raw_shape[1], raw_shape[0])
ax = viz.draw_image(ax, raw_image)
ax = viz.draw_reprojection(ax, object3dcpu, cam, ratio_width=raw_shape[1]/resampled_shape[1], 
                           ratio_height=raw_shape[1]/resampled_shape[1])

I appreciate your work, and I hope my pull request helps for you.

Sincerely,
Lee Jun Hyuk

@jtheiner jtheiner self-assigned this May 17, 2024
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.

2 participants