linux build environment updated
This commit is contained in:
@@ -2,3 +2,4 @@ data/
|
||||
log/
|
||||
bin/
|
||||
deployment/
|
||||
build/
|
||||
|
||||
@@ -11,12 +11,17 @@ RUN cd /opt && wget https://go.dev/dl/go1.20.linux-amd64.tar.gz && \
|
||||
tar -xvf go1.20.linux-amd64.tar.gz && rm go1.20.linux-amd64.tar.gz
|
||||
ENV GOROOT="/opt/go" \
|
||||
PATH="/opt/go/bin:${PATH}" \
|
||||
GOPATH="/src/build/go"
|
||||
GOPATH="/build/go"
|
||||
RUN echo 'export PATH="/opt/go/bin:${PATH}"' >> /root/.bashrc
|
||||
|
||||
RUN cd /opt && git clone -b v0.36.1 https://github.com/hybridgroup/gocv.git && cd gocv && \
|
||||
make install
|
||||
|
||||
# WORKDIR /src
|
||||
RUN cd /opt && git clone -b v0.36.1 https://github.com/hybridgroup/gocv.git && \
|
||||
cd gocv && \
|
||||
awk '{gsub(/libtbb2/, "libtbbmalloc2"); gsub(/libdc1394-22-dev/, "libdc1394-dev"); print}' Makefile > Makefile.tmp && \
|
||||
mv Makefile.tmp Makefile && \
|
||||
make install && \
|
||||
cd .. && \
|
||||
rm -rf gocv
|
||||
# WORKDIR /src
|
||||
# COPY . .
|
||||
# RUN cd /sjy01/image-proc && go mod download && make linux
|
||||
CMD ["/bin/bash", "/src/build/build.sh"]
|
||||
@@ -35,7 +35,7 @@ var procCmd = &cobra.Command{
|
||||
if err := reg.LoadAuxData(); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
// reg.AuxPrint()
|
||||
reg.AuxPrint()
|
||||
|
||||
if err := reg.LoadMssRaw(); err != nil {
|
||||
logrus.Fatal(err)
|
||||
|
||||
2
go.mod
2
go.mod
@@ -18,7 +18,6 @@ require (
|
||||
git.sr.ht/~sbinet/gg v0.5.0 // indirect
|
||||
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b // indirect
|
||||
github.com/campoy/embedmd v1.0.0 // indirect
|
||||
github.com/chfenger/goNum v0.0.0-20191211064013-a00d841c1e7b // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/go-fonts/liberation v0.3.2 // indirect
|
||||
github.com/go-latex/latex v0.0.0-20231108140139-5c1ce85aa4ea // indirect
|
||||
@@ -36,6 +35,7 @@ require (
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/mjibson/go-dsp v0.0.0-20180508042940-11479a337f12 // indirect
|
||||
github.com/nuknal/goNum v0.0.0-20240712030226-6452806523e8 // indirect
|
||||
github.com/onsi/ginkgo v1.16.5 // indirect
|
||||
github.com/onsi/gomega v1.33.1 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||
|
||||
2
go.sum
2
go.sum
@@ -1139,6 +1139,8 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
||||
github.com/nuknal/goNum v0.0.0-20240712030226-6452806523e8 h1:60bNUZxoFtsfTSGMofxvS2ptpc8Z7ZEYDV8/gY+T2t4=
|
||||
github.com/nuknal/goNum v0.0.0-20240712030226-6452806523e8/go.mod h1:so7VgmHzfp+FIBqvjXUrU9mjRxEKIHu2QsPvlt/hdBc=
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
|
||||
@@ -73,9 +73,9 @@ func (r *Registrator) AuxPrint() {
|
||||
|
||||
for _, p := range r.auxHeads {
|
||||
tp := float64(p.TimeSec) + float64(p.TimeSecFrac)/10e6
|
||||
X := utils.InterpPolynomial(r.w84PositionTime, r.w84PositionX, tp)
|
||||
Y := utils.InterpPolynomial(r.w84PositionTime, r.w84PositionY, tp)
|
||||
Z := utils.InterpPolynomial(r.w84PositionTime, r.w84PositionZ, tp)
|
||||
X := utils.InterpPolynomial(r.w84PositionTime, r.w84PositionX, tp, 2)
|
||||
Y := utils.InterpPolynomial(r.w84PositionTime, r.w84PositionY, tp, 2)
|
||||
Z := utils.InterpPolynomial(r.w84PositionTime, r.w84PositionZ, tp, 2)
|
||||
lat, lon, _ := calculator.WGS84XYZtoLatLngH(X, Y, Z)
|
||||
point := orb.Point{lon, lat}
|
||||
fcPos84Interp.Features = append(fcPos84Interp.Features, geojson.NewFeature(point))
|
||||
@@ -116,17 +116,18 @@ func (r *Registrator) SetSceneBoundary(scene *Scene) (topLeft, bottomRight orb.P
|
||||
// FIXME: GPS 拟合效果不佳
|
||||
// x0 := float64(r.auxHeads[startPosInAux].TimeSec) + float64(r.auxHeads[startPosInAux].TimeSecFrac)/10e6
|
||||
// x1 := float64(r.auxHeads[endPosInAux].TimeSec) + float64(r.auxHeads[endPosInAux].TimeSecFrac)/10e6
|
||||
// startPos84 := []float64{r.w84FitPre[0].Predict(x0), r.w84FitPre[1].Predict(x0), r.w84FitPre[2].Predict(x0)}
|
||||
// endPos84 := []float64{r.w84FitPre[0].Predict(x1), r.w84FitPre[1].Predict(x1), r.w84FitPre[2].Predict(x1)}
|
||||
// startPos84 := []float64{
|
||||
// utils.InterpPolynomial(r.w84PositionTime, r.w84PositionX, x0),
|
||||
// utils.InterpPolynomial(r.w84PositionTime, r.w84PositionY, x0),
|
||||
// utils.InterpPolynomial(r.w84PositionTime, r.w84PositionZ, x0),
|
||||
// startPos84 = []float64{r.w84FitPre[0].Predict(x0), r.w84FitPre[1].Predict(x0), r.w84FitPre[2].Predict(x0)}
|
||||
// endPos84 = []float64{r.w84FitPre[0].Predict(x1), r.w84FitPre[1].Predict(x1), r.w84FitPre[2].Predict(x1)}
|
||||
// stepN := 2
|
||||
// startPos84 = []float64{
|
||||
// utils.InterpPolynomial(r.w84PositionTime, r.w84PositionX, x0, stepN),
|
||||
// utils.InterpPolynomial(r.w84PositionTime, r.w84PositionY, x0, stepN),
|
||||
// utils.InterpPolynomial(r.w84PositionTime, r.w84PositionZ, x0, stepN),
|
||||
// }
|
||||
// endPos84 := []float64{
|
||||
// utils.InterpPolynomial(r.w84PositionTime, r.w84PositionX, x1),
|
||||
// utils.InterpPolynomial(r.w84PositionTime, r.w84PositionY, x1),
|
||||
// utils.InterpPolynomial(r.w84PositionTime, r.w84PositionZ, x1),
|
||||
// endPos84 = []float64{
|
||||
// utils.InterpPolynomial(r.w84PositionTime, r.w84PositionX, x1, stepN),
|
||||
// utils.InterpPolynomial(r.w84PositionTime, r.w84PositionY, x1, stepN),
|
||||
// utils.InterpPolynomial(r.w84PositionTime, r.w84PositionZ, x1, stepN),
|
||||
// }
|
||||
// ------------------ 使用定姿态四元数计算图像边界 ------------------
|
||||
log.Info("using attitude quaternion to calculate image boundary...")
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
"github.com/chfenger/goNum"
|
||||
"github.com/nuknal/goNum"
|
||||
)
|
||||
|
||||
type LagrangeInterpolator struct {
|
||||
|
||||
@@ -46,13 +46,13 @@ func (p PolynomialInterpolator) Predict(x float64) float64 {
|
||||
return y
|
||||
}
|
||||
|
||||
func InterpPolynomial(x []float64, y []float64, xq float64) float64 {
|
||||
func InterpPolynomial(x []float64, y []float64, xq float64, degree int) float64 {
|
||||
if len(x) != len(y) {
|
||||
return 0.0
|
||||
}
|
||||
|
||||
start, end := FindClosestSubset(x, xq, 4)
|
||||
interp := &PolynomialInterpolator{Degree: 3}
|
||||
start, end := FindClosestSubset(x, xq, degree+1)
|
||||
interp := &PolynomialInterpolator{Degree: degree}
|
||||
interp.Fit(x[start:end+1], y[start:end+1])
|
||||
return interp.Predict(xq)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user