问题标签 [cimg]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c++ - CImg 库未加载图像
我已按照 CImg教程进行操作,并且效果很好。但是,如果我尝试加载不同的图像(除了 lena.jpg),我会收到堆栈溢出错误。
例如,这有效:
但这给出了一个错误:
错误是:LoadImageTest.exe 中 0x77bb15de 处的未处理异常:0xC00000FD:堆栈溢出。
我认为堆栈溢出是由于“anotherimage.jpg”太大,所以我也尝试了一个非常小的图像(16x16 像素)。这导致了同样的错误。
有人对为什么会发生这种情况有任何建议吗?
完整代码:
c++ - cimg 显示呈现黑色
使用 CImg;我会保持这个快速和简单。
disp 显示黑色图像,尽管通过 *(f)、*(f+1)、*(f+2) 等正在检索正确的数字(255.0、245.0 等)
我整天都在做这件事。我错过了 CImg 的怪癖吗?
编辑: 将文件另存为 BMP 似乎可以得到正确的结果,所以绘制它只是一个问题。
node.js - 运行带有 node-gyp 错误的 CImg 库
我想使用 CImg 库来处理 node.js 中的图像,所以我编写了一个 node 插件来做到这一点。编译成功,我运行node-gyp build commond,没关系。
但是当我运行节点程序时,出现以下错误:
binding.gyp 文件是:
cap.cc 代码:
index.js 代码:
任何人都可以帮助我吗?
c++ - 使用宏 log2 时没有 args 错误与 cimg?
所以我在这之后得到了自己的 g++ for windows 。
因为我想尝试 CImg,所以我从这里下载了测试版。
我只是将 cimg.h 复制到 g++ 的包含目录中,并且还放置了一些在编译时找不到的依赖项。
但是现在当我尝试编译像本教程一样使用 cimg 的东西时。
它给了我错误:
第 14492 行也是如此。
这些行看起来像这样:
这实际上是我第一次使用 C++,所以显然我已经对所有头文件等的概念感到困惑,所以我可能在那里做错了什么。或者我也可能犯了一个愚蠢的初学者错误。
c++ - OpenCV 库的内存问题
我需要将使用CImg 库加载的图像转换为可以在 OpenCV 中使用的图像格式。
问题是 CImg 创建了 uchar 数组,其中数据以下列方式存储(在 3 通道图像的情况下):
- 首先是红色通道的像素,
- 然后绿色通道的所有像素都跟随,
- 然后 - 蓝色通道。
它看起来像这样:RRRRRR .... GGGGGG ... BBBBB B ...
OpenCV 以不同的方式存储数据:BGRBGRBGRBG R...
这是我从 CImg 转换为 IplImage 的代码:
这段代码运行良好。OpenCV 格式的转换图像是原始图像的完整副本。
我用 valgrind 测试了这段代码。它说它会导致很多内存问题。我找不到这个内存问题的原因。
I will be grateful, if you have any ideas on this matter! Or may be you know another method, which can load image from buffer in OpenCV (not cvDecodeImage).
c++ - 在每个逗号分隔的对象上执行成员函数
以下是完整清单中的相关代码:
这条线是如何(src,gray1,gray2).display("RGB to Grayscale");
工作的?成员函数如何display
应用于逗号分隔列表中的每个对象?
c++ - 使用 C++ 和 Cimg 库将 rgb 图像转换为矩阵
我在盲源分离中有这个项目,我需要使用 Cimg 在矩阵中表示 RGB 图像。但我实际上无法理解如何使用 Cimg .. 我查看了文档
但是功能太多了,我不知道该用哪一个!真的太多了。我从来没有使用过 Cimg,所以如果有人可以向我解释我的程序应该是什么,请做!我正在使用 C++ 编程并使用 eclipse。谢谢!
c++ - 使用 CImg:LNK1181:无法在 Windows 7 x64 上打开文件“m.lib”
在 CImg Makefile 中,我注意到一个标志“-lm”,我认为这指向 m.lib 文件。但由于某种原因,它在链接阶段找不到它。我正在使用以下命令编译代码:
“nvcc”只是 nvidia CUDA 编译器。它的功能应该类似于 g++
python - Python equivalent of DCT image hash function used in pHash module
I have an existing python program that accepts an image URL and does manipulations on the image loaded. I tried passing the image data to the pHash module in C++ and then get the image hash. I've tried using python extension library to pass the image from python to the C program, but without success. The speed of the whole process is a priority. It includes getting the hash value of query image, finding the similar images from a huge collection of images system. So, instead of passing huge image data, then converting to a CImg image object, I feel that it would be better and easier to just calculate the hash in python code, and pass the hash value to the pHash module for finding out the similar images. So, I am looking forward to get the DCT image hash in Python.
Does anyone has any idea how to get the same hash value in python? I don't want to re invent the wheel. I tried to google and find the equivalent function in python, but no success. Here is the image hash function: ( source: pHash module)
I would really appreciate your help. Thanks a lot
random - 使用 Curand 和 CUDA 内核同时初始化许多具有随机数的数组
我正在尝试在 GPU 上同时使用随机生成的数字初始化每个这些并行数组的 100 个元素。但是,我的例程不会产生各种随机数。当我在 Visual Studio 中调试代码时,我看到数组中的每个元素都有一个数字。此代码的目的是优化 CImg FilledTriangles 例程以尽可能使用 GPU。
我做错了什么,我该如何解决?这是我的代码:
这是准备和调用这些内核的主机代码: 我试图在网格的一个块上创建 100 个线程(针对每个元素)。
预赛:
得到结果: