ImageMagick comes with a tool to perform batch image transforms, it is called mogrify. To perform a resize of a set of images keeping the aspect ratio and padding with a white background we can use the following command,
mogrify -resize 100x100 -background white -gravity center -extent 100x100 -path ./resize_directory *.png
This command resizes all png images in the directory to a 100x100 and pads with white to keep the aspect ratio.
Due to python 2 and 3 it usual to have different version of installs working. A smooth method for installing packages using pip for different versions is to call pip via the python version. Like this (for Ubuntu python version 3.5),
Sometimes we want to install a build to a different directory. In CMake this can be done by setting the CMAKE_INSTALL_PREFIX variable. When we are building OpenCV3 for examle we would do,
ImageMagick comes with a tool to perform batch image transforms, it is called mogrify. To crop a specific rectangular area in all images in a directory the formula looks like this,
This crops a 300x300 rectangle whos top is positioned at 290x170 from all the png images in the current directory and saves them to the directory myCroppedFilesDir(make sure the dir exists before you run).