Ask Your Question
0

Writing & showing Image [closed]

asked 2013-04-03 07:23:28 -0500

Tomazi gravatar image

updated 2013-04-03 07:43:00 -0500

Andrey Pavlenko gravatar image

Hey people....

I am recording a video footage and preforming various image processing methods on each frame to obtain desired result.

Now once I get the result I am looking for i want to capture and store a particular frame on my hdd.

To do this I am using imwrite function to write the frame as a jpg. then I use imshow to display this frame in a namesWindow.

The problem is that when all the conditions are meet to store the image my program instead of storing the image, gives me a run time error.......

Here is the code:

for(vector<double>::iterator iter_dis = Left_Point_distance.begin(); iter_dis != Left_Point_distance.end();++iter_dis)
{
  if(*iter_dis > 20 && center.y >= 120 && center.x >=510 && Box[0].width > Box[0].height)
  {
    char* window_Punches = "Punches";
    namedWindow(window_Punches ,1);

    Mat Hook;

    imwrite("C:\\Hook.jpg", Hook);
    imshow(window_Punches, Hook);
  }

  if(*iter_dis >20 && center.y <=60)
  {
  }
}

Going through opencv tutorials This is how this how its done but in my case is not working......

Further more all the process takes place in a infinite while loop, and videoframes are stored in Mat frame; which is then displayed in a window using imshow function.

Can anybody spot what am doing wrong here....?

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by StevenPuttemans
close date 2013-04-03 07:36:11.040124

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-04-03 07:35:34 -0500

Actually, could you stick to your original post, this is still about grabbing and visualizing your frame. Instead of opening now post each time, stick to one and place all information there.

For others : http://answers.opencv.org/question/10599/capture-and-store-frame/

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-04-03 07:23:28 -0500

Seen: 140 times

Last updated: Apr 03 '13