コード例 #1
0
ファイル: frame.py プロジェクト: zivid/zivid-python
    def settings(self):
        """Get the settings used to capture this frame.

        Returns:
            A Settings instance
        """
        return _settings_converter.to_settings(self.__impl.settings)
コード例 #2
0
def test_to_internal_settings_to_settings_modified(random_settings):
    from zivid import Settings
    from zivid._settings_converter import to_settings, to_internal_settings

    converted_settings = to_settings(to_internal_settings(random_settings))
    assert random_settings == converted_settings
    assert isinstance(converted_settings, Settings)
    assert isinstance(random_settings, Settings)
コード例 #3
0
    def settings(self):
        """Get the current camera settings.

        Returns:
            Current settings

        """
        return _settings_converter.to_settings(self.__impl.settings)
コード例 #4
0
    def settings(self):
        """Get the settings for the API at the time of the frame capture.

        Returns:
            a settings instance

        """
        return _settings_converter.to_settings(  # pylint: disable=protected-access
            self.__impl.settings)
コード例 #5
0
def test_to_internal_settings_to_settings_default():
    from zivid import Settings
    from zivid._settings_converter import to_settings, to_internal_settings

    default_settings = Settings()
    converted_settings = to_settings(to_internal_settings(default_settings))
    assert default_settings == converted_settings
    assert isinstance(converted_settings, Settings)
    assert isinstance(default_settings, Settings)
コード例 #6
0
def test_to_internal_settings_to_settings_modified():
    import datetime
    from zivid import Settings
    from zivid._settings_converter import to_settings, to_internal_settings

    modified_settings = Settings(acquisitions=[
        Settings.Acquisition(),
        Settings.Acquisition(exposure_time=datetime.timedelta(
            milliseconds=100)),
    ])

    converted_settings = to_settings(to_internal_settings(modified_settings))
    assert modified_settings == converted_settings
    assert isinstance(converted_settings, Settings)
    assert isinstance(modified_settings, Settings)
コード例 #7
0
def suggest_settings(camera, suggest_settings_parameters):
    """Find settings for the current scene based on given parameters.

    The suggested settings returned from this function should be passed into
    camera.capture() to capture and retrieve the Frame containing a point cloud.

    Args:
        camera: A Camera instance
        suggest_settings_parameters: A SuggestSettingsParameters instance

    Returns:
        A Settings instance optimized for the current scene
    """
    internal_settings = _zivid.capture_assistant.suggest_settings(
        camera._Camera__impl,  # pylint: disable=protected-access
        to_internal_capture_assistant_suggest_settings_parameters(
            suggest_settings_parameters),
    )
    return _settings_converter.to_settings(internal_settings)
コード例 #8
0
def suggest_settings(camera, suggest_settings_parameters):
    """Find settings for the current scene based on the suggest_settings_parameters.

    The suggested settings returned from this function should be passed into hdr.capture to perform the actual capture.

    Args:
        camera: an instance of zivid.Camera
        suggest_settings_parameters: an instance of zivid.capture_assistant.SuggestSettingsParameters which provides
                                     parameters (e.g., max capture time constraint) to the suggest_settings algorithm.

    Returns:
        List of Settings.

    """
    internal_settings = _zivid.capture_assistant.suggest_settings(
        camera._Camera__impl,  # pylint: disable=protected-access
        suggest_settings_parameters._SuggestSettingsParameters__impl,  # pylint: disable=protected-access
    )
    return [
        _settings_converter.to_settings(internal)
        for internal in internal_settings
    ]