# cv::error: (-215:Assertion failed) !_dictionary.empty() in function 'detectMarkers'

- **ID:** `opencv/aruco-dictionary-not-found`
- **Domain:** opencv
- **Category:** assertion_error
- **Error Code:** `-215`
- **Verification:** ai_generated
- **Fix Rate:** 92%

## Root Cause

The ArUco dictionary object passed to cv::aruco::detectMarkers is empty or not properly initialized, often due to an invalid dictionary ID or failed creation.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 4.6.0 | active | — | — |
| 4.8.1 | active | — | — |
| 4.9.0 | active | — | — |

## Workarounds

1. **Use a predefined dictionary: cv::aruco::Dictionary dictionary = cv::aruco::getPredefinedDictionary(cv::aruco::DICT_6X6_250);** (95% success)
   ```
   Use a predefined dictionary: cv::aruco::Dictionary dictionary = cv::aruco::getPredefinedDictionary(cv::aruco::DICT_6X6_250);
   ```
2. **Check dictionary availability before use: if (dictionary.empty()) { /* fallback */ }** (90% success)
   ```
   Check dictionary availability before use: if (dictionary.empty()) { /* fallback */ }
   ```

## Dead Ends

- **** — The dictionary object may be empty if not populated with marker images; detectMarkers requires a non-empty dictionary with predefined markers. (80% fail)
- **** — If the dictionary ID is not available in the OpenCV build, the constructor returns an empty dictionary, causing the assertion. (85% fail)
