Skip to content

Camera backside problem solved and visualizing resolution control added#4

Open
Lee-Jun-Hyuk-37 wants to merge 12 commits intoMM4SPA:mainfrom
Lee-Jun-Hyuk-37:main
Open

Camera backside problem solved and visualizing resolution control added#4
Lee-Jun-Hyuk-37 wants to merge 12 commits intoMM4SPA:mainfrom
Lee-Jun-Hyuk-37:main

Conversation

@Lee-Jun-Hyuk-37
Copy link

@Lee-Jun-Hyuk-37 Lee-Jun-Hyuk-37 commented Apr 10, 2023

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

Copy link
Contributor

@jtheiner jtheiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear Lee Jun,

thanks for your contributions, in particular the visualization bug.
Before accepting the merge request, please revert the changes in the README.md.

@Lee-Jun-Hyuk-37
Copy link
Author

I've reverted the changes in the README.md and opened a new pull request. Please review the new pull request.

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