# Basler Camera

This function block connects to Basler industrial cameras and provides live frames for processing or visualization. Use it when you have a Basler GigE camera on the network and want a reliable, low-delay image source.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

This function block has no inputs.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

`Image` This output provides the latest frame captured from the connected Basler camera.

## 🕹️ Controls <a href="#controls" id="controls"></a>

`IP Address` Enter the camera IP address. Leave empty to let the block try to use the first available Basler camera on the network.

`NAT Address` Optional NAT address to use when the camera is behind a network address translation setup.

`Destination Address` Optional destination address for multicast or network stream configuration (use only if required by your setup).

`Connect / Disconnect` The block will attempt to connect automatically when parameters are set and the scenario runs. Use the control area to change addresses and let the block reconnect automatically.

## 🎯 Key features <a href="#features" id="features"></a>

* Low-latency frame acquisition suitable for industrial inspection and real-time processing.
* Handles network camera discovery: use an IP to target a specific camera or leave the IP empty to use the first detected camera.
* Automatic reconnect when connection parameters change or when the camera becomes temporarily unavailable.
* Simple controls for NAT and destination settings to support more complex network setups.

## ⚙️ How it runs <a href="#running-mechanism" id="running-mechanism"></a>

* When the scenario runs, the block tries to connect to the camera using the given addresses.
* If connection parameters are changed, the block will attempt to reconnect automatically.
* While connected, the block outputs the most recent frame on the `Image` output for other blocks to consume.
* If the camera becomes unavailable, the block will report an error and try to recover; frames may be temporarily unavailable until reconnection succeeds.

## 📝 Usage <a href="#usage" id="usage"></a>

1. Provide the camera network information using the `IP Address` and optionally `NAT Address` or `Destination Address`.
2. Run the scenario. The block will connect and start outputting frames on `Image`.
3. Use the `Image` output as input to visualization, detection, analysis, or logging blocks.
4. If you need to change the camera or settings, update the fields; the block will reconnect automatically.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* For visual feedback and quick inspection, connect `Image` to the `Show Image` block.
* If you plan to record frames, route `Image` to `Record Video` or use `Image Logger` for saving stills.
* For object analysis or detection workflows, combine `Image` with AI blocks such as `Object Detection`, `Object Detection - Custom`, `Mask Detection`, `Pose Estimation`, or `Skeleton Estimation`.
* To focus processing on a region, connect `Image` to `Image ROI Select` or `Image ROI` and feed the cropped result to detectors (for example `Find Object` or `Template Match`).
* Use preprocessing blocks such as `Blur`, `Image Threshold`, or `Adjust Colors` to improve detection robustness under noisy or variable lighting.

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* No frames received: Check that the camera is powered and reachable from the computer network. Verify the correct `IP Address` or try leaving it empty to auto-detect.
* Intermittent frames or disconnects: Ensure network stability, and confirm any NAT or firewall settings. If using `NAT Address` or `Destination Address`, make sure they match your network routing.
* Wrong resolution or scaling: Some Basler settings are configured in the camera vendor software. If resolution adjustments are required, open the camera's configuration tool provided by the manufacturer.
* High latency: Reduce image size with `Image Resizer` or lower camera frame rate via the camera's settings to improve responsiveness.

If issues persist, try restarting the camera hardware and re-running the scenario, then check connections again.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.augelab.com/function-blocks/input-output/image-inputs/basler-camera.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
