最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

python將圖片轉(zhuǎn)為矢量圖的方法步驟

 更新時間:2021年03月30日 09:57:09   作者:東方佑  
這篇文章主要介紹了python將圖片轉(zhuǎn)為矢量圖的方法步驟,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧

本文主要介紹了python圖片轉(zhuǎn)為矢量圖,分享給大家,具體如下:

import numpy as np
import matplotlib.pyplot as plt
import cv2
fig, ax = plt.subplots()

plt.figure(1)
image=cv2.imread("2.jpg")
# you can specify the marker size two ways directly:
# 這樣一個一個像素太慢了故而要將同樣顏色的坐標進行分類處理
color_class=[]
x_y=dict()
for x,w in enumerate(image):
  for y,colors in enumerate(w):
    if colors.tolist() not in color_class:
      s=image[:, :, :1] == colors[0]
      s1=image[:, :, 1:2] == colors[1]
      s2=image[:, :, 2:3] == colors[2]
      ss=s*s1*s2

      color_class.append(colors.tolist())
      x_y[len(color_class)]=np.where(ss.reshape((ss.shape[0],ss.shape[1])))



    print(x,y)
for i ,colors in enumerate(color_class):
  a, b = x_y[i + 1]
  plt.plot(a,b, ".",color=[colors[2]/255,colors[1]/255,colors[0]/255], markersize=1, label='a') # blue circle with size 20

fig.savefig('scatter.svg', dpi=200, format='svg')
if __name__ == '__main__':
  pass

到此這篇關于python將圖片轉(zhuǎn)為矢量圖的方法步驟的文章就介紹到這了,更多相關python圖片轉(zhuǎn)為矢量圖內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

最新評論

且末县| 武平县| 通州区| 玉林市| 固阳县| 十堰市| 保山市| 前郭尔| 阳原县| 大理市| 都安| 安平县| 菏泽市| 沙田区| 南皮县| 大丰市| 黎川县| 长葛市| 始兴县| 台前县| 阿克苏市| 保德县| 绥滨县| 磐石市| 涞水县| 乐清市| 石狮市| 怀安县| 宁都县| 阳原县| 广德县| 增城市| 林周县| 延庆县| 开原市| 新竹县| 应城市| 中阳县| 黎川县| 宜阳县| 彭水|