stroke_tone_error — PRINTPATH stroke op

• データ種: image2d × pairs → table

• 呼び出し: import fullseye as fs; fs.ledger.stroke_tone_error(image, points, pen_width=1.0, blur_sigma=3.0, gamma=1.0) (実装を直接呼ぶなら import printpath; printpath.stroke_tone_error(image, points, pen_width=1.0, blur_sigma=3.0, gamma=1.0)、台帳から引くなら opsprintpath.get("stroke_tone_error"))

使い方

線を引いた結果の濃淡が目標とどれだけ違うか。→ `table`

★これが一筆書きの本当の目的関数。「絵として似ている」を人の目に任せず、

ペン幅で描いて目の尺度にぼかし、目標の暗さと比べて数で返す。

返り値: dict

"rms" / "max_abs" / "bias" —— 暗さの差(`[0, 1]` の尺度)

"corr" —— 目標の暗さと描いた暗さの相関(1 に近いほど濃淡を追えている)

"ink_fraction" —— 紙に乗ったインクの面積率

"target_darkness" —— 目標の平均暗さ(インク率と釣り合うべき量)

"length_px" —— 線の長さ[px]

★ペン幅は連続なノブ(被覆率で塗る)。線が重ならない範囲では

`インク率 ≈ 線長 × ペン幅 / 画像の面積` が成り立つので、目標の濃さに合う

ペン幅を 閉形式で解いてから確かめられる:

`pen_width ≈ target_darkness × area / length_px`。

詳しい使い方ガイド

• printpath ファミリ ガイド

参考(サンプルデータ・文献)

• サンプルデータ カタログ(DL URL / ライセンス) — 2-D は skimage.data(BSD/public)+ 合成、3-D は実データ源(Stanford/PDS 等)の DL URL。

• 演算子の来歴・参考文献 — この op 族の元になった研究/手法の出典。

• アルゴリズムの正典(著者・年)と用途は上記ファミリ使い方ガイドに記載。

実行できる例(この op を実際に呼ぶ検証済みサンプル)

• poc_one_stroke_epicycles — py -3.11 examples/poc_one_stroke_epicycles.py

型が繋がる次の op(table を入力に取れる)

gcode_write · gcode_extrusion_volume · gcode_time_estimate · gcode_layer_image · contours_to_gcode

同カテゴリ(stroke)

stipple_points_from_image · stipple_energy · stroke_tour_closed · mst_length · stroke_resample_closed


*Provenance: printpath.py — PRINTPATH operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.