this package calucurate MSE/PSNR. "gocv.io/x/gocv"
package is required.
PSNR is most easily defined via the mean squared error (MSE). Given a noise-free m×n monochrome image I and its noisy approximation K, MSE is defined as:
this repository prepares Dockerfile for running OpenCV with Go
make run CMD="go run cmd/gopsnr/main.go img1.jpeg img2.jpeg"
compare: img1.jpeg & img2.jpeg
[MSE] value: +4.092628e-002 [PSNR] value: +6.201078e+001
package main
import (
"log"
"os"
"github.com/po3rin/gopsnr"
)
func main() {
println("compare:", os.Args[1], "&", os.Args[2])
mse, psnr, err := gopsnr.ExecWithFileName(os.Args[1], os.Args[2])
if err != nil {
log.Fatal(err)
}
println("[MSE] value:", mse, "[PSNR] value:", psnr)
}
画像処理の基本的なアルゴリズムをgolangで復習 1(平滑化) Image Quality Assessment through FSIM, SSIM, MSE and PSNR―A Comparative Study