Ask Your Question
0

How to write or save sequence of images in a folder using opencv in ubuntu using command line argument

asked 2015-10-01 01:30:58 -0600

Pramod Soni gravatar image

How to write or save sequence of images in a folder using opencv?

I am trying to like this

imwrite( "/home/administrator/Desktop/bg_sub/%d.jpg", image );

but it is storing only one image. Please tell me what should I do now

edit retag flag offensive close merge delete

Comments

1

Well that is because the imwrite function does not know on its own what he has to place at the %d counter. The suggestion of @thdrksdfthmn is indeed better and more stable.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-10-01 04:44:42 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-10-01 02:21:16 -0600

thdrksdfthmn gravatar image

Your approach is good, but you I would suggest you a little modification:

int cntr = 0:

// ...

// saving part:
std::string savingName = "/home/administrator/Desktop/bg_sub/" + std::to_string(++cntr) + ".jpg";
cv::imwrite(savingName, image);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-10-01 01:30:58 -0600

Seen: 8,060 times

Last updated: Oct 01 '15