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.
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.
News
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.