> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/opencv/opencv/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCV Documentation

<div className="relative overflow-hidden bg-gradient-to-br from-[#0a84ff] via-[#138af8] to-[#1e88e5] dark:from-[#0f1117] dark:via-[#1a1d27] dark:to-[#0f1117] py-20">
  <div className="absolute inset-0 bg-black/40 dark:bg-black/60" />

  <div className="relative max-w-6xl mx-auto px-6 lg:px-8">
    <div className="grid lg:grid-cols-12 gap-12 items-center">
      <div className="lg:col-span-7">
        <h1 className="text-5xl lg:text-6xl font-bold text-white mb-6">
          Open Source Computer Vision Library
        </h1>

        <p className="text-xl text-white/90 max-w-2xl mb-8">
          Build powerful computer vision applications with the world's most popular open-source CV library. Process images, detect objects, and deploy AI models across every platform.
        </p>

        <div className="flex flex-wrap gap-4">
          <a href="/quickstart" className="inline-flex items-center px-6 py-3 rounded-lg bg-white text-gray-900 font-semibold hover:bg-gray-100 transition-colors">
            Get Started

            <svg className="ml-2 w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 7l5 5m0 0l-5 5m5-5H6" />
            </svg>
          </a>

          <a href="/api/core/mat" className="inline-flex items-center px-6 py-3 rounded-lg border-2 border-white/30 bg-white/10 backdrop-blur-sm text-white font-semibold hover:bg-white/20 transition-colors">
            API Reference
          </a>
        </div>
      </div>

      <div className="lg:col-span-5 hidden lg:block">
        <div className="relative">
          <div className="absolute inset-0 bg-gradient-to-br from-[#138af8]/20 to-transparent rounded-2xl blur-3xl" />
        </div>
      </div>
    </div>
  </div>
</div>

<div className="mt-16 mb-16 max-w-5xl mx-auto px-6">
  <div className="text-center mb-12">
    <h2 className="text-3xl font-bold text-gray-900 dark:text-white mb-4">
      Quick start
    </h2>

    <p className="text-lg text-gray-600 dark:text-gray-400 max-w-2xl mx-auto">
      Get up and running with OpenCV in minutes
    </p>
  </div>

  <Steps>
    <Step title="Install OpenCV">
      Choose your preferred installation method based on your language and platform.

      <CodeGroup>
        ```bash Python (pip) theme={null}
        pip install opencv-python
        ```

        ```bash C++ (Ubuntu/Debian) theme={null}
        sudo apt-get install libopencv-dev
        ```

        ```bash macOS (Homebrew) theme={null}
        brew install opencv
        ```

        ```bash Windows (vcpkg) theme={null}
        vcpkg install opencv
        ```
      </CodeGroup>
    </Step>

    <Step title="Load and display an image">
      Start with the most basic operation: reading and displaying an image.

      <Tabs>
        <Tab title="Python">
          ```python theme={null}
          import cv2

          # Read an image
          image = cv2.imread('image.jpg')

          # Display the image
          cv2.imshow('My Image', image)
          cv2.waitKey(0)
          cv2.destroyAllWindows()
          ```
        </Tab>

        <Tab title="C++">
          ```cpp theme={null}
          #include <opencv2/opencv.hpp>

          int main() {
              // Read an image
              cv::Mat image = cv::imread("image.jpg");
              
              // Display the image
              cv::imshow("My Image", image);
              cv::waitKey(0);
              
              return 0;
          }
          ```
        </Tab>
      </Tabs>
    </Step>

    <Step title="Process your first image">
      Apply image processing operations like converting to grayscale and edge detection.

      <Tabs>
        <Tab title="Python">
          ```python theme={null}
          import cv2

          # Read image
          image = cv2.imread('image.jpg')

          # Convert to grayscale
          gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

          # Apply Canny edge detection
          edges = cv2.Canny(gray, 100, 200)

          # Save the result
          cv2.imwrite('edges.jpg', edges)
          ```
        </Tab>

        <Tab title="C++">
          ```cpp theme={null}
          #include <opencv2/opencv.hpp>

          int main() {
              cv::Mat image = cv::imread("image.jpg");
              cv::Mat gray, edges;
              
              // Convert to grayscale
              cv::cvtColor(image, gray, cv::COLOR_BGR2GRAY);
              
              // Apply Canny edge detection
              cv::Canny(gray, edges, 100, 200);
              
              // Save the result
              cv::imwrite("edges.jpg", edges);
              
              return 0;
          }
          ```
        </Tab>
      </Tabs>

      <Note>
        OpenCV uses BGR color format by default, not RGB. Keep this in mind when working with color images.
      </Note>
    </Step>

    <Step title="Explore advanced features">
      Now you're ready to explore object detection, face recognition, deep learning, and more.

      Check out the [tutorials](/tutorials/image-operations) or dive into the [API reference](/api/core/mat) to learn about specific modules.
    </Step>
  </Steps>
</div>

<div className="mt-16 mb-16 max-w-5xl mx-auto px-6">
  <div className="text-center mb-12">
    <h2 className="text-3xl font-bold text-gray-900 dark:text-white mb-4">
      Explore by topic
    </h2>

    <p className="text-lg text-gray-600 dark:text-gray-400">
      Discover what you can build with OpenCV
    </p>
  </div>

  <div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
    <a href="/modules/imgproc" className="group block rounded-2xl border border-gray-200 dark:border-[#27272a] hover:border-[#138af8] dark:hover:border-[#138af8] overflow-hidden transition-all no-underline bg-white dark:bg-[#1a1d27]">
      <div className="p-6">
        <div className="w-12 h-12 rounded-lg bg-[#138af8]/10 dark:bg-[#138af8]/20 flex items-center justify-center mb-4">
          <svg className="w-6 h-6 text-[#138af8]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
          </svg>
        </div>

        <h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-2">Image Processing</h3>

        <p className="text-sm text-gray-600 dark:text-gray-400 mb-3">
          Filtering, transformations, color space conversions, and geometric operations
        </p>

        <span className="text-sm font-medium text-[#138af8] group-hover:text-[#0a84ff] flex items-center">
          Learn more

          <svg className="ml-1 w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
          </svg>
        </span>
      </div>
    </a>

    <a href="/modules/objdetect" className="group block rounded-2xl border border-gray-200 dark:border-[#27272a] hover:border-[#138af8] dark:hover:border-[#138af8] overflow-hidden transition-all no-underline bg-white dark:bg-[#1a1d27]">
      <div className="p-6">
        <div className="w-12 h-12 rounded-lg bg-[#138af8]/10 dark:bg-[#138af8]/20 flex items-center justify-center mb-4">
          <svg className="w-6 h-6 text-[#138af8]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />

            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
          </svg>
        </div>

        <h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-2">Object Detection</h3>

        <p className="text-sm text-gray-600 dark:text-gray-400 mb-3">
          Detect faces, people, vehicles, and custom objects using cascade classifiers and deep learning
        </p>

        <span className="text-sm font-medium text-[#138af8] group-hover:text-[#0a84ff] flex items-center">
          Learn more

          <svg className="ml-1 w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
          </svg>
        </span>
      </div>
    </a>

    <a href="/modules/dnn" className="group block rounded-2xl border border-gray-200 dark:border-[#27272a] hover:border-[#138af8] dark:hover:border-[#138af8] overflow-hidden transition-all no-underline bg-white dark:bg-[#1a1d27]">
      <div className="p-6">
        <div className="w-12 h-12 rounded-lg bg-[#138af8]/10 dark:bg-[#138af8]/20 flex items-center justify-center mb-4">
          <svg className="w-6 h-6 text-[#138af8]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" />
          </svg>
        </div>

        <h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-2">Deep Learning</h3>

        <p className="text-sm text-gray-600 dark:text-gray-400 mb-3">
          Run neural networks from TensorFlow, PyTorch, ONNX, and other frameworks
        </p>

        <span className="text-sm font-medium text-[#138af8] group-hover:text-[#0a84ff] flex items-center">
          Learn more

          <svg className="ml-1 w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
          </svg>
        </span>
      </div>
    </a>

    <a href="/modules/video" className="group block rounded-2xl border border-gray-200 dark:border-[#27272a] hover:border-[#138af8] dark:hover:border-[#138af8] overflow-hidden transition-all no-underline bg-white dark:bg-[#1a1d27]">
      <div className="p-6">
        <div className="w-12 h-12 rounded-lg bg-[#138af8]/10 dark:bg-[#138af8]/20 flex items-center justify-center mb-4">
          <svg className="w-6 h-6 text-[#138af8]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z" />
          </svg>
        </div>

        <h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-2">Video Analysis</h3>

        <p className="text-sm text-gray-600 dark:text-gray-400 mb-3">
          Object tracking, motion detection, optical flow, and background subtraction
        </p>

        <span className="text-sm font-medium text-[#138af8] group-hover:text-[#0a84ff] flex items-center">
          Learn more

          <svg className="ml-1 w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
          </svg>
        </span>
      </div>
    </a>

    <a href="/modules/calib3d" className="group block rounded-2xl border border-gray-200 dark:border-[#27272a] hover:border-[#138af8] dark:hover:border-[#138af8] overflow-hidden transition-all no-underline bg-white dark:bg-[#1a1d27]">
      <div className="p-6">
        <div className="w-12 h-12 rounded-lg bg-[#138af8]/10 dark:bg-[#138af8]/20 flex items-center justify-center mb-4">
          <svg className="w-6 h-6 text-[#138af8]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7" />
          </svg>
        </div>

        <h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-2">3D Reconstruction</h3>

        <p className="text-sm text-gray-600 dark:text-gray-400 mb-3">
          Camera calibration, pose estimation, stereo vision, and 3D reconstruction
        </p>

        <span className="text-sm font-medium text-[#138af8] group-hover:text-[#0a84ff] flex items-center">
          Learn more

          <svg className="ml-1 w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
          </svg>
        </span>
      </div>
    </a>

    <a href="/modules/features2d" className="group block rounded-2xl border border-gray-200 dark:border-[#27272a] hover:border-[#138af8] dark:hover:border-[#138af8] overflow-hidden transition-all no-underline bg-white dark:bg-[#1a1d27]">
      <div className="p-6">
        <div className="w-12 h-12 rounded-lg bg-[#138af8]/10 dark:bg-[#138af8]/20 flex items-center justify-center mb-4">
          <svg className="w-6 h-6 text-[#138af8]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01" />
          </svg>
        </div>

        <h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-2">Feature Detection</h3>

        <p className="text-sm text-gray-600 dark:text-gray-400 mb-3">
          SIFT, SURF, ORB, and other keypoint detectors and descriptors
        </p>

        <span className="text-sm font-medium text-[#138af8] group-hover:text-[#0a84ff] flex items-center">
          Learn more

          <svg className="ml-1 w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
          </svg>
        </span>
      </div>
    </a>
  </div>
</div>

<div className="mt-16 mb-16 max-w-5xl mx-auto px-6">
  <div className="text-center mb-12">
    <h2 className="text-3xl font-bold text-gray-900 dark:text-white mb-4">
      Resources
    </h2>

    <p className="text-lg text-gray-600 dark:text-gray-400">
      Everything you need to succeed with OpenCV
    </p>
  </div>

  <CardGroup cols={2}>
    <Card title="Tutorials" icon="graduation-cap" href="/tutorials/image-operations">
      Step-by-step guides for common computer vision tasks
    </Card>

    <Card title="API Reference" icon="code" href="/api/core/mat">
      Complete documentation of all OpenCV modules and functions
    </Card>

    <Card title="Examples" icon="flask" href="/examples/read-display">
      Real-world code examples in Python and C++
    </Card>

    <Card title="GitHub Repository" icon="github" href="https://github.com/opencv/opencv">
      View source code, report issues, and contribute
    </Card>
  </CardGroup>
</div>

<div className="mt-20 mb-16 max-w-5xl mx-auto px-6">
  <div className="rounded-2xl bg-gradient-to-r from-[#138af8] to-[#1e88e5] dark:from-[#1a1d27] dark:to-[#242838] border dark:border-[#27272a] p-8 md:p-12 text-center">
    <h2 className="text-3xl font-bold text-white dark:text-white mb-4">
      Ready to get started?
    </h2>

    <p className="text-lg text-white/90 dark:text-gray-300 mb-8 max-w-2xl mx-auto">
      Install OpenCV and build your first computer vision application in minutes
    </p>

    <a href="/quickstart" className="inline-flex items-center px-8 py-3 rounded-lg bg-white dark:bg-[#138af8] text-gray-900 dark:text-white font-semibold hover:bg-gray-100 dark:hover:bg-[#0a84ff] transition-colors">
      Start Building

      <svg className="ml-2 w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
        <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 7l5 5m0 0l-5 5m5-5H6" />
      </svg>
    </a>
  </div>
</div>
