# Edge detection and human pose detection

ControlNet can do: Controlling image generation with (1) edge detection and (2) human pose detection

## Edge detection example

Using the Canny edge detector, an image containing the detected edges is then saved as a control map. It is fed into the ControlNet model as an extra conditioning together with the text prompt, and images are generated based on these two conditionings.

<figure><img src="/files/Gmpd3o9hJVRsjVpjt4eV" alt=""><figcaption></figcaption></figure>

## Human pose detection example

<mark style="color:orange;">**Openpose**</mark> is a fast keypoint detection model that can extract human poses like positions of hands, legs, and head. Below is the ControlNet workflow using OpenPose. Keypoints are extracted from the input image using OpenPose, and saved as a control map containing the positions of key points. It is then fed to Stable Diffusion as an extra conditioning together with the text prompt. Images are generated based on these two conditionings.

<figure><img src="/files/EEd7o6lAPBh0w7eM7jzk" alt=""><figcaption></figcaption></figure>

## Difference between using Canny edge detection and Openpose?

The Canny edge detector extracts the edges of the subject and background alike. It tends to translate the scene more faithfully. You can see the dancing man became a woman, but the outline and hairstyle are preserved.

OpenPose only detects human key points such as positions of the head, arms, etc. The image generation is more liberal but follows the original pose.

{% embed url="<https://stable-diffusion-art.com/controlnet/#What_is_ControlNet>" %}


---

# 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://yunaeecy.gitbook.io/wiki/artificial-intelligence/readme-3/edge-detection-and-human-pose-detection.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.
