depth_fm.data.image_processing.sun_vector¶
sun_vector ¶
Sun-vector estimation from elevation + orthoimage pairs.
estimate_sun_vector_ols— Ordinary least squares (deprecated: can produce negative sz).estimate_sun_vector_irls— Robust IRLS with decoupled ambient estimate and enforced positive sz. Use this.
estimate_sun_vector_ols ¶
estimate_sun_vector_ols(dtm: Tensor, ortho: Tensor, valid_mask: Tensor) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]
Estimates the sun vector [sx, sy, sz] using Ordinary Least Squares.
Handles shapes (C, H, W) or (1, C, H, W). Batch size must be 1.
Source code in src/depth_fm/data/image_processing/sun_vector.py
estimate_sun_vector_irls ¶
estimate_sun_vector_irls(dtm: Tensor, ortho: Tensor, valid_mask: Tensor, max_iter: int = 15, tol: float = 0.0001) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]
Decoupled IRLS sun-vector estimator.
Separates ambient light estimation from the linear system to prevent the Nz / bias collinearity trap from inverting the sun vector. Returns (sun_vec, intensity, ambient).
Source code in src/depth_fm/data/image_processing/sun_vector.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |