Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warped perspective feature, splitting the segmentation into segmenter and extractor (Issue #60) #76

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix path for template generation, minor formatting
TimWalter committed Mar 9, 2024
commit d0b2e60fc49a1fe0882e8ee577d3d79b0a5778c0
2 changes: 1 addition & 1 deletion colour_checker_detection/detection/common.py
Original file line number Diff line number Diff line change
@@ -994,7 +994,7 @@ def remove_stacked_contours(
array([[[ 0, 0],
[10, 0],
[10, 10],
[ 0, 10]]])
[ 0, 10]]], dtype=int32)
"""

contours = as_int32_array(contours)
Original file line number Diff line number Diff line change
@@ -11,13 +11,16 @@
"""

import json
import os
from dataclasses import dataclass
from itertools import combinations, permutations

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

from colour_checker_detection import ROOT_DETECTION_TEMPLATES


@dataclass
class Template:
@@ -117,10 +120,12 @@ def generate_template(
)
template.correspondences = valid_correspondences

with open(f"template_{name}.json", "w") as f:
with open(
os.path.join(ROOT_DETECTION_TEMPLATES, f"template_{name}.json"), "w"
) as f:
template.swatch_centroids = template.swatch_centroids.tolist()
template.colours = template.colours.tolist()
json.dump(template.__dict__, f, indent=4)
json.dump(template.__dict__, f, indent=2)

if visualize:
template_adjacency_matrix = np.zeros(