Open jiayinghoutonghua opened 6 years ago
thank you,i have made this similar functions,but i just want to blur part region of image,
If you already have the function, you could use Lambda
to add it to a sequential, e.g.:
def func_images(images, random_state, parents, hooks):
images[:, ::2, :, :] = 0
return images
def func_keypoints(keypoints_on_images, random_state, parents, hooks):
return keypoints_on_images
seq = iaa.Sequential([
iaa.Lambda(
func_images=func_images,
func_keypoints=func_keypoints
)
])
This replaces every second row in images with black pixels and leaves keypoints unchanged.
If you don't have keypoints, you can just set func_keypoints=None
.
you are so nice sincerely,thank you. but can you add one motion_blur function to your source code?
Last time I looked into that I couldn't find any preimplemented motion blur functions in python or good implementations on how to implement one in pseudocode. If I find anything like that, I can add it to the library.
I think motion blur function has since been added to the repository and works great. The only issue is that even as the object in the image rightly appears to move after the application of motion blur there is no corresponding transformation of keypoints or heatmaps from original labels possible at this moment. I am looking into implementing this right now, but just wanted to ask if people are aware of this issue? Thank you!
There is no augmenter yet that adds motion blur, if that is what you mean. If you want to build your own one and have a motion blur function ready, you could maybe look at
GaussianBlur
inimgaug/augmenters/blur.py
, which I guess would be the most similar augmenter. Just copy-paste it and change the necessary functions.