Comments (10)
Hello!
The intrinsics in kitti_dataset are normalized. So, you need to do
K[0,:] /= image_width
K[1,:] /= image_height
Make sure to use the image resolution of the original files that were used for calibration.
Regards,
Daniyar
from monodepth2.
Ok, thanks a lot.
Best regards,
Ambroise
from monodepth2.
@bl0up Could you please let me know the intrinsics value for the cityscapes dataset?
from monodepth2.
@ezorfa Sure, I used this matrix:
self.K = np.array([[2262.52 / 2048, 0, 0.5, 0],
[0, 1096.98 / 1024, 0.5, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]], dtype=np.float32)
from monodepth2.
@bl0up Thankyou so much for quick reply! Appreciated.
from monodepth2.
@ezorfa @bl0up There is a mistake in your intrinsics matrix
In the very large majority of cases you should have fx = fy
(unless you have an anamorphic lens)
Here is a single calibration from a cityscapes sequence:
{
"extrinsic": {
"baseline": 0.209313,
"pitch": 0.038,
"roll": 0.0,
"x": 1.7,
"y": 0.1,
"yaw": -0.0195,
"z": 1.22
},
"intrinsic": {
"fx": 2262.52,
"fy": 2265.3017905988554,
"u0": 1096.98,
"v0": 513.137
}
}
Thus the intrinsics matrix should be:
self.K = np.array([[2262 / 2048, 0, 0.5, 0],
[0, 2262 / 1024, 0.5, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]], dtype=np.float32)
from monodepth2.
@bl0up @mrharicot Hmm.. I see the mistake. Thankyou!
from monodepth2.
@mrharicot @daniyar-niantic Please clarify this:
When I prepare the cityscapes data using https://github.com/anuragranj/cc/blob/afd407869b89d61ee6911b13659e8d1c39dc3634/data/prepare_train_data.py, then the images are cropped (to remove car logo) and the resultant shape would be 2048 X 768 .
Will the intrinsics remain the same value as :
self.K = np.array([[2262 / 2048, 0, 0.5, 0], [0, 2262 / 1024, 0.5, 0], [0, 0, 1, 0], [0, 0, 0, 1]], dtype=np.float32)
or should I divide by img_height = 768 instead?
from monodepth2.
@mrharicot In my understanding, for the resultant image size of (img_width=2048 , img_ht = 768) the intrinsics value should be:
self.K = np.array([[2262 / 2048, 0, 1096 / 2048, 0],
[0, 2262 / 768, 513 / 768, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]], dtype=np.float32)
Could you please verify the u0 and v0 values?
Thankyou!
from monodepth2.
@ezorfa for simplicity we did set the principal point to the center of the image, which is slightly inaccurate but has little impact in practice and makes horizontal flipping easy as there is no need to change the intrinsics
if you crop the bottom part of the image, you will need to recompute the location of the principal point.
see here for more details https://github.com/BerkeleyAutomation/perception/blob/master/perception/camera_intrinsics.py#L184
if you also resize the image you will also need to scale the vertical focal length by the inverse ratio of heights
from monodepth2.
Related Issues (20)
- About the test set used for demo HOT 1
- Why is the test result not good after training on the dataset you have created? HOT 1
- I don't know if auto mask works well. HOT 2
- Pose (decoder) network - forward method mismatch of convolutional operation (pconv0, table 5 on paper) HOT 2
- While reading groundtruth depth-map, why is it required to divide by 256 after converting PIL.Image to np.array ? HOT 2
- finetune on custom dataset with provided model HOT 1
- onnx
- What are the units in which the results are predicted HOT 2
- A problem when I train my repo code HOT 1
- Can't run the initial training
- Network inference time problem
- The requested array has an inhomogeneous shape after 1 dimensions. HOT 5
- Write split file HOT 1
- obtained some very strange depth maps HOT 4
- The difference in the intrinsic matrix affects the results
- Question about image resolution
- question for the Data Preparation
- Why is smooth_loss divided by 2**scale?
- Questions about the meaning of grid in the F.grid_sample function
- the eval file about 'gt_depths.npz'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monodepth2.