Open Domibor opened 5 years ago
Problem: Padding does not work when
fill
is a scalar, but the image is RGB.What happens: Using a scalar for
fill
in combination with an RGB image crashes.cvfunctional.pad()
assumes afill
of length 3 for an RGB image, but the default value ofcvtransforms.Pad()
is 0 (length 1).What should happen: If
fill
is a scaler, it should be used for all 3 channels.
I think I have fixed some bugs as your suggestion. Thanks a lot!
here is a bug: `
if isinstance(fill, numbers.Number): fill = fill, if isinstance(fill, numbers.Number) and len(img.shape) == 3: fill = (fill,) * 3
` the type of fill is changed in line 2.
第二行改变了fill的类型,变成tuple了,即使img.shape是3,第四行也不会执行了。
here is a bug: `
if isinstance(fill, numbers.Number): fill = fill, if isinstance(fill, numbers.Number) and len(img.shape) == 3: fill = (fill,) * 3
` the type of fill is changed in line 2.
第二行改变了fill的类型,变成tuple了,即使img.shape是3,第四行也不会执行了。
Thanks ! I hope I have fixed this bug properly ^^. 谢谢,我希望我已经修改好了这个问题^^
Problem: Padding does not work when
fill
is a scalar, but the image is RGB.What happens: Using a scalar for
fill
in combination with an RGB image crashes.cvfunctional.pad()
assumes afill
of length 3 for an RGB image, but the default value ofcvtransforms.Pad()
is 0 (length 1).What should happen: If
fill
is a scaler, it should be used for all 3 channels.