标签: bpp

如何将8位OpenCV IplImage*转换为32位IplImage*?

我需要将8位IplImage转换为32位IplImage.使用来自整个网络的文档,我尝试了以下方法:

// general code
img2 = cvCreateImage(cvSize(img->width, img->height), 32, 3);
int height    = img->height;
int width     = img->width;
int channels  = img->nChannels;
int step1     = img->widthStep;
int step2     = img2->widthStep;
int depth1    = img->depth;
int depth2    = img2->depth;
uchar *data1   = (uchar *)img->imageData;
uchar *data2   = (uchar *)img2->imageData;

for(h=0;h<height;h++) for(w=0;w<width;w++) for(c=0;c<channels;c++) {
   // attempt code...
}

// attempt one
// result: white image, two red spots which appear in the original image too.
// this is the closest result, what's …
Run Code Online (Sandbox Code Playgroud)

opencv iplimage bits-per-pixel bpp

12
推荐指数
2
解决办法
4万
查看次数

从命令行减少 PNG 文件的位深度

我可以从 CLI 执行什么命令或一系列命令来递归遍历目录树并将该树中所有 PNG 文件的位深度从 24bpp 减少到 16bpp?命令应该保留 alpha 层并且不应该增加 PNG 的文件大小 - 事实上减少会更可取。

我有一个基于 OSX 的系统可供我使用,并且熟悉该find命令,因此我真的更想找到合适的 PNG 实用程序命令。

macos command-line png bpp bit-depth

5
推荐指数
2
解决办法
3053
查看次数

标签 统计

bpp ×2

bit-depth ×1

bits-per-pixel ×1

command-line ×1

iplimage ×1

macos ×1

opencv ×1

png ×1