Skip to content

Commit 2fe6f00

Browse files
authored
detector response bug fix 2, mnlocs (#40)
1 parent d5957e2 commit 2fe6f00

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1212
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
1313
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
1414
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
15+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1516
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1617
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
1718

@@ -23,6 +24,7 @@ LoopVectorization = "0.12.173"
2324
LieGroups = "0.1"
2425
RecursiveArrayTools = "3.27.0"
2526
Rotations = "1"
27+
SparseArrays = "1"
2628
StaticArrays = "1"
2729
StatsBase = "0.34"
2830
julia = "1.10"

src/CameraModels.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module CameraModels
33
using LinearAlgebra
44
using LieGroups
55
using DocStringExtensions
6+
using SparseArrays
67
using StaticArrays
78
using FixedPointNumbers
89
using StatsBase

src/services/RadianceCorrection.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function solveDetectorResponse(
166166
# logExposure] zeros(n)]
167167
#
168168
neqs = sum(mnlocs.*mnimgs) + 1 + n
169-
A = zeros(neqs,n+nlocs)
169+
A = spzeros(neqs,n+nlocs)
170170
b = zeros(neqs)
171171

172172
# Fill in the equations from pixel value observations in A and b,
@@ -184,7 +184,7 @@ function solveDetectorResponse(
184184
# A2 columns correspond to logExposure of observed pixels from list of locations i
185185
pixz1 = Z[j][i] + 1
186186
miloc = offset+n+i
187-
a_12 = view(A, k, [pixz1, miloc])
187+
a_12 = view(A, k, SA[pixz1, miloc])
188188
a_12 .= window[pixz1] .* SA[1, -1]
189189
b[k] = window[pixz1] * logΔTs[j]
190190
k += 1
@@ -211,7 +211,7 @@ function solveDetectorResponse(
211211
x = A\b
212212

213213
# Extract gcurve and log exposure values from solution vector
214-
gcurve = x[1:n]
214+
gcurve = collect(x[1:n])
215215
logExposure = x[(n+1):end]
216216
return gcurve, logExposure
217217
end

0 commit comments

Comments
 (0)