Results 1 to 4 of 4

Thread: How to use vxuHistogram()

  1. #1
    Newbie
    Join Date
    Jul 2017
    Posts
    2

    How to use vxuHistogram()

    I am trying to use OpenVX Histogram (as per Spec 1.1) and little puzzled in the usage part. My understanding is like this (Please correct me):

    Code :
    vx_size numBins = 10;
    vx_uint32 offset = 10;
    vx_uint32 range = 256;
    // Create Object
    vx_distribution vx_dist = vxCreateDistribution (Context, numBins, offset, 
    range);
     
    // Create Node
    vx_status status = vxuHistogram (context, img, vx_dist);

    Spec says that vxuHistogram() takes vx_distribution as [out], does that means vxuHistogram() creates object internally? If the answer is 'Yes' than how would i pass numBins, Offset and range of my choice?

    Also. how can i access the output of histogram result? Any sample code would be really helpful.

  2. #2
    Newbie
    Join Date
    Jul 2017
    Posts
    2
    vxuHistogram() is vxHistogram()

  3. #3
    Junior Member
    Join Date
    Jan 2015
    Posts
    9
    Quote Originally Posted by milinddeore View Post
    Spec says that vxuHistogram() takes vx_distribution as [out], does that means vxuHistogram() creates object internally? If the answer is 'Yes' than how would i pass numBins, Offset and range of my choice?
    No vxuHistogram() does NOT create the vx_distribution object internally; vxuHistogram populates the histogram information inside of the vx_distribution object that you have already created and pass to it. Your code is correct to setup the vx_distribution before passing it to the vxuHistogram function.

    Quote Originally Posted by milinddeore View Post
    Also. how can i access the output of histogram result? Any sample code would be really helpful.
    After calling vxuHistogram, you can access the result histogram using either vxCopyDistribution() into a user allocated buffer, or vxMapDistribution() to get access to the framework-allocated pointer where the histogram is located.

    - - - Updated - - -

    Quote Originally Posted by milinddeore View Post
    vxuHistogram() is vxHistogram()
    Same answer for vxu and vx versions, except in vxHistogram(), this only creates the node. You will need more code to create a graph and process the graph.

  4. #4
    Quote Originally Posted by jessegv View Post
    No vxuHistogram() does NOT create the vx_distribution object internally; vxuHistogram populates the histogram information inside of the vx_distribution object that you have already created and pass to it. Your code is correct to setup the vx_distribution before passing it to the vxuHistogram function.



    After calling vxuHistogram, you can access the result histogram using either vxCopyDistribution() into a user allocated buffer, or vxMapDistribution() to get access to the framework-allocated pointer where the histogram is located.

    - - - Updated - - -



    Same answer for vxu and vx versions, except in vxHistogram(), this only creates the node. You will need more code to create a graph and process the graph.
    Thanks, I did it successfully.
    http://www.gamebigkool.net/

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean