wai572 commited on
Commit
5c07ac9
·
1 Parent(s): 08a1a0e
Files changed (1) hide show
  1. identify_cards.py +4 -4
identify_cards.py CHANGED
@@ -316,10 +316,6 @@ def get_suit_from_image_rules(rank_image_patch, thresholds):
316
  return "unknown"
317
 
318
  text_mask = get_not_white_mask(rank_image_patch)
319
- # デバッグ用のフォルダがなければ作成
320
- debug_dir = "debug_chars"
321
- if not os.path.exists(debug_dir):
322
- os.makedirs(debug_dir)
323
 
324
  # マスクを使って元のカラー画像から文字部分のみを抽出
325
  masked_char_image = cv2.bitwise_and(
@@ -328,6 +324,10 @@ def get_suit_from_image_rules(rank_image_patch, thresholds):
328
 
329
  timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S_%f")
330
  if IS_DEBUG:
 
 
 
 
331
  # ユニークなファイル名を生成
332
  debug_filename = os.path.join(
333
  debug_dir, f"masked_char_{timestamp}.png"
 
316
  return "unknown"
317
 
318
  text_mask = get_not_white_mask(rank_image_patch)
 
 
 
 
319
 
320
  # マスクを使って元のカラー画像から文字部分のみを抽出
321
  masked_char_image = cv2.bitwise_and(
 
324
 
325
  timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S_%f")
326
  if IS_DEBUG:
327
+ # デバッグ用のフォルダがなければ作成
328
+ debug_dir = "debug_chars"
329
+ if not os.path.exists(debug_dir):
330
+ os.makedirs(debug_dir)
331
  # ユニークなファイル名を生成
332
  debug_filename = os.path.join(
333
  debug_dir, f"masked_char_{timestamp}.png"