jwlee-vcl / CTRL-C

Apache License 2.0
101 stars 13 forks source link

focal scale #4

Closed songxujay closed 2 years ago

songxujay commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Understood, thank you so much!

songxujay commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

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.