Keywords: subpixel
Summary
This demo shows how to improve the modeling of sub-pixel objects by enabling "hypersampling" when a pixel’s IFOV contains specific objects. The scene constains a pair of very small box targets that represent a fraction of a percent of the pixel by area. However, even with modest sampling across the array the correct fractional contribution of these small targets can be determined when hypersampling is enabled.
Details
The central and adaptive pixel sampling strategies employ a minimum number of sample rays per pixel. The key feature of the adaptive method is that the total number of rays can vary from pixel to pixel based on the complexity of the pixel. In some situations, a sub-pixel target can be quite small and the initial rays will never hit it. In those cases, even the adaptive method can fail to capture the appropriate contribution of that target. To address this the user can increase the minimum number of samples, but that will increase the computation for all of the pixels in the array.
Consider the scenario used in this demo. The ground sampling distance for the sensor in this demo is 5 meters and we are looking at a scene containing 0.1 meter box targets. Hence, the 0.1 meter targets is sufficantly sub-pixel at 0.04% coverage by area. If the sub-pixel sampling was set to 50 x 50, then we might expect only 1 sample ray to hit our target. And we would also get the correct estimate of the size of the target (1/502 = 0.0004 or 0.04% by area). The first problem is that modeling every pixel with 50 x 50 samples will take a long time. The second problem is that if adaptive sampling is used and a second (random) ray happens to hit the target, then it’s sub-pixel fraction will double. Hence, we want a large enough minimum number of samples to find a target and then large enough maximum number of samples to correctly estimate it’s contribution.
Ideally, we want a way to indentify specific pixels that contain special targets and utilize more samples in those pixels only. This can be accomplished by the hypersampling feature in the default central sampling method. To utilize the method, the user needs to label important targets and specify a sampling multiplier that increases the sample rates when any of the labeled targets are within a pixel.
Note
|
An earlier version of this hypersampling mechanism was actually an option to the "adaptive" sub-pixel sampling method rather than the default "central" sampling method. However, the truth reporting was prone to errors when "adaptive" would non-uniformly distribute samples within a pixel. |
Important Files
This section highlights key files important to the simulation.
The Target Geometry
In this demo the target is a simple, 6-sided box described by a DIRSIG GDB file. The box is 1 x 1 x 1 meters:
$ object_tool geometry/box.gdb
Reading input GDB file ...
Reading in geometry file: geometry/box.gdb
Part count = 1
Invalid/Total facet count = 0/6
Shared/Total vertex count = 16/24
Geometry summary tool:
Triangle count = 12
Vertex count = 8
Minimum = -0.500, -0.500, 0.000
Maximum = 0.500, 0.500, 1.000
Size = 1.000 x 1.000 x 1.000 [m]
Material summary tool:
1 (assigned to 12 facets)
GLIST Box Wrapper
We want to take this 1 x 1 x 1 box and shink it down to make it very small
and then be able to instance it a few times in the scene. To do this we
have made a "wrapper" GLIST that instances the box GDB file with a scaling
(see geometry/wrappers/small_box.glist
):
<geometrylist enabled="true">
<object>
<basegeometry>
<gdb><filename>objects/box.gdb</filename></gdb>
</basegeometry>
<staticinstance>
<scale>
<cartesiantriple><x>0.1</x><y>0.1</y><z>0.1</z></cartesiantriple>
</scale>
</staticinstance>
</object>
</geometrylist>
Note that the scaling of the box is 0.1, making the resulting box 0.1 x 0.1 x 0.1 meters.
Marked Instances in the GLIST File
The scene is assembled from a ground plane GDB file (see
geometry/objects/plane.gdb
) and 3 instances of the "small box" (2 static
and 1 dynamic). The base geomtry for the "small box" is the GLIST wrapper:
</geometrylist>
...
<object>
<basegeometry>
<glist><filename>wrappers/small_box.glist</filename></glist>
</basegeometry>
...
</object>
</geometrylist>
The key step is to label instances that are "important". Instance
labeling is only supported in the GLIST file and is accomplished by
setting the name
attribute in either a static or dynamic instance
to start with the specific string "::IMPORTANT::
".
An example instance for the target box geometry in the
geometry/lists/demo.glist
file is shown below:
<staticinstance name="::IMPORTANT::Box1">
<translation>
<point><x>2.5</x><y>-2.5</y><z>0.1</z></point>
</translation>
</staticinstance>
Since features like the tracking mount use these instance names, there is a
desire to be able to make them unique. The name can contain another unique
component to but it must begin with ::IMPORTANT::
. A second instance
from the geometry/lists/demo.glist
file is shown below that is assigned
to a second box in the scene:
<staticinstance name="::IMPORTANT::Box2">
<translation>
<point><x>-60.0</x><y>5.0</y><z>0.1</z></point>
</translation>
</staticinstance>
A 3rd instance of the box uses the FlexMotion model to translate the location of the box along the Y axis:
<dynamicinstance name="::IMPORTANT::Box3">
<motion type="flexible">
<locationengine type="waypoints">
<data source="internal" datetime="relative" frame="scene" delimiter=",">
<![CDATA[
0.0,+60.0,-80.0,0.1
1.0,+60.0,+80.0,0.1
]]>
</data>
</locationengine>
<orientationengine type="velocity">
</orientationengine>
</motion>
</dynamicinstance>
Enabling Hypersampling
To enable hypersampling in the adaptive capture strategy, the user must
hand-edit the .platform
file and a new element. The
hypersamplingmultiplier
element specifies a multiplier that modifies
the minimum and maximum number of samples used in each pixel when an
important target overlaps the pixel IFOV. The use of this special
element is shown within the <samplestrategy>
element in the
from the demo.platform
file included in this demo (see excerpt
below):
<samplestrategy type="central">
<hypersamplingmultiplier>50000</hypersamplingmultiplier>
</samplestrategy>
<imagefile>
...
</imagefile>
<spectralresponse>
...
</spectralresponse>
<spatialresponse xsubelements="5" ysubelements="5" spectralunits="microns" spatialsampling="subsamples">
...
</spatialresponse>
Because the sub-pixel grid is 5x5 the minimum number of rays shot from each pixel is 25. However, when an important target overlaps the pixel the total number of samples will be multiplied by 50,000, resulting in a minium of 1,250,000 rays per pixel. When we know the target is present, enabling these high sampling counts give us extra samples to correctly estimate the contribution of those small targets. Even with 1,250,000 samples/pixel, that results in a sub-pixel abundance quantization of 1 / 1250000 = 8.0e-07 while attempting to randomly sample and estimate the relative contribution of a target that occupies 4.0e-04 of the pixel.
Important
|
Keep in mind that the <hypersamplingmultiplier> element will
be lost if you load and save the platform file in the GUI
editor. |
Setup
This section includes any step-by-step instructions for running and visualizing the simulation.
To run the simulation, perform the following steps:
-
Run the DIRSIG
demo.sim
file -
Load the resulting
demo.img
radiance file anddemo_truth.img
truth file in the image viewer.
Important
|
The progress of the simulation may appear to stall about half way through the simulation. This is when the model is hypersampling (50,000x more sample rays) on pixels containing target. |
Results
The key element of this simulation is looking at the pixel truth and observing that most pixels used only 25 samples but there are several pixels that used 1,250,000 samples. These are the pixels that overlap the small box targets. The target on the left-side is small but phased across several pixels, and therefore a 2x2 pixel neighborhood is hypersampled. The middle target is centered with a pixel, but conservative overlap test requires additional neighboring pixels to be sampled as well.

If you look at the abundance truth for the "Target" material, you should observe fractions of around 0.004. The middle target should yield an abundance of 0.0042 and the left-side target abundances should add up to 0.0043. To improve the accuracy of this abundance, simply increase the sampling multiplier.
