Continuous shooting for detailed photography

On the Table

© Lead Image © 3355m, 123RF.com

© Lead Image © 3355m, 123RF.com

Article from Issue 254/2022
Author(s):

The combination of a web camera, Raspberry Pi, and simple software facilitates miniature tabletop photography.

Photographers often rely on tabletop photography to take product photos for advertising campaigns or illustrations for magazines. Even a digital camera or smartphone is up to this task, but you have good reasons to look into USB and web cameras, as well. Armed with a 4K USB camera, a focus distance of 3cm, an integrated zoom function, and a Raspberry Pi with USB 3.0 ports, tabletop photographers can embark on their mission.

Raspberry Pi Cameras

Currently, the Raspberry Pi Foundation officially supports the V2 camera module (also available in the NoIR variant) and the Pi High Quality (Pi HQ) camera. The V2 module was introduced as the successor to the V1 module in 2016. The predecessor was based on an OmniVision 5647 sensor with a resolution of 5 megapixels (Mpx). In contrast, a Sony IMX219 sensor with 8Mpx is used in the V2 camera [1]. In contrast to the regular module, the NoIR camera lacks an infrared filter but otherwise has the same features [2].

The cameras have a fixed focus starting at a distance of about 70cm to the subject and with a fixed focal length. They are connected to the computer with a ribbon cable via the camera serial interface (CSI). The multimedia abstraction layer (MMAL) and Video4Linux (V4L) APIs are then used for access. You can control the cameras directly with console commands, and you have an extensive Python library for camera control with the picamera package [3].

The Pi HQ camera [4] lets you attach C- or CS-mount lenses with the appropriate adapter. The sensor is a 12Mpx Sony IMX477R chip. The sensor measures 7.9mm diagonally and features a resolution of 4056x3040px. The 6mm lens covers the close-up range nicely, thanks to the short focus distance. However, the manual focus and aperture settings have a disadvantage.

An extensive repertoire of lenses from macro to telephoto is available for both the V2 modules and the Pi HQ. Moreover, the Raspberry Pi cameras offer solutions for a wide range of video applications. I look into what you can achieve with USB cameras in the field of still images, paying special attention to miniature photography.

Web and USB Cameras

Modern webcams stream their signals to a computer over USB and range from inexpensive, entry-level models to high-quality cameras for industrial image processing. All serve their purpose, but good image quality has its price.

In experiments I conducted, the Microsoft LifeCam Cinema [5], the C920 HD Pro [6] (full high definition, FHD), and the Brio [7] (4K) from Logitech showed good results. The Brio is perfectly suited for the intended application, with its high resolution and is therefore used here. Other products are definitely also suitable for macro photography, but you need autofocus switched off, a short focus distance in the centimeter range, the ability to zoom, and compliance with the USB video class (UVC) standard, a specification for devices that stream video data over USB.

Webcams typically meet the UVC requirement and do not require a special driver to operate on a computer. Instead, a unified UVC driver serves devices from different manufacturers.

V4L, or the second version V4L2, is a collection of device drivers and programming interfaces already integrated into the Raspberry Pi's operating system and also supported by the Open Source Computer Vision (OpenCV) library of algorithms for automated image processing and artificial intelligence for face or gesture recognition. Working at the command line, you can control UVC devices with the v4l2-ctl command. The command

$ v4l2-ctl --list-devices
HD Pro Webcam C920 (usb-3f980000.usb-1.2):
        /dev/video0

shows which device file belongs to which device. For the Logitech Brio, the device is /dev/video0, as shown in the output.

Adding the --list-ctrls option tells v4l2-ctl to output information on the configurable controls (Listing 1). You need this data for your own application software. The output shows the value ranges and defaults for the camera and exposure.

Listing 1

Reading the Controls

$ v4l2-ctl -d /dev/video0 --list-ctrls
brightness 0x00980900 (int) : min=0 max=255 step=1 default=128 value=128
contrast 0x00980901 (int)   : min=0 max=255 step=1 default=128 value=128
saturation 0x00980902 (int) : min=0 max=255 step=1 default=128 value=128
[...]
zoom_absolute 0x009a090d (int)  : min=100 max=500 step=1 default=100 value=500
led1_mode 0x0a046d05 (menu)     : min=0 max=3 default=0 value=3
led1_frequency 0x0a046d06 (int) : min=0 max=255 step=1 default=0 value=0

The gv4l2 tool and Guvcview webcam application, which you can install with your package management system, provide graphical interfaces that are helpful for fine-tuning the desired camera settings.

Tabletop Photography

A table, some paper as background, LED lighting, a few clamps, and a tripod are all the hobbyist needs as an improvised tabletop studio. A scene with interesting objects and unusual positions can give you attractive images. Tabletop plays a significant role in product photography and advertising. Amateur photographers use this technique for collectibles or for selling on online portals.

Macro photography refers to image scales greater than 1:1. In other words, an object is depicted on the sensor larger than in the original. The definition comes from the analog age. Smaller image scales belong to the close-up range, but if everything fits on the table, it is tabletop.

Whether you use bellows extensions, macro lenses, or extension rings, a photo's range of sharpness at close range is limited. Photographers therefore use the focus bracketing technique and compile an image from a series of shots with different depths of field. This stacking technique is already integrated in the firmware of modern digital single-lens reflex (DSLR) cameras.

Smartphones also use the Dynamic Depth format for 3D photos, which are popular on Instagram and the like. The technology makes it possible to create images with smartphones where, for example, the background of a portrait appears blurred, much as DSLR cameras with fixed focal length lenses depict a person with an open aperture. The series of photos taken with a webcam is sent to a stacking tool such as MacroFusion [8] for postprocessing.

For the shoot in this article, the setup additionally relied on variable camera positioning. The camera was mounted on a linear drive and, driven by a stepper motor, moved to different positions under program control (Figure 1), which enabled, for example, video and continuous shooting, lenticular images (images that change depending on the viewing angle, giving the impression of movement), and stereo imaging.

Figure 1: The Logitech Brio on a linear guide. The Raspberry Pi controls the motor.

Occlusions in the miniature scenes can be controlled by minimal camera movements. A typical scene of miniature photography, with model figures in 1:87 scale built with tweezers, is shown in Figure 2. The camera can move past the set to find the most favorable position. In software terms, this is one more loop, and the Raspberry Pi hardware is perfect for this task.

Figure 2: A miniature scene taken on a tabletop setup featuring tiny figures on a scale of 1:87.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Webcam Rescue

    If your new webcam doesn't work with the default software on your Linux system, try your luck with Guvcview or QtCAM.

  • Digital_Photo_Intro.pdf

    The Linux environment includes some powerful tools for editing, managing, and scanning digital images.

  • Surveillance with NAS

    Take advantage of the low watt per operation compute power offered by modern NAS to monitor your cameras.

  • Workspace: Photo Helpers

    Capture, transfer, process, and manage photos using the Entangle, Rapid Photo Downloader, and GTKRawGallery applications.

  • Xnview

    Xnview is a handy image viewing and editing tool that is free for private use. We’ll show you around some of the program’s best features.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

Subscribe to our Linux newsletters

News