Closed kota7 closed 7 years ago
I'm sorry for the late reply,
Let me see that and If you are not in a hurry, I'll come with a solution either tomorrow or the day after tomorrow.
thanks for spotting this out, it was a bug in the (image) translation function. Please test the new version of the package using devtools::install_github('mlampros/OpenImageR') (it will take some time till the new version of the package is on CRAN) and let me know.
Hi, unfortunately, I get the same result by the above code. Can you quickly copy & paste it to see if you get the same result?
Assuming that you get the same result as I do, my humble guess is that this part is a problem:
It says if (shift_rows > 0.0 || shift_cols > 0.0)
so shifting does not occur if both shift inputs are nonpositive. I am not sure why you have this if-clause, and any side effect occurs by removing it, though.
I'm sorry, I totally forgot to change the inequality signs. I fixed it and I'll add some exception handling in the next few days. Please test it and let me know.
Terrific. Thank you for your work!
Quick check code:
library(OpenImageR)
object <- matrix(0.5, nrow=3, ncol=4)
Augmentation(object, shift_rows=-1, padded_value=1)
Augmentation(object, shift_cols=-2, padded_value=1)
Augmentation(object, shift_row=-2, shift_cols=1, padded_value=1)
Augmentation(object, shift_row=-2, shift_cols=-3, padded_value=1)
Hi, I find a weird behavior of
Augmentation
whenshift_rows
orshift_cols
is negative.So, no change in the image at all. It seems the function discounts
shift_rows
andshift_cols
by 1 when it is negative. That is, it treats -1 as 0, -2 as -1, and so on.