Skip to content
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

focal scale #4

Closed
songxujay opened this issue Mar 30, 2022 · 8 comments
Closed

focal scale #4

songxujay opened this issue Mar 30, 2022 · 8 comments

Comments

@songxujay
Copy link

Dear author:

I have a question about the focal result. I see you resize the input image by:

  image = cv2.resize(image, dsize=(self.input_width, self.input_height))

Then the resized image will be inputted into the model. Following, the focal result will be obtained by fov and original size.

Therefore, do you mean the focal length has no relationship with the change of the size of the image? Becasue the input image size of the model is 512x512, but the original image size is 640x640.

Thank you!
Best regards!

@jwlee-vcl
Copy link
Owner

Thank you for your interest in our research.

In conclusion, resizing the image doesn't change the FoV.
As you said, the focal length in pixels is proportional to the size of the image, so resizing the image will also affect the focal length.
FoV is proportional to the ratio of image size to focal length. So our network outputs FoV.

@songxujay
Copy link
Author

songxujay commented Mar 30, 2022

Thank you for your reply! @jwlee-vcl

I got the idea. Fov is not changed. So after getting the predicted fov, using original size, not the resized size, I can get the focal length. And the obtained focal length is in pixels. Am I right?

@jwlee-vcl
Copy link
Owner

Thank you for your reply! @jwlee-vcl

I got the idea. Fov is not changed. So after getting the predicted fov, using original size, not the resized size, I can get the focal length. And the obtained focal length is in pixels. Am I right?

Yes, you are right the way you thought.

@songxujay
Copy link
Author

Understood, thank you so much!

@songxujay
Copy link
Author

Hello author @jwlee-vcl :

As you mentioned that " resizing the image doesn't change the FoV."

I have thought about this meaning, and I want to communicate with you again.

Fov decides the view of the camera, in another word, how many things can be captured is up to the fov. So whatever size you have changed(640x640->512x512 or 640x640->600x500), the things in the image will not be less or more, the number of the things is always the same. Thus resizing the image will not change the fov. But if the image is cropped, the fov will be changed.

The above is my understanding, am I right?

Thank you very much!

@jwlee-vcl
Copy link
Owner

Hello author @jwlee-vcl :

As you mentioned that " resizing the image doesn't change the FoV."

I have thought about this meaning, and I want to communicate with you again.

Fov decides the view of the camera, in another word, how many things can be captured is up to the fov. So whatever size you have changed(640x640->512x512 or 640x640->600x500), the things in the image will not be less or more, the number of the things is always the same. Thus resizing the image will not change the fov. But if the image is cropped, the fov will be changed.

The above is my understanding, am I right?

Thank you very much!

FoV is defined separately for the horizontal and vertical orientation of the image. In the field of CV, FoVy, which is usually a vertical FoV, is often used.
As you said, FoV does not change when an image is resized, but FoV does change when an image is cropped.

@songxujay
Copy link
Author

ok, thank you for your explanation. I will spend my time digging into this area, thank you very much. One thing I want to declare, resizing has different ways, like 640x640 -> 512 x512 will keep the aspect ratio, but 640x640-> 600x500 will break the aspect ratio. But these two ways will don't influence the fov, right?

@ZhiguoZhao
Copy link

Yes, the field of view will not change unless the image is cropped or the shooting distance is changed. However, the closer the shooting distance is, the smaller the field of view will be. In addition, if the distortion correction function of the lens itself is used, it will also affect the field of view.The field of view should not be affected as long as the image is not cropped.

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

No branches or pull requests

3 participants