OPTARC AF51 User manual

OptArc AF51 Camera
User Guide
Document created: 28.10.2022, Last edited: 24.11.2022
Manual prepared by OptArc − Designers
and manufacturers of custom optical and
optoelectronic systems using 3D printing
rapid prototyping and based in the UK.
See optarc.co.uk for details.

Safety nformation
Identification of risk
Throughout this manual please take heed of warnings given in bold text and
ig lig ted yellow to avoid possible damage to equipment and/or harm to people.
Risk to vulnerable groups
OptArc lab supplies and equipment are not toys. They contain small parts which may
come loose, glass components that may splinter or break or otherwise present a
choking or sharp object ha ard. Please do not let babies or young c ildren play
wit or gain access to any aspect of t is product. Older c ildren s ould only
access t is product wit close appropriate adult supervision. Likewise keep t is
product away from pets.
Risk of damage to eyepiece
This eyepiece camera is designed to be fixed over an eyepiece and clamped in position
by means of pressure from its three adjustment screws, this pressure being applied to
the outer casing of the eyepiece.
Although we have taken care to design this clamp mechanism to minimise the risk of
damage to the body of the eyepiece (for example by providing a protective plastic
sheath between the metal screw ends and the eyepiece) these measures will not
eliminate all risk of damage and some risk will always remain t at pressure from
t e clamp mec anism may cause wear, scratc es and/or indentation to t e outer
casing of t e eyepiece.
The user is advised to use minimum force when clamping the camera to an eyepiece
and take whatever additional measures they see fit to reduce the risk of this external
damage even further (e.g. by applying some protective coating between the eyepiece
barrel and the camera clamp such as a thin layer of rubber sheeting or tape).
In our experience, using OptArc® microscope eyepieces, no visible damage is caused
by careful use of this clamp mechanism but other makes and models of eyepieces may
be have more fragile coatings or less rugged walls.
Do not use t e clamp mec anism if t e metal of t e screws wears t roug t e
protective plastic s eat – damage will almost certainly occur to t e eyepiece
barrel in t ose circumstances.
By purchasing and / or using this camera the user agrees to accept responsibility for
protecting their eyepieces from such damage. Dr Paul J. Tadrous, TadPath and OptArc
cannot accept liability for any damage to eyepieces that may be caused due to the use
or misuse of this product.
OptArc AF51 Camera Page 2 of 99 User Guide v1.02

Safety certifications
The supplier of the electronic modules used in the AF51 states that the electronic
components have FCC, RoSH and CE certification. We have not made independent
tests on this so have not marked the camera with those certifications. The AF51 camera
is supplied and sold on the understanding that this is an item of custom equipment for
scientific research applications.
OptArc AF51 Camera Page 3 of 99 User Guide v1.02

Contents
Safety Information...........................................................................................................2
Identification of risk......................................................................................................2
Risk to vulnerable groups............................................................................................2
Risk of damage to eyepiece........................................................................................2
Safety certifications.....................................................................................................3
Download link for the PDF version of this manual...........................................................7
Video tutorials to accompany this manual.......................................................................7
Customise the camera to fit your eyepiece......................................................................7
Legal Information.............................................................................................................8
Copyright.....................................................................................................................8
Trade Marks................................................................................................................8
Limitations of Use........................................................................................................8
Disclaimer................................................................................................................... 8
Abbreviations...................................................................................................................9
1. Introduction................................................................................................................11
What’s included in the box.........................................................................................11
Overview of the AF51................................................................................................12
2. Recommended uses and limitations..........................................................................15
Recommended uses of the AF51..............................................................................15
Extra wide field of view afocal eyepiece projection...............................................15
Colour imaging in bright conditions.......................................................................16
Medium low light level applications.......................................................................16
General and macro photo / video recording..........................................................16
Limitations of the AF51..............................................................................................18
Highest magnification imaging..............................................................................18
Short eye-relief or narrow field eyepieces.............................................................19
Extreme low light level imaging.............................................................................19
Why not just use my smartphone camera instead?...................................................20
3. Detailed hardware specifications...............................................................................21
The CMOS sensor and lens......................................................................................21
The USB 2.0 microcontroller interface......................................................................24
User Controls........................................................................................................25
Camera Controls...................................................................................................28
OptArc AF51 Camera Page 4 of 99 User Guide v1.02

Camera stream formats........................................................................................33
3D Printed housing....................................................................................................34
Heat sink enclosure...............................................................................................34
Translation adjustable mount................................................................................36
Eyepiece clamp.....................................................................................................37
Tripod attachment.................................................................................................42
4. Additional hardware and software requirements........................................................43
Hardware...................................................................................................................43
Software....................................................................................................................43
Software development kit (SDK) and custom programming.................................43
PARD Capture for Linux........................................................................................44
Guvcview for Linux................................................................................................45
Microsoft AmCap and SDK for Windows...............................................................45
Webcamoid for macOS, Android and MS Windows..............................................47
Apple macOS and iOS..........................................................................................48
5. Fitting the AF51 to an eyepiece.................................................................................49
Eyepiece body diameters – limits of usability............................................................49
Eyepiece eye relief – limits of usability......................................................................52
Adjusting on an eyepiece to get a good image..........................................................56
Preliminary steps and aims...................................................................................56
Types of adjustment available...............................................................................57
Centring the optical axis........................................................................................57
Achieving the correct eye point level.....................................................................59
6. Introduction to PARD Capture...................................................................................60
Compiling the software..............................................................................................61
Starting the program: The main window....................................................................62
Preview frame integration (night vision)....................................................................66
The settings window..................................................................................................70
Custom settings.........................................................................................................72
Optional pre-processes.........................................................................................80
Saving and loading settings files...............................................................................84
Default settings.....................................................................................................84
Incompatibility between cameras..........................................................................85
Rules for manually editing a settings file...............................................................85
7. Achieving the best quality images with the AF51 – avoiding artefacts.......................88
OptArc AF51 Camera Page 5 of 99 User Guide v1.02

Uneven illumination – flat field correction..................................................................88
Quantisation artefacts and random noise..................................................................89
Dark current signal, bias and amplifier patterned noise............................................90
Colour streak artefact in low light conditions.............................................................92
Making a master flat and master dark for astronomy................................................93
Unnatural edge sharpening.......................................................................................93
Sample images..........................................................................................................94
8. Disposal and Recycling.............................................................................................95
Recycling of PLA Plastic in the UK............................................................................95
Recycling of PLA Plastic outside the UK...................................................................95
Electronics.................................................................................................................95
Index..............................................................................................................................96
OptArc AF51 Camera Page of 99 User Guide v1.02

Download link for the PDF version of this manual
Video tutorials to accompany this manual
Customise the camera to fit your eyepiece
OptArc AF51 Camera Page 7 of 99 User Guide v1.02
You can download the latest version of this User’s anual
as a PDF file from the Support section of the OptArc
website via this link:
https://www.optarc.co.uk/support/
The CAD files for the 3D printed eyepiece clamp for this
camera have been made open source so you can attempt to
modify it and print your own version to fit an eyepiece that
the standard clamp does not fit. See the Github page here:
https://github.com/TadPath/PU A
For video demonstrations on how to use this camera as well
as the PARD Capture software see the PU A icroscope
YouTube channel:
https://youtube.com/@PU A icroscope

Legal nformation
Copyright
This user’s manual is copyright © 2022 by Dr Paul J. Tadrous. All rights reserved.
Trade Marks
OptArc and the OptArc logo are Registered Trade arks of Dr Paul J. Tadrous
(registered with the UK Intellectual Property Office).
Limitations of Use
This equipment is released to be used for research and educational purposes only. The
AF51 camera is supplied and sold on the understanding that this is an item of custom
equipment for scientific research applications.
Disclaimer
Only competent people trained in the use of handling of photographic, video, computer
and optical equipment should use this product.
There is a risk of physical damage to the body / casing of eyepieces that have this camera
clamped onto them. The camera must not be affixed to an eyepiece if such risk is
unacceptable to the user or owner of the eyepiece. This notice is given here as fair
warning. Dr Paul J. Tadrous, TadPath and OptArc cannot accept any liability for any such
damage to eyepieces.
Dr Paul J. Tadrous, TadPath and OptArc cannot accept any liability for any loss or
damages that may occur from the misuse or mis-handling of this product or from the
failure to heed and abide by the warnings and safety notices set out in this document.
All information in this document is believed to be accurate according to the research and
understanding of the author and is provided in good faith and in the hope that it will be
useful. However, errors and omissions may be included herein. If any of this information is
considered important to some application the user should verify that information from
independent sources. Dr Paul J. Tadrous, TadPath and OptArc cannot accept any liability
for any loss or damages that may occur due to errors or omissions contained in this
document.
The descriptions and data presented in this manual only pertain to the genuine OptArc
AF51 camera sold via OptArc.co.uk. Similar looking clones may claim to share many or all
of the features of the AF51 but may not respond or perform in the way described in this
manual.
OptArc AF51 Camera Page 8 of 99 User Guide v1.02

Abbreviations
3D 3-Dimensional
AC Alternating Current
ADC Analogue-to-Digital Converter (or Conversion)
AE Ali Express (an online marketplace)
AEC Automatic Exposure Control
API Application Programming Interface
AWB Automatic White Balance
BH2 BHS A brand of microscope from Olympus
bpp bits per pixel
B P S Windows Bit aP (image file format)
CAD Computer-Aided Design
CCD Charge-Coupled Device
C OS Ceramic etal Oxide Semiconductor
D LS A brand of microscope from Leica
EFI Extended Focal (plane) Imaging
FD Fused deposition modelling (method of 3D printing)
FITS Flexible Image Transport System (file format)
FOV Field Of View
FPS Frames Per Second
gcc GNU Compiler Collection (C compiler and linker software)
GNU GPL GNU General Public License
HD High Definition
HSI Hue Saturation Intensity
JPEG Joint Photographic Experts Group (compression standard for digital photos)
LENC A pattern of variable gain across the image sensor designed to correct for
uneven illumination of a lens (LENs Correction). This pattern is fixed in the
sensor chip hardware (i.e. it does not change over time) and cannot be
modified by the user.
IT assachusetts Institute of Technology
OptArc AF51 Camera Page 9 of 99 User Guide v1.02

JPEG otion JPEG (compression standard for digital video)
P ega Pixels (= millions of pixels)
S icrosoft
OS Operating System
PARDUS Programmable Affordable Remote-controlled Drive Utility Standard
PDF Portable Document Format
PG Portable Grey ap (image file format)
PLA Poly-Lactic Acid (3D printer filament plastic)
PLL Phase Locked Loop
PNG Portable Network Graphic (image file format)
PP Portable Pix ap (image file format)
PU A Portable Upgradeable odular Affordable (open source 3D printed
microscope system)
RGB Red, Green and Blue
SDK Software Development Kit
SNR Signal-to-Noise Ratio
SOC System On-a Chip
TV TeleVision
UNC UNified Coarse (screw thread standard)
US United States (of America)
USB Universal Serial Bus
UVC USB Video Class (a communications protocol standard for video devices)
v4l2 Video for Linux 2 (programming API for video devices in Linux)
VGA Video Graphics Array resolution of 640 (wide) x 480 (high) pixels
WF Wide Field
YUYV A format for uncompressed digital video data
OptArc AF51 Camera Page 10 of 99 User Guide v1.02

1. ntroduction
What’s included in the box
The AF51 package sold by OptArc.co.uk includes the following components (figure 1.1):
Figure 1.1 The components of the standard AF51 camera kit supplied by OptArc. The numbers refer to the
items listed in the text. These are the only components supplied. All other accessories shown in this manual
need to be purchased or otherwise acquired separately.
1. AF51 camera body with two centration adjustment screws and a female tripod thread
socket to accept a standard 1/4-20 UNC threaded tripod screw (a tripod is not included)
and a ‘Type A’ USB male connector on the end of an approximately 42 cm long USB
cable.
2. A protective lens cap shown here removed from the lens. The camera will ship with this
lens cap in place and the user must unscrew it to begin using the camera (see figure 1.2)
3. An adjustment screw tightening / loosening tool
OptArc AF51 Camera Page 11 of 99 User Guide v1.02

4. Tri-screw adjustable eyepiece clamp.
5. Lock nut for fixing the position of the eyepiece clamp on the camera body.
Figure 1.2 Unscrew and remove the lens cap before first use! The camera comes with this protective cap
fitted. Re-fit the lens cap after use to protect the lens from dust. The lens cap can also be used to shield the
lens from light when performing certain procedures such as collecting a masker dark frame for image
processing. When putting the lens cap back on, take care not to over-tighten.
Overview of the AF51
The OptArc AF51 is a USB 2.0 C OS colour camera specially designed to be suitable for
use with the PU A 3D printed open source microscope system (figure 1.3) but it may also
be used with other optical equipment that use an eyepiece such as other microscopes
and telescopes.
It has its own integral lens with user-programmable focus so may also be used for normal
photography and video recordings, as an industrial inspection camera, for machine vision
projects, as a document camera, a web cam, etc..
The camera requires a separate computer (not supplied) with a USB 2.0 compatible
interface to operate and make recordings – it has no in-built recording capability or
memory card slot. It is powered by the host computer via USB power. This camera does
not have a microphone and cannot capture audio.
The camera functions and image capture may be controlled by your own programs using
various SDK and API that are available for Linux, S Windows and macOS.
OptArc AF51 Camera Page 12 of 99 User Guide v1.02

Figure 1.3 The AF51 in use on a PU A microscope showing a live video image of the specimen under the
stage by means of a tablet computer (microscope and computer are shown for illustration, they are not
supplied with the camera). Note that the camera shows the complete circular field of view captured by the
OptArc x10 WF high eye point eyepiece used in this setup.
Detailed specs will be given in a separate chapter but the main features that make the
AF51 particularly suitable for use with the PU A system is that it is small and light weight.
This minimises the tendency to cause vibrations on the scope and fits in with the
‘portability’ ethos of the PU A system.
The camera is designed with a built-in lens to image via afocal eyepiece projection and
the lens system is designed to give a complete circle wide field of view when used with an
OptArc® x10 WF high eye point eyepiece. The field of view with other eyepieces will vary
(see chapter 5 for details of field of view with a range of different eyepieces).
Despite its small size, the AF51 boasts some high end features that make it a very
versatile camera for both academic research, educational and recreational uses. Such
features include its very wide dynamic range (including a ‘night mode’ which allows for
OptArc AF51 Camera Page 13 of 99 User Guide v1.02

multi-frame integration on the sensor chip) which make it useful for bright conditions as
well as medium low light level applications such as fluorescence microscopy and some
forms of astrophotography. It has high spatial resolution (up to 5 megapixels) so if you
don’t want a circular field of view in your photomicrographs you can crop this down to a
filled rectangle while maintaining useful pixel resolution. It also has the ability to provide
raw YUYV output and manual control over exposure and focus which are important for
scientific image processing like Z-stacking extended focal imaging (EFI), deconvolution,
quantitative microscopy and some forms of astrophotography.
Another bonus feature is that the casing is 3D printed and the design files for the eyepiece
clamp system are available, free of charge, as open source FreeCAD files so a user with
access to 3D printing (either DIY printing or an online 3D printing service) can customise
the camera to fit a range of eyepieces and optical instruments that would not otherwise be
able to fit to the standard eyepiece clamp provided with the AF51. ore will be said about
this in chapter 5 of this manual.
OptArc AF51 Camera Page 14 of 99 User Guide v1.02

2. Recommended uses and limitations
No one camera is ideal for every application and so there are some important limitations
of this camera. First here is an overview of what this camera is particularly good for.
Recommended uses of the AF51
Extra wide field of view afocal eyepiece projection
The AF51 is excellent for extra wide field of view imaging where you want to capture
everything an observer sees with their eye against the eyepiece as illustrated in figure 1.3.
This is in contrast to bare chip C-mount cameras which typically ‘crop’ the field of view to
a highly magnified limited central rectangular region. This is the case for the OptArc x10
WF eyepieces and many other types but with some extra-wide field eyepieces the circular
field will be cropped on top and bottom. These eyepieces therefore use more of the
available pixels of the camera for their image of the specimen at the expense of not seeing
the whole circular field of view. Details of how much of the camera sensor is used by the
the eyepiece field of view with various eyepieces is given in chapter 5.
Figure 2.1 The AF51 is recommended to be used with high eye point wide field of view eyepieces such as
the OptArc WF 10X/20 eyepiece shown in the figure. Its wide exit aperture and high eye relief allow the
AF51 to capture the whole visible field of view with minimal wastage of peripheral pixels (see figure 1.3 for
an example of this in use).
OptArc AF51 Camera Page 15 of 99 User Guide v1.02

Colour imaging in bright conditions
This camera can give good colour imaging in bright conditions and at its maximum frame
rates. The maximum frame rate achievable depends on the spatial resolution setting and
exposure setting as well as whether raw YUYV camera output is used or whether JPEG
compressed camera output is used (both options are available with the AF51) and there
are other limiting factors such as the speed of the host computer and the current state of
the USB 2.0 connection. Detailed specs will be presented later but, by way of example, for
raw YUYV output a maximal frame rate of 25 FPS is achievable at VGA resolution (640 x
480) and up to 3 FPS at full 5 megapixel resolution (2592 x 1944). If raw output is not
required then selecting the JPEG compressed image stream will allow all resolutions
including full 5 megapixel frames to be streamed at a maximum rate of 30 FPS over a
good clear USB 2.0 connection in a computer with sufficient free processing power and
memory to handle this rate of data transfer.
The very best quality colour imaging with the AF51 – under any lighting conditions – is
achieved using the monochrome signal from the camera (the Y signal) and taking 3
pictures, each with a separate primary colour filter in the light path. For more detail about
this see chapter 7.
Medium low light level applications
The AF51 can also be used in medium low light level applications including dark field
microscopy and immunofluorescence. Achievable frame rates will be lower due to the
need for longer exposure settings and multi-frame integration (on the sensor chip) and
averaging (in software) for the lowest end of the useable light level scales. At the lowest
light settings the monochrome signal from the camera (the Y signal) will give the best
results as opposed to using its in-built colour capability. This is partly because the colour
signal processing inside the camera is subject to some artefacts that show up in low light
conditions. See chapter 7 for more detail.
General and macro photo / video recording
The AF51 can also be used for ‘ordinary’ photography and video recording using it’s in-
built lens i.e. not through a microscope or telescope (figure 2.2). Its lens has an auto-focus
option that makes it useful for filming objects that alter their distance from the camera and
it can also do macro photography of objects close to the lens.
For non-quantitative imaging the JPEG compressed image stream of the camera can be
used that can give up to 30 FPS at full HD (1920 x 1080) resolution as well as even higher
resolutions such as 2K quad HD (2560 x 1440) and even up to the full 5 P frame size
(2592 x 1944). Bear in mind that the camera has no microphone so if you need
audio with your video you will need to arrange to record that with a separate
OptArc AF51 Camera Page 1 of 99 User Guide v1.02

microphone and add the audio to the video in post-production. The achievable
frame rates and video resolution in practice will also depend on the processing power of
the host computer you use to do the recording as well as the current speed of the USB 2.0
connection (e.g. whether the USB 2.0 hub is being shared with other devices, etc.).
Example uses include filming demonstrations of products or techniques, use as a
document camera, use for machine vision applications (e.g. industrial inspection of
products for quality control, facial recognition, robotics), use as a web camera, etc.
whenever the wide field of view of this camera is advantageous to that task.
The camera can also be used for time-lapse sequences e.g. of natural phenomena or for
filming 3D printing.
Figure 2.2 The AF51 being used as a ‘standard’ camera using its in-built lens (no eyepiece or other optics
attached). The tripod and tablet computer are optional extras, not included with the AF51 package.
OptArc AF51 Camera Page 17 of 99 User Guide v1.02

For macro photography (close-up imaging) you can focus up to 3 cm from the in-built lens
without additional optics. This results in a field of view of about 39 mm x 29 mm using a
4:3 aspect ratio image format. Depth of focus will be quite narrow at this setting (there is
no physical iris aperture to adjust field depth). Figure 2.3 shows an example image
captured with this macro setting.
With macro photography you may find that adequate lighting becomes an issue because
the object is so close to the camera body.
Figure 2.3 Part of a US 1 dollar bill captured with the AF51 in its macro mode. Note that images shown in
this manual are compressed and down-sized for the PDF so do not represent the full quality of the original
image taken from the camera. This figure just gives an idea of the scale of the macro setting.
Limitations of the AF51
Highest magnification imaging
The wide fixed angle lens and very wide field of view mean that this camera is not
recommended where extreme high magnification is required. For example, it is not the
OptArc AF51 Camera Page 18 of 99 User Guide v1.02

best camera to use if you want to image subcellular organelles or study the detailed
morphology of chromosomes or bacteria.
hort eye-relief or narrow field eyepieces
It is not recommended to use the AF51 with eyepieces that have a narrower angle field of
view than the OptArc WF 10X/20 oculars. Attempting to use the AF51 with narrower field
of view eyepieces will result in a very small field of view image disc with wastage of much
of the sensor area thereby giving a relatively low resolution in the useable part of the
image. Chapter 5 gives details of the amount of sensor area used by the field of view for a
range of different eyepieces.
The eyepiece clamp that comes with the AF51 is designed to be used with eyepieces that
have long eye relief. Some older or cheaper modern eyepieces with a small diameter exit
lens and low eye relief will need a custom mount to be used with the AF51 (not supplied)
because the standard eyepiece clamp that comes with the AF51 will not allow a close
enough distance to be set between the camera and the eyepiece to see the full aperture.
This results in a very small field of view and excessive vignetting. See chapter 5 for more
details and measurements for various eyepieces.
Extreme low light level imaging
The AF51 is not recommended for extreme low light applications such as faint
bioluminescence, deep sky faint object astrophotography or low light level imaging of fast
moving objects.
This is because the AF51 uses its own lens with a small aperture and also because it
images down an eyepiece using afocal projection photography. This means there will be a
lot of lens elements between the light coming from the object and the C OS sensor chip
and each of these absorb, reflect or otherwise restrict some of the available light. Also the
AF51 has a small C OS sensor chip which limits its light gathering ability and does not
have active cooling so dark current noise will be more prominent.
Although the AF51 can be used for some low light level applications, it will be working at
maximum exposure times and gain and require multi-frame integration and multi-frame
averaging to get the best quality images at these low light levels. Therefore it will not be
able to image fast moving action without significant motion blur at low light levels. Colour
sensitivity will also be reduced at low light levels.
OptArc AF51 Camera Page 19 of 99 User Guide v1.02

Why not just use my smartphone camera instead?
odern smart phone cameras have many times more megapixels than the AF51 and can
give good quality photographs for illustration purposes – sometimes even better looking
pictures than with the AF51.
The main limitations in using a smart phone is that these imaging systems are not
designed for scientific or quantitative imaging and they are heavy and awkward to mount,
especially on a 3D printed PU A microscope where they will require some additional
means of support to support their weight and avoid distorting the microscope frame and
aggravating image ‘wobble’ (this is not such a problem with standard metal lab
microscopes).
Regarding quantitative imaging for scientific applications you will need access to an
uncompressed image stream from the camera as well as the ability to save that image in
an uncompressed format to avoid artefacts (see chapter 7 of this manual), the ability to
measure a dark current image and flat field image with multi-frame averaging manual
control of exposure, colour balance, etc. and the ability to maintain a good signal even in
low light levels (see chapters 6 and 7 of this manual). All this can be done with the AF51
and PARD Capture software. If you can do all too that with your smartphone camera and
have it well mounted on the microscope then I see no advantage of using the AF51 over
such a device for taking the odd picture. However, there are other advantages. The AF51
costs less than a high end smartphone and you can use multiple AF51 mounted on
multiple eyepieces on the same microscope due to its light weight and small size. You can
kit out a class or lab with multiple AF51’s without having to have multiple smart phones.
You can leave the AF51 on a scope in a lab or culture hood or on a robot to image over
long periods where you would not want to leave a smartphone. The ease of coupling the
AF51 to a standard computer for an image analysis workflow and automation, the use of
the PARD Capture software to control the AF51 with its many conveniences for scientific
imaging, multi-platform SDK for custom programming, etc.
OptArc AF51 Camera Page 20 of 99 User Guide v1.02
Table of contents