# Argus 0.97.3 setting camera sharpness in edge enhancement having issue

**URL:** <https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536>\
**Category:** Jetson TX2\
**Tags:** camera\
**Created:** [December 20, 2021, 8:40pm UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536 "2021-12-20T20:40:02Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![jon7](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jon7](https://forums.developer.nvidia.com/u/jon7)\
**Post date:** [December 20, 2021, 8:40pm UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/1 "2021-12-20T20:40:02Z")

</div>

Hello,  
We are using TX2 and two leopard imaging IMX577 cameras. The OS of TX2 is L4T 32.5.0. Argus 0.97.3.

I found that if I set the strength of edge enhancement to say 0.15, then when I read the strength value from the meta data of the frames, its value is 0.85, which is 1 minus 0.15. I have tried multiple values with all 3 modes (EDGE\_ENHANCE\_MODE\_OFF, EDGE\_ENHANCE\_MODE\_FAST and EDGE\_ENHANCE\_MODE\_HIGH\_QUALITY), this applies to all of them.

Is there any reason why the strength value read from the metadata of the frame equals 1 minus the value set?

Here is how I set the edge enhancement:

```cpp
bool IMX577StereoCamera::configCameraSharpness(IEdgeEnhanceSettings *iEdgeEnhanceSettings, const IMX577Sharpness& sharpnessConfig)
{
    bool res = false;
    Argus::Status status = STATUS_OK;
    if(iEdgeEnhanceSettings != nullptr)
    {
        if(sharpnessConfig.m_strength >= 0 && sharpnessConfig.m_strength <= 1)
        {
            status = iEdgeEnhanceSettings->setEdgeEnhanceMode(*(sharpnessConfig.m_mode));
            if(status == STATUS_OK)
            {
                status = iEdgeEnhanceSettings->setEdgeEnhanceStrength(sharpnessConfig.m_strength);
                if(status == STATUS_OK)
                {
                    res = true;
                }
                else
                {
                    logAndThrow("Error setting sharpness strength", __FILE__ , __LINE__ );
                }
            }
            else
            {
                logAndThrow("Error setting sharpness mode", __FILE__ , __LINE__ );
            }
        }
        else
        {
            std::stringstream ss;
            ss << VAR_VAL_STREAM(sharpnessConfig.m_strength) << " out of range [0,1]";
            logAndThrow(ss.str(), __FILE__ , __LINE__ );
        }
    }
    else
    {
        std::stringstream ss;
        ss << "nullptr found, " << VAR_VAL_STREAM(iEdgeEnhanceSettings);
        logAndThrow(ss.str(), __FILE__ , __LINE__ );
    }
    return res;
}

```

Here is how I read the settings from the frame:

```cpp
void LIIMX577Camera::getCurCamSettings(Argus::UniqueObj<EGLStream::Frame>& frame)
{
    LIIMX577CameraSetting setting;
    EGLStream::IArgusCaptureMetadata *iArgusCaptureMetadata = interface_cast<EGLStream::IArgusCaptureMetadata>(frame);
    if(iArgusCaptureMetadata == nullptr)
    {
        logAndThrow("Cannot get IArgusCaptureMetadata", __FILE__ , __LINE__ );
    }

    CaptureMetadata *metadata = iArgusCaptureMetadata->getMetadata();
    if(metadata == nullptr)
    {
        logAndThrow("Cannot get CaptureMetadata", __FILE__ , __LINE__ );
    }

    ICaptureMetadata *iMetadata = interface_cast<ICaptureMetadata>(metadata);
    if(metadata == nullptr)
    {
        logAndThrow("Cannot get ICaptureMetadata", __FILE__ , __LINE__ );
    }

    IEdgeEnhanceMetadata *iEdgeEnahenceMetadata = interface_cast<IEdgeEnhanceMetadata>(metadata);
    if(iEdgeEnahenceMetadata == nullptr)
    {
        logAndThrow("Cannot get IEdgeEnhanceMetadata", __FILE__ , __LINE__ );
    }

    /* sharpness setting */
    setting.m_sharpness.m_mode.reset(new Argus::EdgeEnhanceMode(iEdgeEnahenceMetadata->getEdgeEnhanceMode()));
    setting.m_sharpness.m_strength = iEdgeEnahenceMetadata->getEdgeEnhanceStrength();
    MMI_INFO_LOG_L << "setting.m_sharpness.m_strength" << setting.m_sharpness.m_strength;

    // .... More code
}

```

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [December 21, 2021, 6:57am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/3 "2021-12-21T06:57:03Z")

</div>

I just check on r32.6.1 with argus\_camera by below modify without problem.

```auto
diff --git a/public/apps/camera/modules/Dispatcher.cpp b/public/apps/camera/modules/Dispatcher.cpp
index 6c0153e..aac8830 100644
--- a/public/apps/camera/modules/Dispatcher.cpp
+++ b/public/apps/camera/modules/Dispatcher.cpp
@@ -207,6 +207,7 @@ private:
             ORIGINATE_ERROR("Failed to set the edge enhancement strength");
         }

+ printf("get EdgeEnhanceStrength %f\n", m_iEdgeEnhanceSettings->getEdgeEnhanceStrength());
         PROPAGATE_ERROR(Dispatcher::getInstance().restartActiveRequests());

         return true;

```

---

<div class="post-metadata">

**Author:** ![jon7](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jon7](https://forums.developer.nvidia.com/u/jon7)\
**Post date:** [December 21, 2021, 9:29am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/4 "2021-12-21T09:29:02Z")

</div>

Hi Shane, I am using different version than yours. Can you check 32.5.0?

Thanks.

---

<div class="post-metadata">

**Author:** ![jon7](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jon7](https://forums.developer.nvidia.com/u/jon7)\
**Post date:** [December 21, 2021, 8:12pm UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/5 "2021-12-21T20:12:34Z")

</div>

Hi Shane,  
I have just double checked the change you ve made to argus\_camera. The difference is that I am reading the edge enhancement data from metadata of the frame. If you read my code in detail, you will find that I am reading the edge enhancement metadata. It shows 1 minus the value that I set to.

Update: I have tried to read the edge enhance strength from IEdgeEnhanceSettings \* interface. The value equals to the one I set to.

So, I think I need a explanation of why the edge enhancement strength read from metadata is 1 minus the value I set to.

Thanks,

Jon

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [December 22, 2021, 3:12am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/6 "2021-12-22T03:12:21Z")

</div>

Could you read it after few frames after set the value.

---

<div class="post-metadata">

**Author:** ![jon7](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jon7](https://forums.developer.nvidia.com/u/jon7)\
**Post date:** [December 22, 2021, 8:33am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/7 "2021-12-22T08:33:50Z")

</div>

Hi Shane,  
I have tried to read the edge enhancement strength from metadata after few frames, I had the same results. it is still 1 minus the value I set to.

I also modified the argus\_camera, I got the same result. The edge enhancement strength from metadata is still 1 minus the value I set to…

Here is the code I added:

```cpp
                // edge enhancement strengh
                const Argus::IEdgeEnhanceMetadata *iEdgeEnhanceMetadata = Argus::interface_cast<const Argus::IEdgeEnhanceMetadata>(metaData);
                if(iEdgeEnhanceMetadata)
                {
                    printf("iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=%.4f\n", iEdgeEnhanceMetadata->getEdgeEnhanceStrength());
                }
                else
                {
                    PROPAGATE_ERROR(dispatcher.message("Cannot get iEdgeEnhanceMetadata\n"));
                }

```

This code is added to argus/apps/camera/modules/EventThread.cpp file, line 133. I also attached the EventThread.cpp for your reference.  
[EventThread.cpp](https://forums.developer.nvidia.com/uploads/short-url/bAUX2mCSNcVSfo2LfmG0yKN2KA6.cpp) (6.9 KB)

But I found that the strength does work and if the larger the value, the more edge enhancement applied, although I set the value to 0.9 and the meta data read back as 0.1.

Please provide some explanation to this. Is this a bug of the argus library? or the bug of the camera? Or what happened there?

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [December 22, 2021, 9:14am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/8 "2021-12-22T09:14:34Z")

</div>

I didn’t get the message by add your code.  
I am run the argus\_camera by ssh remotely.

```auto
./argus_camera --edgeenhancestrength=0.5

```

---

<div class="post-metadata">

**Author:** ![jon7](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jon7](https://forums.developer.nvidia.com/u/jon7)\
**Post date:** [December 22, 2021, 9:23am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/9 "2021-12-22T09:23:33Z")

</div>

I am using the argus\_camera GUI. In the GUI, Enable verbose and KPI. Select multi-session. And I have 2 cameras.

If you can follow my steps, you should be able to see the message from terminal.

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [December 22, 2021, 9:41am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/10 "2021-12-22T09:41:28Z")

</div>

Looks like the 32.6.1 have fix your problem.

```auto
 ./argus_camera --kpi=1 --edgeenhancestrength=0.5
Executing Argus Sample Application (argus_camera)
Argus Version: 0.98.3 (multi-process)
PerfTracker: app initial 577 ms
PerfTracker 1: app intialized to task start 441 ms
get EdgeEnhanceStrength 0.500000
PerfTracker 1: task start to issue capture 56 ms
PerfTracker 1: first request 294 ms
PerfTracker 1: total launch time 1369 ms
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
PerfTracker 1: frameRate 24.41 frames per second at 0 Seconds
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
PerfTracker 1: framedrop current request 0, total 0
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
PerfTracker 1: latency 91 ms average, min 89 max 97
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000
iEdgeEnhanceMetadata->getEdgeEnhanceStrength()=0.5000

```

---

<div class="post-metadata">

**Author:** ![jon7](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jon7](https://forums.developer.nvidia.com/u/jon7)\
**Post date:** [December 22, 2021, 9:15pm UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/11 "2021-12-22T21:15:50Z")

</div>

Hi Shane,  
If you set strength to 0.5, I cannot really see if it fixed it or not, since 1-0.5=0.5. Could you try some other values. For example:

```nohighlight
# Check if strength value from meta data is 0.85 or 0.15
./argus_camera --kpi=1 --edgeenhancestrength=0.15

# Check if strength value from meta data is 0.3 or 0.7
./argus_camera --kpi=1 --edgeenhancestrength=0.7

```

Thank you  
Jon

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [December 23, 2021, 3:28am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/12 "2021-12-23T03:28:32Z")

</div>

OK, I saw the problem will check it and update it.

Thanks

---

<div class="post-metadata">

**Author:** ![jon7](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jon7](https://forums.developer.nvidia.com/u/jon7)\
**Post date:** [December 31, 2021, 6:20pm UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/13 "2021-12-31T18:20:04Z")

</div>

Hi Shane,  
Could you clarify with me that is it an bug from argus lib?  
Also, I need to confirm the behavior with you. Say if I set the strength to 0.8 and I read 0.2 back from the meta data. Is the actual strength used by camera 0.8 or 0.2?

I need more detailed explanation here.

Thanks,

Jon

---

<div class="post-metadata">

**Author:** ![jon7](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jon7](https://forums.developer.nvidia.com/u/jon7)\
**Post date:** [January 3, 2022, 7:22pm UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/15 "2022-01-03T19:22:32Z")

</div>

Hi Shane, any response to my most recent post?

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [January 4, 2022, 3:02am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/16 "2022-01-04T03:02:42Z")

</div>

I am consulting with developer to clarify it once get result will update to you.

Thanks

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [January 5, 2022, 5:55am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/17 "2022-01-05T05:55:57Z")

</div>

@jon7  
Just confirm it’s a bug and will fix in next release. For your current version you can consider the value get from metadata classes substracted by 1

Also valid range is [0-1] for manual mode strength. If negative value is set it will be treated as auto mode

---

<div class="post-metadata">

**Author:** ![jon7](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jon7](https://forums.developer.nvidia.com/u/jon7)\
**Post date:** [January 9, 2022, 7:31am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/18 "2022-01-09T07:31:01Z")

</div>

> [@ShaneCCC](#):
>
> For your current version you can consider the value get from metadata classes substracted by 1

I would like to clarify your statement above. Let us take an example, say if I set the strength to 0.15. Then I read 0.85 back from the metadata. Based on your statement, the actual value I should use is 1-0.85=0.15. Is my understanding correct?

> [@ShaneCCC](#):
>
> Also valid range is [0-1] for manual mode strength.

We have 3 modes for edge enhancement, EDGE\_ENHANCE\_MODE\_OFF, EDGE\_ENHANCE\_MODE\_FAST and EDGE\_ENHANCE\_MODE\_HIGH\_QUALITY. When you talk about manual mode, do you refer to EDGE\_ENHANCE\_MODE\_FAST and EDGE\_ENHANCE\_MODE\_HIGH\_QUALITY?

> [@ShaneCCC](#):
>
> If negative value is set it will be treated as auto mode

Where can I set the edge enhancement auto mode? is auto mode the same as EDGE\_ENHANCE\_MODE\_FAST or EDGE\_ENHANCE\_MODE\_HIGH\_QUALITY?

Thanks,

Jon

---

<div class="post-metadata">

**Author:** ![jon7](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jon7](https://forums.developer.nvidia.com/u/jon7)\
**Post date:** [January 15, 2022, 8:21am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/19 "2022-01-15T08:21:56Z")

</div>

Hi @ShaneCCC ,  
Can you reply my post please?

Thanks,  
Jon

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [January 17, 2022, 2:14am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/20 "2022-01-17T02:14:28Z")

</div>

Yes, that is correct.

> [@jon7](#):
>
> the actual value I should use is 1-0.85=0.15. Is my understanding correct?

Auto mode should be the EDGE\_ENHANCE\_MODE\_FAST

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [February 9, 2022, 2:55am UTC](https://forums.developer.nvidia.com/t/argus-0-97-3-setting-camera-sharpness-in-edge-enhancement-having-issue/198536/22 "2022-02-09T02:55:28Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
