Disable file system cache during imwrite [closed]
I am trying to build a application with opencv and c++ in Linux env to capture and save 10000 images, But after saving 800 images System buff/cache is increasing and application running slow (system getting hanged up). Is there any way to disable file system cache or clear cache after imwrite or save image without using imwrite. (want to store in .bmp format)
any suggestion will be helpful, Thankyou
Is this really an OpenCV issue? What do you mean by system buff/cache? Memory? Can you post a minimal example of your code?
If the system has a cache, the problem is that your hard drive becomes the bottleneck aften the cache fills up. Obviously, you can find a library or source code to write any format you like, but it is unlikely to bring any speed benefit - especially with BMP, which is the very worst in that regard. Perhaps you could write JPEGs and in a separate process convert them to BMPs.
seems to be a limitation of your os (and has to be handled from there)
i'm quite sure you can reproduce it with just writing 800 images to disk (w/o using imwrite)
Code snippet:
This is the code snippet I am using
@Der Luftmensch, As per Requirement I need to use either png or bmp.