digiCamControl

repository·master·Indexed 20 days ago

https://github.com/dukus/digicamcontrol

An open-source software suite for remote control of DSLR cameras, providing capabilities for controlling camera settings and capturing images via software interfaces. The suite includes a workflow plugin system with commands for camera hardware operations (CameraAction), image processing (BlackAndWhite, BrightnessContrast, Flip), file management (CopyFile), and user interaction (Dialog).

Tokens
8.6K
Snippets
31
Records
33
Agent score
69%

What's inside digiCamControl

  1. Perform Focus Stacking with digiCamControl

    master

    Focus stacking is a technique used to combine multiple images taken at different focus distances to create a single image with a greater depth of field (DOF). This is particularly useful in macro photography.

    Requirements

    • Camera Support: Nikon or Canon cameras with Live View capability.
    • Software Version: digiCamControl (dCC) version 2.0.49 or higher.
    • Conditions: Subjects must be static (not moving) and lighting must remain constant throughout the process.

    Workflow

    1. Initialize Session: Start a new session in the application, providing a session name and a destination folder for the captured photos.
    2. Initial Focus: Start Live View. Use autofocus to focus on the point closest to the camera.
    3. Verify Focus & Exposure: Use the Preview button to inspect the captured image. You can use the mouse wheel to zoom in/out to check focus quality and exposure. Closing the preview returns you to Live View. Note that preview images are not saved to the session or hard disk.
    4. Set Focus Range:
      • Fine-tune the closest focus point using Live View zoom and focus buttons.
      • Lock the closest focus point using the left side lock button to prevent losing this reference.
      • Fine-tune and lock the most distant focus point using the same method.
    5. Configure Stacking Parameters: Use the focus stacking preview button to verify the focus steps. The focus step value depends on your lens's DOF; a typical value is between 10-75 (e.g., 30).
    6. Capture: Press the Start button to capture the series. If using an external flash, you may need to increase the waiting time to allow for flash recharge.
    7. Combine Images: Once captured, use a plugin to merge the images. You can use the built-in Enfuse plugin via Menu => Plugins => Enfuse or the CombineZp plugin (requires the CombineZ application installed in the default location). Selecting one image from the stack will cause the plugin to load all files captured in that specific stack.
  2. Dialog command execution modes

    master

    The behavior of the Dialog command changes based on the Type property:

    • Message: Displays a standard message box with an OK button. Does not affect workflow flow unless Error is set.
    • Warning: Displays a message box with a warning icon and an OK button.
    • YesNo: Displays a question dialog with Yes and No buttons. If the user selects No, the command returns false, which typically halts the workflow execution.
    • SaveFile: Opens a system SaveFileDialog.
      • Uses FileNameFilter for file extensions.
      • Uses the value of the specified Variable as the initial filename.
      • If the user confirms the save, the new file path is written back to the specified Variable.
      • If the user cancels, the command returns false and halts the workflow.
  3. Use the Overlay command for image processing

    master

    The Overlay command is a workflow plugin used to apply image overlays (watermarks) or text annotations to images. It supports both file-based overlays and dynamic text rendering with customizable fonts, colors, and positioning.

    // Conceptual representation of an Overlay command configuration
    {
      "Command": "Overlay",
      "Properties": {
        "OverlayFile": "path/to/watermark.png",
        "StrechOverlay": true,
        "Position": "Center",
        "Transparency": 80,
        "Text": "Hello World\nNew Line",
        "TextPointSize": 50,
        "TextFillColor": "Red",
        "TextStrokeColor": "Blue",
        "TextFont": "Arial",
        "TextPosition": "BottomRight",
        "TextTransparency": 100
      }
    }
  4. Use the WorkflowAction command to trigger workflow actions

    master

    The WorkflowAction command is a plugin type used within a workflow to trigger specific internal system actions or navigate between views. It operates by sending messages to the WorkflowManager.

    To use this command, you must configure two primary properties:

    1. Action: A selection from a predefined list of available system actions.
    2. ViewName: (Required only for the ShowView action) The name of the view to navigate to.

    Commonly used actions include session management (FinishSession, CancelSession), navigation (ShowView, PreviousView), and photo management (NextPhoto, PrevPhoto, DeletePhoto, ClearPhotos).

    /* Example configuration of a WorkflowAction command */
    // Action: "ShowView"
    // ViewName: "YourTargetViewName"
  5. Use the TriggerEvent command in a workflow

    master

    The TriggerEvent command allows you to trigger system-wide messages within the digiCamControl workflow engine. When executed, it broadcasts a message containing a specific event name and an optional message string. This is useful for signaling other parts of the workflow or external listeners that a specific milestone has been reached.

    To use this command, you must provide two properties:

    1. Event: A string representing the name of the event to trigger.
    2. Message: A string containing the message payload associated with the event.

    If the Event property is empty or whitespace, the command will fail to execute.

    /* 
    Properties required for TriggerEvent:
    
    - Event (String): The name of the event to trigger.
    - Message (String): The message content to accompany the event.
    */
  6. Use the Wait command in workflows

    master

    The Wait command is a workflow plugin used to introduce a delay during the execution of a capture workflow. It pauses the workflow for a specified number of seconds before proceeding to the next command.

    Configuration

    When configuring the Wait command, you must provide the following property:

    • Seconds: A numeric value representing the duration of the pause.
      • Type: Number
      • Default: 1
      • Allowed Range: 1 to 100 seconds.
    // Example configuration for a Wait command
    {
      "CommandName": "Wait",
      "Properties": {
        "Seconds": 5
      }
    }
  7. Use the CopyFile command in workflows

    master

    The CopyFile command is a workflow plugin used to copy files from a temporary location to a destination defined by a template. It supports both immediate execution and background queueing.

    Command Properties

    PropertyTypeDescription
    FileNameTemplateParamStringA template string used to define the destination path. Supports context tokens like {SessionFolder}, {SessionName}, and {Counter}. The file extension is automatically appended from the source file.
    OverwriteBoolDetermines whether to overwrite an existing file at the destination.
    EnqueueActionBoolIf true, the command executes in a background queue instead of immediately.

    Execution Modes

    1. Immediate Execution (EnqueueAction = false): The file is copied directly from the context.FileItem.TempFile to the path generated by the FileNameTemplate. The context.FileItem.FileName is updated to the new destination path.

    2. Queued Execution (EnqueueAction = true): The file is moved to the system's QueueFolder with a random filename. A record is added to the workflow database (DbQueue) containing the source file path, the action name (CopyFile), and the intended destination filename (from the template). The background worker later processes this by copying the file to the template destination and deleting the source.

    // Example configuration of a CopyFile command
    var command = new WorkFlowCommand();
    command.Properties.Add(new CustomProperty() {
        Name = "FileNameTemplate",
        Value = @"{SessionFolder}\\{SessionName}\\IMG_{Counter}"
    });
    command.Properties.Add(new CustomProperty() {
        Name = "Overwrite",
        Value = true
    });
    command.Properties.Add(new CustomProperty() {
        Name = "EnqueueAction",
        Value = false
    });
  8. Use the ShellExecute command in workflows

    master

    The ShellExecute command allows you to execute external shell commands or applications as part of a capture workflow. It requires two specific properties to be configured in the command object:

    1. Executable: A string representing the path to the executable file or the command to run.
    2. Parameter: A string containing the arguments or parameters to pass to the executable.

    When the command is triggered, it uses the Utils.Run utility to launch the process with the provided executable and parameters.

    // Conceptual configuration of the ShellExecute command properties
    var command = new WorkFlowCommand();
    command.Properties.Add(new CustomProperty { Name = "Executable", Value = "C:\Path\To\App.exe" });
    command.Properties.Add(new CustomProperty { Name = "Parameter", Value = "--arg1 value1" });
  9. Use the CameraAction workflow command

    master

    The CameraAction command is a workflow plugin used to trigger specific hardware operations on the connected camera device. It is configured via a set of properties, primarily the Action property which determines the operation to perform.

    Properties

    • Action (ValueList): The specific camera operation to execute.
    • Param1 (String): An optional parameter for the action.
    • Param2 (String): An optional parameter for the action.
    /* 
    Configuration for CameraAction command:
    
    Action: ["Capture", "CaptureNoAf", "StartLiveView", "StopLiveView", "Autofocus", "CaptureToPc", "CaptureToCard", "EnableCapture", "DisableCapture"]
    Param1: string
    Param2: string
    */
  10. Use the Saturation command for image processing

    master

    The Saturation command is an image processing plugin used to adjust the color saturation of an image within a workflow. It operates on the current ImageStream in the workflow context.

    Configuration

    The command accepts a single configurable property:

    Property NameTypeDefaultRangeDescription
    SaturationVariable00 to 200Adjusts the saturation level. 100 represents the original saturation level.

    Behavior

    • The command modifies the image in-place within the ImageStream.
    • The output format is written as a Bmp format.
    • If the ImageStream is null or the command's execution conditions are not met, the command returns without making changes.
    // Example of how the command is configured via its properties
    // Saturation: 0 (Default) to 200 (Max)
    // 100 is the neutral/original state
    command.Properties["Saturation"] = "150"; 
  11. Use the Level command for image processing

    master

    The Level command is an image processing plugin used to adjust the levels (brightness/contrast) of an image within a workflow. It allows you to define specific points for black, white, and midtones to re-map the image's color distribution.

    This command uses workflow variables for its parameters, allowing for dynamic adjustments based on previous steps in the workflow.

    // Example configuration of LevelAction properties
    {
      "DisplayName": "Level",
      "Group": "ImageProcessing",
      "Properties": {
        "BlackPoint": "0",
        "MidPoint": "0",
        "WhitePoint": "0"
      }
    }