Comments

12 comments

  • Avatar
    Andrey Terentyev

    Hello David,

    Could you please elaborate, what kind of control do you mean?

    What would you like to be able to do with API?


    JIRA-VMS-32350

    0
    Comment actions Permalink
  • Avatar
    David Grinberg

    I mean set selection area rectangle for camera other than from UI (from plugin for example)

    Found this but I am not sure if that is the only way to achieve what I want

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hi,

    I got your.

    ROI are plugin specific and can't be passed to DeviceAgent class only.

    Unfortunately, there is no such API.

    However, you could make your plugin to listen of a certain port for receiving ROI settings.

    Found this but I am not sure if that is the only way to achieve what I want

    Could you tell more detailed about your scenario? We would think about a solution for that in future versions.

    0
    Comment actions Permalink
  • Avatar
    David Grinberg

    Basically I have NX plugin which sends events to some custom UI with ROI selection functional and I want to synchronize that selection with NX client (both ways)

    0
    Comment actions Permalink
  • Avatar
    David Grinberg

    ROI are plugin specific and can't be passed to DeviceAgent class only.

    So you mean that plugin can react to ROI settings change but NX does not (if I call IEngine::doSetSettings)?

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    David,

    == Sync from the custom UI to the NX.

    All the settings you can see in GUI are loaded from the engineSettingsModel or deviceAgentSettingsModel when the settings window is opened.

    When the Server is requested for plugin settings values, it reads them from the DB and asks the plugin its side settings if any exist.

    pluginSudeSettings() - > getPluiginSideSettings()

    Here is the point you can pass to the Server the updated ROI values received via the network socket from custom UI. Another option is to request the values online from the custom UI.

    When your plugin is being loaded, can request external application for the latest values.

    == Sync from the NX to the custom UI.

    Settings values, once the OK button is pressed, are passed to the Server, The Sever saves values to the DB and then passes to the plugin:

    IEngine::setSettings() -> IEndinge::doSetSettings() -> IEndine::settingsRecieved()

    IDeviceAgent::setSettings() -> IDeviceAgent::doSetSettings() -> IDeviceAgent::settingsRecieved()

    These are points, where you can pass settings values to the custom UI.

    We highly recommend using helper classes for changing or extending the default behavior of the interface class methods.

     

    1
    Comment actions Permalink
  • Avatar
    David Grinberg

    Thank you! I have one more question though:

    When the Server is requested for plugin settings values, it reads them from the DB and asks the plugin its side settings if any exist.

    as I understand this only happens when user opens "Camera Settings -> Plugin bla-bla", as it is said in docs:

    In addition to the settings stored in a Server database, a DeviceAgent can have some settings which are stored somewhere "under the hood" of the DeviceAgent, e.g. on a device acting as a DeviceAgent's backend. Such settings do not need to be explicitly marked in the Settings Model, but every time the Server offers the user to edit the values, it calls this method and merges the received values with the ones in its database.

    can I somehow force settings update so that custom UI and NX are consistent ASAP? The problem is that ROI will be displayed on image from camera, user will see it (aka its settings) before he goes to settings menu

    0
    Comment actions Permalink
  • Avatar
    David Grinberg

    can I somehow force settings update so that custom UI and NX are consistent ASAP? The problem is that ROI will be displayed on image from camera, user will see it (aka its settings) before he goes to settings menu

    Seems like no for now

    0
    Comment actions Permalink
  • Avatar
    Tagir Gadelshin

    David Grinberg

    thank you for the detailed explanation. We understand the problem and will work on a fix.

    JIRA-VMS-32350

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    David,

    as I understand this only happens when user opens "Camera Settings -> Plugin bla-bla"

    That's correct.

    can I somehow force settings update so that custom UI and NX are consistent ASAP? The problem is that ROI will be displayed on image from camera, user will see it (aka its settings) before he goes to settings menu

    I'd like to pay the attention to one crucial point to understand. The idea standing behind the setting logic is that it's a plugin who's responsible for storing and providing the most actual setting values. The Server keeps values in the DB just for convenience, so to say.

    In other words, if your plugin has the most resent ROI setting values got from the external UI (no matter our GUI client or your custom UI), it can process frames properly. Displaying the recent values is a secondary question, a visual effect so to say, which does not influence actual frame processing.

    To recap.

    There are two layers to be distinguished.

    1) ROI values for proper frame processing.

    2) ROI displaying in the GUI.

    Of course, we'll try to provide with the most useful tools and interfaces possible for getting/storing settings values, but at the moment you could maintain the most recent setting values inside the plugin.

    can I somehow force settings update so that custom UI and NX are consistent ASAP?

    For proper frame processing, just apply in the plugin code the ROI values received from the custom UI over a network socket.

    For displaying recent values in the GUI client, the settings window has to be reopened. "Camera Settings -> Plugin

     

    0
    Comment actions Permalink
  • Avatar
    David Grinberg

    Maybe I should start a different thread but the problem is strongly related to context.

    As I understand there are two types of ROI/"Selection area" inside NX.

    1. One is ROI which we were discussing previously - it is only used by plugin and does not control motion detection area of NX.

    2. And the second is selection inside Camera Settings -> Motion tab, which does control motion detection area of NX.

    The problem is I would like to sync these two types of ROI too in order to do "coarse" NX motion detection and only then the finer detection by my plugin. For now I have to duplicate these two types of ROI which is very inconvenient 

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hi  David Grinberg,

    2. And the second is selection inside Camera Settings -> Motion tab, which does control motion detection area of NX.

    This can be get/set with the  /rest/v1/devices/{id} API in version 5.0, /ec2/getCameraUserAttributesList and /ec2/saveCameraUserAttributesList in version 4.2.

    see the

    "motion": {
        "mask": ""
    }

    in version 5.0

    and the motionMask parameter in version 4.2

    List of motion detection areas and their sensitivity. The format is
    proprietary and is likely to change in future API versions. Currently, this string defines
    several rectangles separated with ":", each rectangle is described by 5 comma-separated
    numbers: sensitivity, x and y (for left top corner), width, height.

    0
    Comment actions Permalink

Please sign in to leave a comment.