小编Jay*_*Jay的帖子

IPython.display:SVG无法呈现svg_filter_line生成的svg图像(官方示例)

我在使用Python3的 MacOS上的Jupyter中运行svg_filter_line(官方示例)。

SVG与很多svg图像(例如,来自Wiki的Worldmap图像)一起使用时效果很好

在此处输入图片说明

svg_filter_line的原始编码也很好。

在此处输入图片说明

运行svg_filter_line会生成一个名为“ svg_filter_line.svg”的svg映像。

SVG无法呈现此svg图像'svg_filter_line.svg',没有错误,没有警告。

在此处输入图片说明

python svg matplotlib jupyter-notebook

5
推荐指数
1
解决办法
333
查看次数

is there a way to get a more clear and successive edge with opencv in python?

i am trying to make an edge detection that generate right image from left image in the flowing figure.

在此处输入图片说明

there are 3 different colorful area, so the result has 3 separated parts.

here is my code

img = cv2.imread('img2.png')
imgRGB = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
f, axs = plt.subplots(1,2,figsize=(12,8))
edges = cv2.Canny(img,1,255)
axs[0].imshow(imgRGB)
axs[1].imshow(edges,cmap = 'gray')
Run Code Online (Sandbox Code Playgroud)

here is the output

在此处输入图片说明

the edge of the red part in the origin image is being ignored by OpenCV, which does not meet my need.

the …

python algorithm opencv machine-learning deep-learning

2
推荐指数
1
解决办法
69
查看次数

获取 np.linalg.svd 的奇异值作为矩阵

给定一个 5x4 矩阵 A =

\n\n

在此输入图像描述

\n\n

一段构造矩阵的Python代码

\n\n
A = np.array([[1, 0, 0, 0],\n              [0, 0, 0, 4],\n              [0, 3, 0, 0],\n              [0, 0, 0, 0],\n              [2, 0, 0, 0]])\n
Run Code Online (Sandbox Code Playgroud)\n\n

Wolframalpha给出 svd 结果

\n\n

在此输入图像描述

\n\n

具有奇异值 \xce\xa3 的向量采用这种形式

\n\n

在此输入图像描述

\n\n

的输出中的等价数量(NumPy 称之为 s)np.linalg.svd是这种形式

\n\n
[ 4.          3.          2.23606798 -0.        ]\n
Run Code Online (Sandbox Code Playgroud)\n\n

有没有办法让 numpy.linalg.svd 的输出数量显示为 Wolframalpha?

\n

python numpy linear-algebra

2
推荐指数
1
解决办法
5130
查看次数