Search code examples
pythonimage-processingmachine-learningpython-imaging-libraryobject-detection

python image processing library has filters(distortion, lights) used for generate dataset


I'm try to generate a dataset used for object detection(about 1e6 pictures). I have images of objects, and backgrounds. But I think adding some filters on objects & objects+background is good for model training. After investigation, I found I have to use those following filters:

  1. distortion, including shear with curve, distortion with sphere

  2. cast lights on the img.

  3. other simple filter like rotate, resize, blur, noisy, color gradation...

I wonder if there is any library, which is simple to use(input args + [w, h, 4], return [w, h, 4]), natural, fast, and most of all, it can add lights and lens light on img and distort it.

Or any library that can work with python during mxnet training.

ORG IMG1

Distortion1

ORG2

Distortion2

Lights

After observing Photoshop, I have tried to make my own filters using sphere, ellipse and para-curve formulas by PIL, opencv and scimage, However, those filters are not natural and not as good as Photoshop does.

I also tried gimp-python, but I want to use it in a pure python program and I want to process the pictures during training. Maybe speed is really important.


Solution

  • These blog seems a practical way of distortion: http://paulbourke.net/miscellaneous/imagewarp/