Installing the AMCap macro to acquire camera images with ImageJ
The AMCap/StillCap macro was developed from the ImageJ
Video Capture Tool for use with NeutronOptics cameras.
To modify the AMCap.txt script controlling StillCap from ImageJ see the list of StillCap commands
To install and update ImageJ
To take Video Snapshots using StillCap
- Download AMCap and register it to obtain StillCap (essential). A copy is included with NeutronOptics cameras.
- Install AMCap with StillCap in the same directory as ImageJ eg C:\AMCap\
- You can now use AMCap alone to visualise the output of your video camera. Press "Enter" to take a snapshot.
- To display the crosshair, useful for positioning targets, choose "Windowless mode" under Capture/Setup/Options
- Set Options for Video Capture Filter to PAL, Capture Pin Output Size to 720x576, and Crossbar to "Video Composite In"
with "Video Decoder Out". Please read the AMCap FAQ
Optional corrections for Barrel/Pincushion lens distortions (essential for precise measurements)
- To enable lens corrections, install
SplineDeformationGenerator (not needed for initial tests).
Download the NeutronOptics version, which will run silently in the background
- Double-click the mySplineDeformationGenerator.zip file
Drag the mySplineDeformationGenerator folder to the C:\ImageJ\plugins directory
- Restart ImageJ. SplineDeformationGenerator should appear in the Plugins menu.
To use the AMCap.txt ImageJ plugin
- Download AMCap.txt to the \ImageJ\macros\toolsets directory
- NOT the \ImageJ\macros\tools directory.
Click the >> icon in the ImageJ toolbar and select the AMCap tool
- Right-click the Camera Capture tool icon that appears and set the capture options.
For NeutronOptics cameras, choose listed USB 2861 Devices or SMI Grabber Devices
with PAL resolution (720x576)
You must specify a directory to store captured images, eg C:\temp\ and the file format eg tif
For a dual-CCD camera, specify the relative offsets & scales of the second camera wrt the first.
(These parameters will be supplied for each camera; if ever you need to re-determine them,
you should use a pinhole calibration screen in place of the scintillator plate).
Start capturing images
- Now everything is ready for image capture with this macro: Left-click the camera icon to start capturing
- This will close AMCap to allow StillCap access to the camera; only StillCap is used with this macro.
- With two cameras, ImageJ snapshots will be automatically stitched together and the resulting mosaic displayed
- Note that two cameras can have the same name; AMCap and StillCap use the device number not the device name.
Notes
- Select the cameras to be captured
- Resolution will be 720x576 for NeutronOptics PAL cameras
- Directory is where you store the images eg D:\temp\
- Despeckle is an ImageJ Process/Noise function
- You might want to convert Image/Type to 32-bit grayscale if you are summing multiple captures
- Subtract Background is an ImageJ Process to remove large bright areas.
- You can also measure a "dark field" image and subtract that as a file if you prefer
- Contrast is an ImageJ Image/Adjust function; you can instead use the ImageJ menu
- MySplineDeformationGenerator is
needed if you want to correct grayscale images for barrel/pincushion lens distortion before they are summed,
eg with K1=0.15 and K2=0.07
- You may need to rotate camera #1 as well as camera #2, or even invert it by rotating 180o depending on camera geometry
- Scale factor corrections are normally only needed for one camera (if at all)
- Relative X- and Y-offsets will usually be required with two cameras
Common Problems
A common error with two cameras is to invert the video cables, confusing camera #1 with camera #2.
Temporarily unplug one camera to check that you know which is which. If you get it wrong, their sum will be nonsense.
Check AMCap parameters for all cameras. AMCap will open when you close the capture options window.
For each camera Device, check that you see an image, setting the Options for Video Capture Filter to PAL,
Capture Pin Output Size to 720x576 and Crossbar to "Video Composite In" with "Video Decoder Out".
If a camera image is black, check the cables and eventually close and re-open AMCap.
Remember that the images remain stored on the cameras while the red Freeze (FRZ) button is on.
This ImageJ script can be used repeatedly to read out and sum these stored images,
without the need for a new exposure.
Be patient. Don't repeatedly click the ImageJ camera icon. It takes a few seconds to read and process the images.
Watch the progress bar at the bottom of the ImageJ interface.