Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 2
    $\begingroup$ Rescaling the way you do seems wrong, since a noise outlier at one image point completely changes the rescaled image globally. But the trouble starts before that: If $[0,1]$ is the natural interval for data, what sense does it make to model noise using naive addition? If an image point has value $1$, and there is $0.3$ noise, what does the calculation $1+0.3 = 1.3$ mean? It may be a wrong model for various reasons. An amateurish fix would be to model noise using something like addnoise[x_,noise_] := 1/Pi*ArcTan[Tan[Pi/2*(2*x-1)]+noise]+1/2, which maps $[0,1]$ to $[0,1]$. $\endgroup$ Commented Nov 8, 2022 at 15:39
  • $\begingroup$ A function you might find useful in the future is Rescale. eg foo = Rescale[nrctraindatat[[1]], MinMax@Flatten@nrctraindatat]; then foo === scaled (*True*) $\endgroup$ Commented Nov 8, 2022 at 16:04
  • $\begingroup$ related: mathematica.stackexchange.com/q/30091/60568 mathematica.stackexchange.com/q/159735/60568 $\endgroup$ Commented Nov 8, 2022 at 16:50
  • $\begingroup$ Possibly a dumb question, but would it make sense to use CosineDistance for this? $\endgroup$ Commented Dec 8, 2022 at 17:00
  • $\begingroup$ Also why aren't you just using Mathematica's built-in ImageDistance ? You also have RandomImage and ImageAdd so you don't need to use ImageData $\endgroup$ Commented Dec 3, 2023 at 22:25