Interface Camera

    • Method Detail

      • getLocation

        Location getLocation​(HeadMountable tool)
        Get the location of the camera including the calibrated offset for the given tool. If the bottom camera focal plane is different from the PCB surface plane, the various tools might introduce slight offsets in X, Y as their Z axes are not perfectly parallel. This offset is compensated if the getLocation(tool) method is used instead of the plain getLocation() method. If tool == null it returns the same as plain getLocation().
        Parameters:
        tool -
        Returns:
      • getLooking

        Camera.Looking getLooking()
        Get the direction the Camera is looking.
        Returns:
      • getUnitsPerPixel

        Location getUnitsPerPixel()
        The number of X and Y units per pixel this camera shows when in perfect focus. The Z value of this location is the height at which the units per pixel were measured.
        Returns:
        a Location whose x and y length represent the units per pixel in those axis respectively
      • setUnitsPerPixel

        void setUnitsPerPixel​(Location unitsPerPixel)
      • getUnitsPerPixel

        Location getUnitsPerPixel​(Length z)
        Gets the units per pixel for determining the physical size of an object in an image given its Z height is known
        Parameters:
        z - - a length with the z coordinate of the imaged object, if null, the height of the default working plane for this camera is used
        Returns:
        a Location whose x and y length represent the units per pixel in those axis respectively
      • getUnitsPerPixelAtZ

        default Location getUnitsPerPixelAtZ()
        Gets units per pixel for determining the physical size of an object in an image given its Z is at the (virtual) Z axis of the camera location. If the camera Z is at or above Safe Z, meaning the Z is actually not set, it will fall back to the standard units per pixel. This is also the default for cameras that do not have a concept of a location or Z axis.
        Returns:
      • getDefaultZ

        Length getDefaultZ()
        Gets the Z height of the default working plane for this camera. This is the height at which objects are assumed to be if no other information is available.
        Returns:
        the Z height of the default working plane
      • isUnitsPerPixelAtZCalibrated

        default boolean isUnitsPerPixelAtZCalibrated()
        Returns:
        true, if Z-dependent units per pixel are available and configured.
      • capture

        java.awt.image.BufferedImage capture()
                                      throws java.lang.Exception
        Immediately captures an image from the camera and returns it in it's native format. Fires the Camera.BeforeCapture and Camera.AfterCapture scripting events before and after.
        Returns:
        Throws:
        java.lang.Exception
      • captureTransformed

        java.awt.image.BufferedImage captureTransformed()
      • captureRaw

        java.awt.image.BufferedImage captureRaw()
      • settleAndCapture

        java.awt.image.BufferedImage settleAndCapture​(Camera.SettleOption settleOption)
                                               throws java.lang.Exception
        Same as capture() but settles the camera before capturing.
        Parameters:
        settleOption - Determines how thorough the settling is.
        Returns:
        Throws:
        java.lang.Exception
      • settleAndCapture

        default java.awt.image.BufferedImage settleAndCapture()
                                                       throws java.lang.Exception
        Same as capture() but settles the camera before capturing.
        Returns:
        Throws:
        java.lang.Exception
      • lightSettleAndCapture

        java.awt.image.BufferedImage lightSettleAndCapture()
                                                    throws java.lang.Exception
        Same as capture(), but lights and settles the camera before capturing. Uses default lighting.
        Returns:
        Throws:
        java.lang.Exception
      • hasNewFrame

        boolean hasNewFrame()
        Returns:
        True if the Camera device has a new frame available (since the last one was captured).
      • startContinuousCapture

        void startContinuousCapture​(CameraListener listener)
        Registers a listener to receive continuous images from the camera.
        Parameters:
        listener -
      • stopContinuousCapture

        void stopContinuousCapture​(CameraListener listener)
        Requests that the continuous capture be stopped for the previously registered listener. If the Camera has other listeners they should still receive updates.
        Parameters:
        listener -
      • setVisionProvider

        void setVisionProvider​(VisionProvider visionProvider)
      • getVisionProvider

        VisionProvider getVisionProvider()
        Get the VisionProvider that is attached to this Camera, if any.
        Returns:
      • getWidth

        int getWidth()
        Get the width of images in pixels that will be returned from this Camera.
        Returns:
      • getHeight

        int getHeight()
        Get the height of images in pixels that will be returned from this Camera.
        Returns:
      • getLightActuator

        Actuator getLightActuator()
        Returns:
        the Camera light actuator.
      • actuateLightBeforeCapture

        void actuateLightBeforeCapture​(java.lang.Object light)
                                throws java.lang.Exception
        Inform the Camera that the light actuator (if any) should now be actuated to the given light setting. Effective actuation may be optimized to span longer periods/prevent blinking.
        Parameters:
        light - Provides the light actuation value or null for default lighting.
        Throws:
        java.lang.Exception
      • actuateLightBeforeCapture

        default void actuateLightBeforeCapture()
                                        throws java.lang.Exception
        Inform the Camera that the light actuator (if any) should now be actuated to the default light setting. Effective actuation may be optimized to span longer periods/prevent blinking.
        Throws:
        java.lang.Exception
      • actuateLightAfterCapture

        void actuateLightAfterCapture()
                               throws java.lang.Exception
        Inform the Camera that the light actuator (if any) may now be actuated to the default off setting. Effective actuation may be optimized to span longer periods/prevent blinking.
        Throws:
        java.lang.Exception
      • ensureCameraVisible

        void ensureCameraVisible()
        Ensure the related CameraView will eventually be made visible on the user interface.
      • isAutoVisible

        default boolean isAutoVisible()
        Returns:
        True if ensureCameraVisible() should be called on this Camera whenever a targeted user action changes the Camera view.
      • isShownInMultiCameraView

        boolean isShownInMultiCameraView()
        Returns:
        True if this Camera should be shown in multi camera view panels.
      • getRoamingRadius

        Length getRoamingRadius()
        Returns:
        The bottom camera roaming radius within which a part is allowed to be positioned at camera Z. It includes moving the nozzle around to take different shots of the parts, and the part extent itself. It does not include pick offsets and other deviations that may occur during practical operation, a physical camera "pit" must allow for some extra wiggle space, on to of this nominal radius.