Scan Windows¶
Definition¶
Scan Windows are rectangular or polygonal regions that govern which part of the Field of View is used to measure points.
Important Considerations¶
-
ScanWindows are defined in Mill Space. This means that with a change of alignment, the position and orientation of a Scan Window also changes. It is recommended to verify all Scan Windows after aligment changes. JsSetup allows for quick verification. In JsSetup, you can also compare the returned profile data with and without windows by using the Update Profile dropdown button.
-
Only one Scan Window is permitted per Camera-Laser-Pair.
-
The depth of a Scan Window (i.e. the maximum extent along the Y axis in the FOV) has a large influence on achievable scanning speeds. The width has almost no effect.1 The Phasing Workspace in JsSetup has a function to calculate the Minimum Scan Period; it takes into account Alignment, Scan Windows, Exposure Settings and Phasing. You should keep the Scan Window for all Camera-Laser-Pairs as tight as possible to the maximum object extents.
-
Polygonal Scan Windows must be convex, and contain at least 3 vertices, specified in clockwise order. The JsSetup Window Editor Workspace will enforce these constraints.
-
Scan Windows are handy to exclude part of the machinery that you are not interested in. For instance, setting the bottom of a rectangular ScanWindow to be slightly above the chain guarantees that only board data is contained in the returned profiles, making filtering in your application unneccessary.
Points near Scan Window Border
In some circumstances, the ScanHead may return points slightly outside the window, if they are very close to the border. This is a technical limitation, due to the way the laser peak finding algorithm is implemented.
Defining Scan Windows in code¶
The Pinchot API provides functions for creating and setting windows. Here is a basic outline2:
Set a large rectangular Scan Window. Units are the same as in the containing ScanSystem
.
var scanWindow = ScanWindow.CreateScanWindowRectangular(30.0, -30.0, -30.0, 30.0);
scanHead.SetWindow(scanWindow);
var scanWindow = ScanWindow.CreateScanWindowPolygonal(new List<Point2D>(){
new Point2D(-30,30,0),
new Point2D(30,30,0),
new Point2D(30,-30,0),
new Point2D(-30,-30,0)
});
scanHead.SetWindow(scanWindow);
var scanWindow = ScanWindow.CreateScanWindowUnconstrained();
scanHead.SetWindow(scanWindow);
Set a large rectangular Scan Window. Units are the same as in the containing ScanSystem
.
int32_t r = jsScanHeadSetWindowRectangular(scan_head, 30.0, -30.0, -30.0, 30.0);
if (0 > r) {
// handle error
}
std::vector<jsCoordinate> window_polygon = {
{-30.0, 30.0},
{30.0, 30.0},
{30.0, -30.0},
{-30.0, -30.0}
};
r = jsScanHeadSetPolygonWindow(scan_head,window_polygon.data(),window_polygon.size());
if (0 > r) {
// handle error
}
-
keep in mind that Scan Windows are affected by the alignment, and may be rotated. ↩
-
the function calls differ for laser-driven and camera-driven models. See here for more details. For convenience, the API also provides calls that set the window per ScanHead, which results in the same window being used for all Camera-Laser-Pairs of this ScanHead. ↩