Skip to content

Multiple MOG2_GPU objects share the same parameter values #5296

Closed

Description

Hi,

While using MOG2_GPU class, I realized that if you have two MOG2_GPU objets whenever you modify any parameter of one of the objects, the other is affected too.

Taking a look at OpenCV code, I think that this is related to the declaration of MOG2_GPU parameters in file "opencv/modules/cudabgsegm/src/cuda/mog2.cu", where MOG2_GPU variables are allocated only once, independently from the number of MOG2_GPU objects . As a consequence, each object that calls the loadConstants method, overwrites the variables values affecting every MOG2_GPU object.

I think that this implementation is similar to other gpu classes, so I suppose the same situation takes place with these classes.

My question is whether there is any plan to modify this behavior or this was implemented intentionally and there will be no modification in the future.

Activity

  1. added
    affected: 3.4
    category: gpu/cuda (contrib)
    on Sep 8, 2015
  2. logidelic commented on Dec 4, 2019

    @logidelic

    This one recently bit us... Any ideas if someone is working on it?

    Seems like, at the very least, the API should prevent allowing the creation of multiple instances of this. And/or the documentation should point out that it is unsafe...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected: 3.4bugcategory: gpu/cuda (contrib)priority: normal

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions