# Magic Segment

The magic segment tool is our automatic segmentation tool to let you draw object boundaries with a few clicks. To use magic segment, make sure you choose Polygon as one of the annotation tools during task creation.

### Magic Segment credits

To use the Magic Segment tool, you need credits. As a free users, you get 50 credits when you sign up. You consume a credit when you create an object boundary. To see the current status of your credits, click on the right arrow in the Segmentation section in the left sidebar. Note that a credit is only consumed if you accept the boundary predicted by the tool. If you wish to buy more credits, please get in touch with us at **<support@mindkosh.com>**

### Creating boundaries automatically

To start creating object boundaries, click on the magic wand icon in the Segmentation section in the left sidebar. Once in this mode, you need to provide positive as well as negative points to the tool in order to create a good object boundary.

<figure><img src="https://4219847035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaFKXVbOeJ2H3b8HBGVBG%2Fuploads%2FJpxkPTQrvJFqLNj17DsR%2FScreenshot%20from%202023-04-13%2017-35-10-mh.png?alt=media&#x26;token=5ae35a5a-ddce-44a0-9599-f4293c28f3aa" alt="The wand icon to activTE Magic Segment"><figcaption><p>The wand icon to activate Magic Segment</p></figcaption></figure>

#### Positive examples

To provide a positive example (a point that lies inside the object), use the `Left mouse button` to click anywhere within the target object. This point will be displayed in green. If the returned boundary is missing some parts of the object, provide another positive point to the tool by clicking anywhere within the left out area.

<figure><img src="https://4219847035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaFKXVbOeJ2H3b8HBGVBG%2Fuploads%2Fj9Qd5A3RqhogJ5vucjXl%2FScreenshot%20from%202023-04-13%2017-41-16.png?alt=media&#x26;token=ff0f1d52-2b3f-40a7-b1bd-88f657ee6458" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Processing each positive/negative point takes a few seconds. If you see a loading animation on the Magic wand icon, it means we are processing the request.
{% endhint %}

#### Negative Examples

If the returned boundary includes other objects (parts of image that are not part of the target object), you can provide the tool with a negative example. Use the `Right mouse button` to click anywhere within the extra area to do this. These points will be displayed in red.

#### Completing the mask

To complete the mask, click on the Complete button at the top of the image. In most cases boundaries can be drawn within 4-5 clicks. Here is a video showcasing the Magic Segment tool in action.

{% embed url="<https://youtu.be/jWj7QnIxFYo>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mindkosh.com/image-video-annotation/magic-segment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
