After reading an article about slit shooting a few months ago, I firmly decided to write a small utility that allows you to create slit photos. Shaking up the bins, I discovered the following resources: a python delayed training course , an old laptop, a GoPro camera, a few hours of free time, the month of March, and a bird feeder. Observing the intense traffic of tits at the trough, I had no doubt that it would be “like two bytes to send” to photograph a titmouse in flight. Having set the camera on a tripod, I pushed it to the edge and, having turned on the frame-by-frame shooting mode with an interval of 0.5 seconds, hid in the house. Titmies returned in a couple of minutes. After waiting another five minutes, I happily ran out onto the terrace, grabbed the camera and rushed to the laptop. What was my disappointment when in half an hour I saw the processed results of the shooting - alternating light and dark horizontal stripes with small waving of vertical “slices” of blue-headed birds, several pixels wide. It looks like titmouse flew too fast.
It does not matter, we will move the camera to the sports video mode (60 frames / second) and try again. Titmies obviously got used to the tripod, so the air traffic recovered after a few seconds. An hour later, I was the proud owner of a series of photographs taken at intervals of 1/60 sec. ( ffmpeg helped a lot in decomposing video in the photo). I was sure of success. But the result still turned out to be deplorable - strips of tits became a little wider, but they did not form a coherent picture. After analyzing (by a close look) several photo series, it became clear that titmouses fly not just quickly, but very quickly. From the moment when the titmouse takes off before it dissolves among the trees, it takes less than 0.3 seconds! ')
That is, to make a slit photo of a flight of a tit at least 120px wide, you need to shoot at 400 frames / second! It was a fiasco.
In deep thought, after tearing the child away from playing MineCraft and putting the skis on him, I went on a ski trip. I took the camera with me. The child, imbued with my problem, suggested - “Dad, can you shoot a fire in a ski lodge?”.
Eureka! After walking a few kilometers down the slopes, we reached the hut. Having built a fire and put the sausages to be grilled, I strengthened the camera opposite ...
After spending an hour or two in the hut, we were full and satisfied back home.
The result was curious, but boring:
Scratching the back of my head, I decided to add the -hz switch to the code so that the slit photo could be made not only a vertical slit, but also a horizontal one. This time everything turned out to be much more interesting:
Corresponding to the slit photo video fragment:
The slit photo shows the entrance, exit, and again the entrance of my son through the space-time window. Pay attention to the sinusoidal distortion of the door leaf! The intuitively guessed slit displacement (600px, ~ 55% of the photo height) turned out to be the most interesting, the run through the remaining offsets did not give such an impressive result.
Brief conclusions: Search for suitable objects for the slit photo - the occupation is exciting and exciting. Slit photo is not just another effect, but a very interesting and funny view of the world. I hope that the simple code below will lower the threshold for you to enter it. Good luck!
PS <pensively> Where can I get a camera with a frequency of 400 frames / second? </ Pensively> Do you have, by any chance?
#Slit-scan photography #CopyLeft 2013 OlloSnow import os, Image, argparse def add_slice(img_slt, img, offst, wdth, hz, num): if hz: img_tmp = img.crop((0, offst, img.size[0], offst+wdth)) img_slt.paste(img_tmp, (0, num*wdth, img.size[0], (num+1)*wdth)) else: img_tmp = img.crop((offst, 0, offst+wdth, img.size[1])) img_slt.paste(img_tmp, (num*wdth, 0, (num+1)*wdth, img.size[1])) return def main(): parser = argparse.ArgumentParser(usage=\ '%(prog)s dir_images res_image [-hz] [-o slit_offset] [-w slit_width] [--help]') parser.add_argument('dir_img', type = str,\ help = 'images directory') parser.add_argument('res_img', type = str,\ help = 'result slit-scan image') parser.add_argument('-hz', '--horizontal', action='store_true',\ help = 'horizontal orientation of the slit (vertical by default)') parser.add_argument('-o', '--offset', type = int, default = 0,\ help = 'slit offset (pixels; 0 by default)') parser.add_argument('-w', '--width',type = int, default = 1,\ help = 'slit width (pixels; 1 by default)') args = parser.parse_args() filenames = sorted(os.listdir(args.dir_img)) img = Image.open(os.path.join(args.dir_img, filenames[0])) if args.horizontal: width = img.size[0] height = len(filenames)*args.width else: width = len(filenames)*args.width height = img.size[1] img_slt = Image.new('RGB',(width,height)) max_i = len(filenames) for i, file in enumerate(filenames): img = Image.open(os.path.join(args.dir_img, file)) add_slice(img_slt, img, args.offset, args.width, args.horizontal, i) print max_i - i, '\r', img_slt.save(args.res_img, 'JPEG') if __name__ == "__main__": main()