LoginSignup
1
0

結晶構造を知財用に作図する方法

Posted at

目的

知財の図に結晶構造を使用する場合、グレースケールかつシンプルな図にする必要があります。VESTAだと適さない場合があるので簡単に変換する方法を備忘録として記しておきます。

VESTAでの処理

まずVESTAで結晶構造を表示し、Objects > Properties > Atoms でウィンドウを表示します。
MaterialのSpecularで黒色を選択し、Shininessを1にします。
Bondsタブでも同様の操作を行います。

適用すると、光沢が無くなった以下のような構造が得られます。

vesta

この状態で画面キャプチャ等で保存します。

エッジ抽出

この画像ファイルを用いてエッジ抽出をすればグレースケールかつシンプルな図に変換できます。何を使っても良いですが、opencvを使うと以下のように変換できます。

import cv2
import matplotlib.pyplot as plt
import numpy as np


image = cv2.imread("vesta.png")

edges = cv2.Canny(image, 50, 200)
kernel = np.ones((3, 3), np.uint8)
edges = cv2.dilate(edges, kernel, iterations=1)

result = np.zeros_like(image)
result[edges > 0] = 0
result[edges == 0] = 255

fig = plt.figure(figsize=(10, 10))
plt.imshow(result, cmap="gray")

Cannyのパラメータは適宜変更してください。変換後は以下のような図になります。

edge

これに適当にラベルを振れば知財でも使いやすい結晶構造の図が取得できます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0