mirror of
https://github.com/esimov/forensic.git
synced 2025-10-01 23:02:25 +08:00
Reformat code with linter
This commit is contained in:
15
main.go
15
main.go
@@ -4,13 +4,14 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"image"
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
|
"image/draw"
|
||||||
_ "image/jpeg"
|
_ "image/jpeg"
|
||||||
"image/png"
|
"image/png"
|
||||||
_ "image/png"
|
_ "image/png"
|
||||||
"image/draw"
|
|
||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go4.org/sort"
|
"go4.org/sort"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -142,9 +143,9 @@ func main() {
|
|||||||
dctPixels[u][v] = pixel{cr, cg, cb, cy}
|
dctPixels[u][v] = pixel{cr, cg, cb, cy}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
avr /= float64(BlockSize*BlockSize)
|
avr /= float64(BlockSize * BlockSize)
|
||||||
avg /= float64(BlockSize*BlockSize)
|
avg /= float64(BlockSize * BlockSize)
|
||||||
avb /= float64(BlockSize*BlockSize)
|
avb /= float64(BlockSize * BlockSize)
|
||||||
|
|
||||||
features = append(features, feature{x: block.x, y: block.y, val: dctPixels[0][0].y})
|
features = append(features, feature{x: block.x, y: block.y, val: dctPixels[0][0].y})
|
||||||
features = append(features, feature{x: block.x, y: block.y, val: dctPixels[0][1].y})
|
features = append(features, feature{x: block.x, y: block.y, val: dctPixels[0][1].y})
|
||||||
@@ -195,8 +196,8 @@ func convertRGBImageToYUV(img image.Image) image.Image {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func dct(x, y, u, v, w float64) float64 {
|
func dct(x, y, u, v, w float64) float64 {
|
||||||
a := math.Cos(((2.0*x+1)*(u*math.Pi))/(2*w))
|
a := math.Cos(((2.0*x + 1) * (u * math.Pi)) / (2 * w))
|
||||||
b := math.Cos(((2.0*y+1)*(v*math.Pi))/(2*w))
|
b := math.Cos(((2.0*y + 1) * (v * math.Pi)) / (2 * w))
|
||||||
|
|
||||||
return a * b
|
return a * b
|
||||||
}
|
}
|
||||||
@@ -274,7 +275,7 @@ type offset struct {
|
|||||||
type newVector []vector
|
type newVector []vector
|
||||||
|
|
||||||
// Analyze pair of candidate and check for similarity by computing the accumulative number of shift vectors.
|
// Analyze pair of candidate and check for similarity by computing the accumulative number of shift vectors.
|
||||||
func checkForSimilarity(vect []vector)newVector {
|
func checkForSimilarity(vect []vector) newVector {
|
||||||
//For each pair of candidate compute the accumulative number of the corresponding shift vectors.
|
//For each pair of candidate compute the accumulative number of the corresponding shift vectors.
|
||||||
duplicateItems := make(map[offset]int)
|
duplicateItems := make(map[offset]int)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user