Skip to content

Commit

Permalink
refactor: 変数の命名とコメントを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
bizyutyu committed Nov 6, 2024
1 parent 1c9ef38 commit 0ebc2eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/image_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class ImageProcessor:
"""CSVファイルをJSONファイルに変換するクラス."""
"""画像の先鋭化のためのクラス."""

@staticmethod
def sharpen_image(image_path: str) -> str:
Expand Down Expand Up @@ -43,13 +43,13 @@ def sharpen_image(image_path: str) -> str:
# 出力パスの生成
dir_path = os.path.dirname(image_path)
file_name = os.path.basename(image_path)
output_path = os.path.join(dir_path, f"Sharpened_{file_name}")
sharpened_image_path = os.path.join(dir_path, f"Sharpened_{file_name}")

# 先鋭化画像保存処理
os.makedirs(os.path.dirname(output_path), exist_ok=True)
cv2.imwrite(output_path, result)
os.makedirs(os.path.dirname(sharpened_image_path), exist_ok=True)
cv2.imwrite(sharpened_image_path, result)

return output_path
return sharpened_image_path

except FileNotFoundError as e:
print("Error:", e)
Expand All @@ -69,6 +69,6 @@ def sharpen_image(image_path: str) -> str:
# sharpened_image = ImageProcessor.sharpen_image(args.input_path)

# if sharpened_image:
# print(f"先鋭化完了。結果は {output_path} に保存しています。")
# print(f"先鋭化完了。結果は {sharpened_image_path} に保存しています。")
# else:
# print("先鋭化失敗。")

0 comments on commit 0ebc2eb

Please sign in to comment.