# Setting Area, finding Edges and adding Label

**URL:** <https://forum.commonvisionblox.com/t/setting-area-finding-edges-and-adding-label/1510>\
**Category:** Programming Questions\
**Created:** [September 21, 2021, 2:08pm UTC](https://forum.commonvisionblox.com/t/setting-area-finding-edges-and-adding-label/1510 "2021-09-21T14:08:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Chris](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/chris/32/1154_2.png) [@Chris](https://forum.commonvisionblox.com/u/Chris)\
**Post date:** [September 22, 2021, 5:42am UTC](https://forum.commonvisionblox.com/t/setting-area-finding-edges-and-adding-label/1510/2 "2021-09-22T05:42:55Z")

</div>

Hi George,

there are a lot of examples here in the forum that show you how to add overlays to a Display, for example:

[https://forum.commonvisionblox.com/t/how-to-add-overlay-objects-to-display-from-a-worker-thread-in-c/484/2](https://forum.commonvisionblox.com/t/how-to-add-overlay-objects-to-display-from-a-worker-thread-in-c/484/2)

If you are not shure on how to use the Edge tool, try checking the documentation first:  
[https://help.commonvisionblox.com/NextGen/14.0/md\_scripts\_main\_\_a\_p\_i\_\_overview.html](https://help.commonvisionblox.com/NextGen/14.0/md_scripts_main __a_p_i__ overview.html)

This should be pretty straight forward.

Now, what you want to do is add another Display to show the resulting image, am I right?  
If so, you have to have another displayControl or change the following line:

display.Image = value?.DeviceImage;

to not show the DeviceImage but the image you get from whatever processing you have done.

Your Edge Method call should look something like this:  
[FindFirst(ImagePlane, EdgeSearchMode, EdgeType, Double)](https://help.commonvisionblox.com/NextGen/14.0/cvbnet/df/d43/class_stemmer_1_1_cvb_1_1_foundation_1_1_edge.html#a76253cb3911121cda0c552942aa5b7f1)

To explain you where the ImagePlane overload of the method comes from you have to take a look at the getting started once again, especially the part with the async processing:

[https://forum.commonvisionblox.com/t/getting-started-with-cvb-net/246/10](https://forum.commonvisionblox.com/t/getting-started-with-cvb-net/246/10)

Here is the interesting part:

```cs
private async void grabCheckBox_CheckedChanged(object sender, EventArgs e)
{
  if (grabCheckBox.Checked)
  {
    Device.Stream.Start();
    openButton.Enabled = false;
    try
    {
      while (grabCheckBox.Checked)
      {
        using (StreamImage image = await Device.Stream.WaitAsync())
        {
          // processing
        }
      }
    }
    catch (OperationCanceledException)
    {
      // acquisition was aborted
    }
    finally
    {
      openButton.Enabled = true;
    }
  }
  else
  {
    if (Device.Stream.IsRunning)
      Device.Stream.Abort();
  }
}

```

After you called the WaitAsync(), you have an image that you can use as argument for your edge tool, well not exactly the whole image but image.Planes[0] (for mono cameras) for RGB cameras just pass the index of the plane you want to use for processing.

I will also update my Example here  
[https://forum.commonvisionblox.com/t/getting-started-displaying-multiple-cameras/1508](https://forum.commonvisionblox.com/t/getting-started-displaying-multiple-cameras/1508)  
To have another display that shows some image that is a result of some filter call or something like that.

For now I see, that you are making progress with the Forms approach so just stick with it but if you have time… just give my example a try.

Cheers  
Chris

---

_[View the full topic](https://forum.commonvisionblox.com/t/setting-area-finding-edges-and-adding-label/1510)._
