Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6682373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:41:54+00:00 2026-05-26T04:41:54+00:00

Im trying out the codebook method, but don’t really understand the point of int

  • 0

Im trying out the codebook method, but don’t really understand the point of int t in a code_book struct. Its the variable used to “Count every access”, but this completely lost me. Count what access to what? By whom? Could someone please explain the purpose of the member variable to me? Please try to use non-technical terms

Secondly, in the ce struct, whats the point of the int t_last_update and int stale member data? t_last_update is supposed to kill stale entries, but whats a stale entry? What do you mean by “kill it”? And for int stale, its supposed to count the max negative run? Whats a negative run and whats its used for?

Thanks for your help

PS: just confirming what I need: explain what int t in a code_book struct does and what int t_last_update and int _stale do in a ce struct.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:41:55+00:00Added an answer on May 26, 2026 at 4:41 am

    I assume you are talking about this section of code from the OpenCV book:

    typedef struct code_book {
      ...
      int t; // Count every access
    } codeBook;
    

    Basically, you can think of the t field as a tick count each time a new frame is added to the code book. It used to determine how long it has been from the start of the code book collection, or the last clear of stale pixels.

    EDIT:
    You have two data structures being tracked. codeBook is like the parent of the codeBook_elements (i.e., the ce structure) stored within it. t is incremented every time the codeBook is updated. But, that update may not increment all codeBook_elements. So…

    t_last_update is the last time a particular codeBook_element was accessed.

    stale helps to track how “old” the code book entries are in the code book.

    negRun stands for negative run-time. It keeps track of how long it has been since a code book entry has been accessed. If it’s been too long, then it’s considered stale and is removed to conserve memory.

    There is an update of the code book method in the OpenCV samples. Take a look at the bgfg_codebook.cpp sample.

    Hope that was helpful!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just trying out a couple of Android samples. Struggling to find the method managedQuery
been trying out this for quite some time but I'm still unable to built
I´m trying out entity framework included in VS2010 but ´ve hit a problem with
Im trying out some iPhone scroll view tests, but when i load the view,
I'm trying-out qUnit for the first time but can't get any tests to run.
Trying out databinding for the first time, but something isn't working. I'm trying to
Im trying out the Google Maps API Geocoding feature.The map loads fine, but im
For trying out some pointer stuff, I made an instance variable in an existing
Trying out VS 2010, but still want to target .NET 3.5. Have all my
I am trying out functions and triggers int postgreSQL, however i am having a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.