# Segmentation with an AI model with Opencv

**URL:** <https://forum.opencv.org/t/segmentation-with-an-ai-model-with-opencv/21101>\
**Category:** C++\
**Tags:** dnn\
**Created:** [May 27, 2025, 7:58am UTC](https://forum.opencv.org/t/segmentation-with-an-ai-model-with-opencv/21101 "2025-05-27T07:58:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CJACQUEL](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@CJACQUEL](https://forum.opencv.org/u/CJACQUEL)\
**Post date:** [May 27, 2025, 7:58am UTC](https://forum.opencv.org/t/segmentation-with-an-ai-model-with-opencv/21101/1 "2025-05-27T07:58:46Z")

</div>

Hello,  
How to segment an image using an AI model like SAM, using C++ and opencv. Do you have an example?  
Thx
