问题标签 [scikit-image]

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.

0 投票
1 回答
629 浏览

python - sci-kit 图像不加载图像

我正在测试第一次 sci-kit 图像。(倡议的祝贺)

我得到的输出是:

有任何想法吗?提前致谢。

0 投票
1 回答
2916 浏览

python - 形态学侵蚀 - Scipy ndimage 和 Scikit 图像之间的区别

Scipy ndimage 和 Scikit 图像中的形态学算子不同。我想,边界条件以不同的方式处理:

scp 结果如预期,但 sci 没有:

如何在 scikit-image 形态学算子中设置边界条件?

此致

0 投票
1 回答
641 浏览

python - PyInstaller 和 skimage: ValueError: max() arg is an empty sequence

在 python 脚本上使用 pyinstaller 后,当我尝试执行生成的二进制文件时出现此错误:

错误来自@15 行:

我认为 scikit-image 库出了点问题。谁能帮我?

0 投票
1 回答
3450 浏览

image - Scipy 盲反卷积

我正在研究处理显微镜图像的管道。每个图像都是一堆 tiff 平面,我想在堆栈上运行反卷积,但是我没有关于 psf 的信息。到目前为止,我一直在使用 matlab 函数deconvblind。我深入研究了 scikit-image restore.modules 并且所描述的工作正常,但都需要 psf。matlab中deconvblind的描述说

假设泊松噪声统计,该算法最大化结果图像在与结果 PSF 卷积时是模糊图像实例的可能性。

有没有办法可以在 python 中实现这个算法,然后估计 psf 并使用 scikit-image 提供的 restore.modules 之一?

谢谢

0 投票
1 回答
4007 浏览

python - 覆盖两个 numpy 数组,将第四个平面视为 alpha 级别

我有两个形状的 numpy 数组(256、256、4)。我想将第四个 256 x 256 平面视为 alpha 级别,并导出已覆盖这些数组的图像。

代码示例:

这将创建两个图像 fg:

test_fg.png

和背景:

test_bg

我希望能够将 fg 覆盖到 bg 上。也就是说,最终图像的左上角应该是灰色(因为 fg 的 alpha 为 1),右下角是灰色和颜色噪声的混合,其他象限中应该是纯色噪声。我正在寻找类似 add 函数的东西,它给了我一个新的 np 数组。

请注意,我认为这与此答案不同,后者使用 matplotlib.pyplot.plt 覆盖图像并使用彩色地图摆弄。我认为我不需要在这里摆弄彩色地图,但也许答案是我需要。

我希望操作返回一个新的 np.array 的原因是因为我想用许多图像迭代地执行此操作,按顺序叠加。

0 投票
1 回答
99 浏览

python - 处理多维数组

我正在尝试将图像的颜色缩放到预定义的范围。根据调色板颜色范围的最小二乘误差,将颜色分配给输出像素。

我已经在 python 循环中编写了代码,有没有更好的矢量化方法来做到这一点?

是否可以使用 numpy 操作本身来避免和解决循环?

0 投票
1 回答
1756 浏览

python - 选择图像上的圆形区域以进行进一步处理

在此处输入图像描述

我正在使用以下格式检测图像上skimage.feature.blob_doh的 blob,并且正在获取我的 blob 区域的格式:

A = 数组([[121, 271, 30], [123, 44, 23], [123, 205, 20], [124, 336, 20], [126, 101, 20], [126, 153, 20], [156, 302, 30], [185, 348, 30], [192, 212, 23], [193, 275, 23], [195, 100, 23], [197, 44, 20] , [197, 153, 20], [260, 173, 30], [262, 243, 23], [265, 113, 23], [270, 363, 30]])

A : (n, 3) ndarray 一个二维数组,每行代表 3 个值,(y,x,sigma) 其中(y,x)是 blob 的坐标,sigma是高斯核的标准偏差(它大约只是我所在区域的半径)

所以问题是——如何选择所有这些区域进行进一步的数据处理(计算平均特征,进行一些聚类和分类)。现在我只是在绘图上绘制它们,但不能将它们迁移到位图\数组变量。

而且我不想使用 OpenCV 库来完成这个任务,我必须使用 numpy/scipy/skimage 和其他库来完成。

感谢您的任何帮助!

UPD:有一些用于裁剪的代码,但它正在做一些奇怪的事情......它裁剪得很好,但是坐标是什么?

0 投票
2 回答
2639 浏览

range - Scikit-image 的 CIELAB 颜色范围?

我正在研究 CIELAB 颜色空间,但找不到有关 skimage.color.rgb2lab 生成的每个通道范围的任何信息。

谢谢。

0 投票
0 回答
304 浏览

python - Freeimage plugin mirrors RGB arrays if saving in 16-bit

I am working with 2D floating-point numpy arrays and saving them as .png files with high precision (see this question for how I came to this point). To do this I use the freeimage plugin, as in that linked question.

This creates a weird behaviour where the images are flipped (both left-right and up-down) if saved to 16-bit. This behaviour happens only for RGB or RGBA images, not for greyscale images. Here is some example code:

creates the following picture:

8 bit greyscale

when I try to save this in 16 bit, I get the same result (albeit taking 99kb instead of 50, so I know the bitdepth is working).

Now do the same as an RGB image:

The 8-bit result is:

8 bit rgb

but doing the following

gives me

16 bit rgb

This happens if the array contains an alpha level too.

It can be fixed by including

before saving. However, it seems to me this is pretty weird behaviour and not very desirable. Any idea why this is happening or whether it is intended? As far as I could see it's not documented.

0 投票
8 回答
77254 浏览

python - 计算边界框重叠的百分比,用于图像检测器评估

在大图像中测试对象检测算法时,我们将检测到的边界框与给定的地面实况矩形坐标进行对比。

根据 Pascal VOC 挑战,有这样的:

如果预测的边界框与真实边界框重叠超过 50%,则认为该边界框是正确的,否则该边界框被认为是误报检测。多次检测会受到惩罚。如果一个系统预测了几个与单个真实边界框重叠的边界框,则只有一个预测被认为是正确的,其他预测被认为是误报。

这意味着我们需要计算重叠的百分比。这是否意味着检测到的边界框覆盖了地面实况框 50%?还是 50% 的边界框被地面实况框吸收?

我已经搜索过,但我还没有找到一个标准算法——这很令人惊讶,因为我认为这在计算机视觉中很常见。(我是新手)。我错过了吗?有谁知道这类问题的标准算法是什么?