When you do "dmode = excm", you're only binding the variable name "dmode" to the reference "excm". They point to the same underlying object. You could try "dmode = copy(excm)"
On Mon, Nov 23, 2015 at 4:38 PM, Fliprl Data <[email protected]> wrote: > > > I'm a newbie in Julia, I really appreciate if you could help me on this. > > I had issues when using piece of code below. Apparently, the original > variable (excm) is changed, so when I type ImageView.view(excm) before and > after the routine, it is changed, but I'm only manipulating a copy of it > (dmode). I have a similar issue when copying properties of one image to > another. > > ImageView.view(excm) > dmode = excm; > for i in 2:206 > for j in 2:206 > surr = length(dmode[i-1:i+1,j-1:j+1] .< 0.2) > if surr > 4 dmode[i,j] = 0 end > end > end > ImageView.view(excm) > > note: once I ran the code ImageView.view(excm) shows me a modified version > of excm, even if I'm modifying dmode only. > > How can I create copies of the image without changing the original, I > guess I don't know how to assign it. > > thanks a lot, >
