torch / image

An Image toolbox for Torch.
Other
208 stars 141 forks source link

global y1 variable in image/init.lua? #177

Closed bnsh closed 8 years ago

bnsh commented 8 years ago

So, I was tracking down where y1 was getting defined in my programs, and I believe it's actually not in my program, it's in image/init.lua... (I'm not really sure tho..)

So, in init.lua in crop I see

elseif format == 'tl' then
   x1, y1 = 0,0

It's actually all throughout all those cases. My suspicion is that "x2" was meant to be "y1", given that I don't see x2 being used anywhere else in there. In any case, here's how I replicate the problem:

require "image"

assert(_G["y1"] == nil)
tt = torch.randn(3,256,256)
cropped = image.crop(tt, "c", 224, 224)
assert(_G["y1"] == nil, "Where was y1 defined??")