-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default values for shifted images by Augmentation? #6
Comments
I'm sorry for the late reply, If you are not in a hurry, I'll come with a fix either tomorrow or the day after tomorrow. |
I added the padded_value parameter to both the Augmentation and the translation functions. Besides 0 it can take posiitve, negative or float values. Please test the new version 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, thanks for your quick response! It now works good for my case (matrix image). I have a suggestion for 3d-array case. library(OpenImageR)
object <- array(1, dim = c(10, 10, 3))
Augmentation(object, shift_rows=2, padded_value=0.5) The code above pads a certain value into all three dimension. Some may wish to pad by red, i.e. Augmentation(object, shift_rows=2, padded_value=c(1,0,0))
#Error in augment_transf_array(image, flip_mode, crop_height, crop_width, :
# expecting a single value Allowing padded values of vector of size equal to the channel dimension size can be a good enhancement. |
I added the functionality that you suggested in both translation and Augmentation functions. The padded_value parameter can be either a numeric value (of length 1) or a numeric vector (of length equal to the dimensions of the array). I'll add exception handling in the next few days. Please test it and let me know. |
Beautiful. It works great. Quick check I have run: library(OpenImageR)
object <- matrix(1, nrow=2, ncol=5)
Augmentation(object, shift_cols=1, padded_value=-5)
object <- array(1, dim = c(4, 2, 3))
Augmentation(object, shift_rows=1, padded_value=0.5)
Augmentation(object, shift_rows=1, padded_value=c(3,4,5)) |
Hi, I have a matrix representing a gray-scale image like below.
In this matrix, 0 represents black and 1 represents white.
This looks like
When I used
Augmentation
function withshift_rows
orshift_cols
options, I get the following.This looks like below.
So, the padded value is always 0, where I want to use 1 to fill and I could not find a way to choose it.
It would be great if I can freely chose the default value to be filled in.
Thanks.
The text was updated successfully, but these errors were encountered: