Continuous shooting for detailed photography
Exposure Control
In conventional photography, exposure is controlled by aperture, ISO, and shutter speed, plus white balance and color palette. Tabletop photography is mostly about static scenes, so you do not need to influence exposure time directly.
Despite the webcam's good adaptation to ambient light, you will want to use several light sources to ensure optimal illumination of the scene. You can do without the automatic mode, especially for continuous shooting. If possible, leave brightness, contrast, saturation, and gain (comparable to ISO) at medium values.
Color adjustment is mainly achieved with white balance; make sure you do not tweak the settings too quickly. Gradual, small changes will give you the best results. Figure 8 shows an example of the differences between automatic and manual white balance.
![](/var/linux_magazin/storage/images/issues/2022/254/miniature-photography/figure-8/796491-1-eng-US/Figure-8_large.png)
The automatic white balance delivers very cold colors, and the break in the background can still be seen. A color temperature of 5500 Kelvin improves the white areas in particular. The background is also now evenly black thanks to the manual white balance. Some caution is required with saturation; otherwise, you can easily go too far.
Processing Continuous Shooting
After you have completed the image settings, let the camera do its work. In the example, I used a webcam with rolling shutter, which streams to the USB port. The image data is buffered for transfer. For a still image, the application reads individual frames from a buffer area (Listing 3).
Listing 3
usbCamMover.py – Saving Frames
[...] for i in range(4): # Read buffer cam.grab() ret, frame = cam.read() # Take a picture cv2.imwrite(img_name, frame) # Save image [...]
The image is saved, the focus setting is updated, and the next image follows. An inner loop iterates through the focus range, whereas, in an outer loop, the program moves to the capture positions. Finally, it returns the camera to the starting point and asks how to proceed. The file references comprise the directory name, the project name, a prefix, the camera position, and the focus value, followed by the image format. This way, each image can be mapped uniquely.
You can run the program on the Raspberry Pi with HDMI and a mouse as a standalone setup, but it is better to use VNC on the host. You would be transferring the image directories to the host anyway with an FTP client so you can run an image processing program for stacking.
Conclusions
The first webcams transmitted images of a coffee machine at Cambridge University in 1991 and went online starting in 1993. The now world-famous coffee machine was auctioned off in 2001, repaired by the manufacturer, and on the web until 2015. Today, people prefer to stream urban situations, or participants in an online conference put themselves in the picture.
Now that webcams deliver a resolution of 8Mpx and many industrial applications work with USB cameras, you can give them a try in photography. Miniature and tabletop photography with continuous shooting are options; easy handling, program control, and a decent image quality make the venture seem promising. A Raspberry Pi 4 controlling the setup rounds off the tabletop scenario.
Infos
- Pi Camera Module 2: https://www.raspberrypi.org/products/camera-module-v2
- Pi Camera Module 2 NoIR: https://www.raspberrypi.org/products/pi-noir-camera-v2
- Pi Camera: https://picamera.readthedocs.io
- Raspberry Pi High Quality Camera: https://www.raspberrypi.org/products/raspberry-pi-high-quality-camera
- Microsoft LifeCam Cinema: https://www.microsoft.com/de-de/d/lifecam-cinema/94f910x3714n
- Logitech C920 HD Pro: https://www.logitech.com/de-de/products/webcams/c920-pro-hd-webcam.960-001055.html
- Logitech Brio: https://www.logitech.com/de-de/products/webcams/brio-4k-hdr-webcam.960-001106.html
- MacroFusion: https://sourceforge.net/projects/macrofusion/
- Code for this article: ftp://ftp.linux-magazine.com/pub/listings/linux-magazine.com/254
« Previous 1 2 3
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.