在C ++中读/操作图像 [英] Reading/manipulating images in C++

查看:120
本文介绍了在C ++中读/操作图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个沮丧的C ++新手,他想从图像文件中提取一个像素矩阵,做一些变换,然后将修改的矩阵输出到我选择的图像格式。

I am a frustrated newbie of C++ who would like to do the simple task of extracting a pixel matrix from an image file, do some transformation, and then output the modified matrix to an image format of my choosing.

我给了libpng一个试试,它的API是一个混乱,几乎不可读。有趣的是,有些人说这是最好的C ++。我给我的软件开发人员一个电话,他告诉我使用OpenGL。所以,我做了一些Googling,我仍然没有找到一个直接的答案。

I've given libpng a try and it's API is a mess and hardly readable. Interestingly, some people said it's the best available for C++. I gave my software developer cousin a call and he told me to use OpenGL. So, I did some Googling and I still haven't found a straight answer.

看起来得到一个简单的int * readPNG(char * path)询问什么时候Java,Matlab和python的这些东西包括在他们的标准库。这是可笑的!

It appears getting a simple "int* readPNG(char* path)" is too much to ask for when the likes of Java, Matlab, and python have these things included in their standard libraries. This is just ridiculous! How do you pros come by and what libraries do you use?

还有一些小的C ++问题:
- 是否有任何方法来组织层次结构中的类如何在Java中使用包?我试过过滤器在Visual C ++,但他们似乎不是同一件事。

Also a few trivial C++ questions: - Is there any way to organize classes in a hierarchy like how packages are used in Java? I tried filters in Visual C++ but they don't seem to be the same thing. - Is there any way to get easily comprehensible stack traces for runtime failures?

推荐答案

我发现ImageMagick的< a href =http://www.imagemagick.org/www/Magick++/Documentation.html =nofollow> Magick ++库是以编程方式处理图像格式化数据最有用的工具。

I've found ImageMagick's Magick++ library to be the most useful tool for handling image formatted data programmatically.

C ++具有类似于Java的命名空间,但是它们更难以使用,并且只能使事情变得不可读。至于堆栈跟踪,我建议组合现有的stackoverflow答案。总之,这不简单。

C++ has namespaces like Java but they are much more difficult to use and may only make things less readable. As for stack traces, I recommend combing the existing stackoverflow answers for that. In short, it's not simple.

这篇关于在C ++中读/操作图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆