Design public APIs to work seamlessly across different programming languages and platforms. Follow these key principles:

  1. Use platform-agnostic types in public interfaces:
  2. Add proper binding annotations for cross-language support:
    class CV_EXPORTS_W MyClass {
    public:
     CV_WRAP void process(int size);  // Not size_t
     CV_WRAP_AS(processBytes) Mat process(InputArray data);  // Alias for clarity
    };
    
  3. Avoid passing language-specific objects through plugin/module boundaries:
  4. Maintain binary compatibility:

Following these guidelines ensures your API works reliably across Python, Java, and C++ while maintaining long-term stability.