This program is used to achieve this kind of photo effect.
OpenCV Boost
There are three command line parameters you need to specify.
The first is the folder where you put your image database.
The second is the target image.
The third is the size of the image block.
e.g.
C:\Users\jianh\Desktop\py\results C:\Users\jianh\Desktop\mmexport1526359945110.jpg 5