Currently, I am writing my own convolutional filters on C++. For this purpose I decided to use OpenCV, but then I came to a conclusion that it was a bad idea. It is not very convenient for working with separate pixels and most of the functionality is redundant. What is the simplest and most convenient way to work with images on C++ in this case.
Asked
Active
Viewed 647 times
0
-
look at [this](http://stackoverflow.com/questions/2982711/c-image-processing-libraries) thread. I also recommend boost GIL – Uri Brecher Apr 28 '16 at 07:31
-
4Find a simple image-loading library that can decode whatever image-format you want to load, and that gives you a pointer to the raw unencoded image data. Be careful though, because the raw image data may be different depending on the image you load (indexed, RGB, RGBA, bits-per-pixels might be different, etc). – Some programmer dude Apr 28 '16 at 07:32
-
1It's hard to give a good answer without more context: what is the images format? Pixel type? Do you need to handle more than two dimensions? Hyperspectral data? Need to handle interleave? – Gwen Apr 28 '16 at 07:48
-
1Have a look here... http://stackoverflow.com/a/24599122/2836621 and here http://stackoverflow.com/a/33777883/2836621 – Mark Setchell Apr 28 '16 at 07:51
-
@Gwen, I work with RGB images. There are only two dimensions, of course. I'm writing the gaussian blur filter. So in fact I need to modify each pixel. The only thing I need to work with is three channels. – Max Apr 28 '16 at 07:56
-
By the way, I refused using OpenCV, because it doesn't have proper bounds validation when getting a pixel. It doesn't throw an out of bounds exception, but gives you back a value which looks like a pixel, but indeed it is not. – Max Apr 28 '16 at 08:12
-
1@MaxTsylko In such simple case, you can follow Mark's suggestion of using PPM. – Gwen Apr 28 '16 at 08:14
-
@Gwen, I think that sounds good. – Max Apr 28 '16 at 08:16
-
One more... http://stackoverflow.com/a/36374100/2836621 – Mark Setchell Apr 28 '16 at 08:20