[Python] Extracting polygon given coordinates from an image using OpenCV

Discussão em 'Python' iniciado por Stack, Abril 4, 2025.

  1. Stack

    Stack Membro Participativo

    I've a set of points like the following:

    <data:polygon>
    <data:point x="542" y="107"/>
    <data:point x="562" y="102"/>
    <data:point x="582" y="110"/>
    <data:point x="598" y="142"/>
    <data:point x="600" y="192"/>
    <data:point x="601" y="225"/>
    <data:point x="592" y="261"/>
    <data:point x="572" y="263"/>
    <data:point x="551" y="245"/>
    <data:point x="526" y="220"/>
    <data:point x="520" y="188"/>
    <data:point x="518" y="152"/>
    <data:point x="525" y="127"/>
    <data:point x="542" y="107"/
    </data:polygon>


    I want to draw the polygon defined by these points in the image and then extract it. How can I do that using OpenCV with python ?

    Continue reading...

Compartilhe esta Página