mirror of
https://github.com/esimov/forensic.git
synced 2025-09-27 04:45:58 +08:00
Reformat code with linter
This commit is contained in:
15
main.go
15
main.go
@@ -4,13 +4,14 @@ import (
|
||||
"fmt"
|
||||
"image"
|
||||
"image/color"
|
||||
"image/draw"
|
||||
_ "image/jpeg"
|
||||
"image/png"
|
||||
_ "image/png"
|
||||
"image/draw"
|
||||
"math"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"go4.org/sort"
|
||||
)
|
||||
|
||||
@@ -142,9 +143,9 @@ func main() {
|
||||
dctPixels[u][v] = pixel{cr, cg, cb, cy}
|
||||
}
|
||||
}
|
||||
avr /= float64(BlockSize*BlockSize)
|
||||
avg /= float64(BlockSize*BlockSize)
|
||||
avb /= float64(BlockSize*BlockSize)
|
||||
avr /= float64(BlockSize * BlockSize)
|
||||
avg /= 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][1].y})
|
||||
@@ -195,8 +196,8 @@ func convertRGBImageToYUV(img image.Image) image.Image {
|
||||
}
|
||||
|
||||
func dct(x, y, u, v, w float64) float64 {
|
||||
a := math.Cos(((2.0*x+1)*(u*math.Pi))/(2*w))
|
||||
b := math.Cos(((2.0*y+1)*(v*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))
|
||||
|
||||
return a * b
|
||||
}
|
||||
@@ -274,7 +275,7 @@ type offset struct {
|
||||
type newVector []vector
|
||||
|
||||
// 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.
|
||||
duplicateItems := make(map[offset]int)
|
||||
|
||||
|
Reference in New Issue
Block a user