-
Notifications
You must be signed in to change notification settings - Fork 0
Performing Vision
Sensing and operating is a huge part of operating a robot. One such sensing technique is Vision. There are many libraries to perform Vision calculation, and FlashLib has no need to provide another one. However, managing continuous vision operation, and outputting it to robot actions is not so simple. Thus FlashLib a simple framework to manage vision operations.
- Images are provided by
ImageSource
implementations. The source may provide the same image, different images, or not provide any image at all. - Images then pass through
ImagePipeline
s. These pipelines may perform processing or just write the image to some output.- For processing the image, a pipeline may be a
VisionPipeline
. Such pipeline processes images usingImageProcessor
s, and analyzes the result using anImageAnalyzer
. After an analysis was created, the analysis is passed to an output consumer.
- For processing the image, a pipeline may be a
The most basic process can be displaying an image from a source:
ImageSource<ImageType> source = ...
ImagePipeline<ImageType> displayingPipeline = ...
ImageDelegator delegator = new ImageDelegator(source, displayingPipeline);
The ImageDelegator
object actually runs the process. This can be done in one of 2 ways. Manually:
while(shouldRun) {
delegator.delegate();
}
Or with an executor:
Runner runner = new ImageDelegationRunner(delegator, Time.seconds(1), logger);
runner.start();
To actually process an image, we would need to use VisionPipeline
.
This pipeline contains multiple ImageProcessor
s, which perform some processing on the image. This might be color manipulation, resizing and more. All in order to be able to analyze the image.
To analyze images, implement ImageAnalyzer
, which extracts an Analysis
out of an image. This analysis is done passed to a Consumer
, which may handle this analysis.