diff --git a/opencsp/common/lib/cv/OpticalFlow.py b/opencsp/common/lib/cv/OpticalFlow.py index c33f8fe2..45561622 100644 --- a/opencsp/common/lib/cv/OpticalFlow.py +++ b/opencsp/common/lib/cv/OpticalFlow.py @@ -59,8 +59,8 @@ def __init__( This is due to some sort of bug with how multiprocessing processes and OpenCV threads interact. Possible solutions: - - use concurrent.futures.ThreadPoolExecutor - - Loky multiprocessing https://github.com/joblib/loky (I (BGB) couldn't make this one work) + - use concurrent.futures.ThreadPoolExecutor + - Loky multiprocessing https://github.com/joblib/loky Parameters ---------- @@ -77,36 +77,36 @@ def __init__( prev_flow : optional Previous flow calculations to make computation faster. (default is None). pyr_scale : float, optional - Parameter specifying the image scale (<1) to build pyramids for each image; - pyr_scale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous one. + Parameter specifying the image scale (<1) to build pyramids for each image; + pyr_scale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous one. (default is 0.5). levels : int, optional - Number of pyramid layers including the initial image; levels=1 means that no extra layers are created + Number of pyramid layers including the initial image; levels=1 means that no extra layers are created and only the original images are used. (default is 1). dense_winsize : int, optional - Averaging window size; larger values increase the algorithm's robustness to image noise and give more + Averaging window size; larger values increase the algorithm's robustness to image noise and give more chances for fast motion detection, but yield a more blurred motion field. (default is 15). iterations : int, optional Number of iterations the algorithm does at each pyramid level. (default is 3). poly_n : int, optional - Size of the pixel neighborhood used to find polynomial expansion in each pixel; larger values mean that - the image will be approximated with smoother surfaces, yielding a more robust algorithm and more blurred + Size of the pixel neighborhood used to find polynomial expansion in each pixel; larger values mean that + the image will be approximated with smoother surfaces, yielding a more robust algorithm and more blurred motion field, typically poly_n = 5 or 7. (default is 5.) poly_sigma : float, optional - Standard deviation of the Gaussian that is used to smooth derivatives used as a basis for the polynomial - expansion; for poly_n=5, you can set poly_sigma=1.1, for poly_n=7, a good value would be poly_sigma=1.5. + Standard deviation of the Gaussian that is used to smooth derivatives used as a basis for the polynomial + expansion; for poly_n=5, you can set poly_sigma=1.1, for poly_n=7, a good value would be poly_sigma=1.5. (default is 1.2). dense_flags : int, optional Operation flags that can be a combination of the following: - OPTFLOW_USE_INITIAL_FLOW uses the input flow as an initial flow approximation. - - OPTFLOW_FARNEBACK_GAUSSIAN uses the Gaussian winsize×winsize filter instead of a box filter of - the same size for optical flow estimation; usually, this option gives more accurate flow than with - a box filter, at the cost of lower speed; normally, winsize for a Gaussian window should be set + - OPTFLOW_FARNEBACK_GAUSSIAN uses the Gaussian winsize×winsize filter instead of a box filter of + the same size for optical flow estimation; usually, this option gives more accurate flow than with + a box filter, at the cost of lower speed; normally, winsize for a Gaussian window should be set to a larger value to achieve the same level of robustness. (default is 0). cache : bool, optional - If True, then pickle the results from the previous 5 computations and save them in the user's home - directory. If False, then don't save them. Defaults to False. The cache option should not be used in - production runs. I (BGB) use it for rapid development. It will error when used while running in production + If True, then pickle the results from the previous 5 computations and save them in the user's home + directory. If False, then don't save them. Defaults to False. The cache option should not be used in + production runs. I (BGB) use it for rapid development. It will error when used while running in production (aka on solo). (default is False) """ # "ChatGPT 4o-mini" assisted with generating this docstring. diff --git a/opencsp/common/lib/cv/fiducials/AbstractFiducials.py b/opencsp/common/lib/cv/fiducials/AbstractFiducials.py index 709f4d26..dee819cf 100644 --- a/opencsp/common/lib/cv/fiducials/AbstractFiducials.py +++ b/opencsp/common/lib/cv/fiducials/AbstractFiducials.py @@ -18,7 +18,7 @@ class AbstractFiducials(ABC): """ A collection of markers (such as an ArUco board) that is used to orient the camera relative to observed objects in the scene. It is suggested that each implementing class be paired with a complementary locator method or -:py:class:`opencsp.common.lib.cv.spot_analysis.image_processor.AbstractSpotAnalysisImageProcessor`. + :py:class:`opencsp.common.lib.cv.spot_analysis.image_processor.AbstractSpotAnalysisImageProcessor`. """ def __init__(self, style: rcps.RenderControlPointSeq = None, pixels_to_meters: Callable[[p2.Pxy], v3.Vxyz] = None): @@ -76,7 +76,7 @@ def origin(self) -> p2.Pxy: def rotation(self) -> scipy.spatial.transform.Rotation: """ Get the pointing of the normal vector(s) of this instance. - + This is relative to the camera's reference frame, where x is positive to the right, y is positive down, and z is positive in (away from the camera) @@ -117,7 +117,7 @@ def rotation(self) -> scipy.spatial.transform.Rotation: def size(self) -> list[float]: """ Get the scale(s) of this fiducial, in pixels, relative to its longest axis. - + As an example, if the fiducial is a square QR-code and is oriented tangent to the camera, then the scale will be the number of pixels from one corner to the other. @@ -134,8 +134,8 @@ def size(self) -> list[float]: def scale(self) -> list[float]: """ Get the scale(s) of this fiducial, in meters, relative to its longest axis. - - This value, together with the size, can potentially be used to determine the + + This value, together with the size, can potentially be used to determine the distance and rotation of the fiducial relative to the camera. Returns