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

  • SEARCH
  • Home
  • 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 760219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:41:27+00:00 2026-05-14T15:41:27+00:00

I have a loop which goes through a video with some processing/calculations of the

  • 0

I have a loop which goes through a video with some processing/calculations of the images. I want to save the image in the loop with the highest value from the processing, but I’m struggling a bit with storing the image temporally while the loop finishes.

The images/frames are initialized like this

IplImage* frame = 0;
IplImage* maxframe = 0;

While looping the maxframe is found by

if( currentvalue > maxvalue ) {
    maxvalue = currentvalue;
    maxframe = frame;
}

I’m aware that what I am storing in the maxframe variable is the same pointer to the frame currently loaded in the frame pointer. When a new frame is loaded into the frame variable, this will also be pointed to by the maxframe pointer. So when I save the image pointed to by maxframe, I save the last image in the loop no matter what its calculated value is.

I have tried a lot of different solutions, but I can’t seem to solve this problem. Can anyone help me? 🙂

  • 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-14T15:41:28+00:00Added an answer on May 14, 2026 at 3:41 pm

    probably the frame IplImage* gets recycled by OpenCv internal referencing system. Have you tried to do a deep copy of the image, using IplImage* cvCloneImage(const IplImage* image)?
    By the way, with openCv 2.0 and up it’s better if you use a cvMat (or cv::Mat) to hold images… Use then cv::Mat image, then image.clone();

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

Sidebar

Related Questions

I have a loop which goes through each item a list and adds it
I have a while loop in Main() which goes through several methods. Although one
I have problem with the Graphic object. I have a loop which goes through
I have a for-loop which is setting the value of the progress bar on
I have a very large nested for loop in which some multiplications and additions
I've got a loop which goes through various products being imported. Within this loop
I have an image gallery which website members can upload images to. When an
I have a transverse tree written in JSP which goes through an XML file.
I have a loop which basically calls this every few seconds (after the timeout):
I have a loop which needs to create an unspecified and indefinite amount of

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.