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

The problem of correspondence between the label of the spectrum chart and the mask coordinates #230

Open
Jinzhu-Wang opened this issue Mar 13, 2024 · 1 comment

Comments

@Jinzhu-Wang
Copy link

Describe the bug
When I use MaskClassVisualizer to visualize IQ data, I hope to extract the coordinates of the mask and the corresponding label values. However, when I add the following code, there is a matching problem between labels and coordinates, especially a label with When using multiple masks. Please tell me what should I do

To Reproduce
Code added in MaskClassVisualizerr:

            contours, _ = cv2.findContours((mask * 255).astype(np.uint8), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
            contour_coordinates = []
            for contour in contours:
                contour_coordinates.append(contour.squeeze().tolist())

            print("Contour Coordinates:", contour_coordinates)
            print("idx: ",class_idx)

Output results

            Contour Coordinates: [[[0, 420], [0, 455], [511, 455], [511, 420]], [[0, 129], [0, 204], [187, 204], [187, 129]], [[460, 99], [460, 151], [511, 151], [511, 99]]]
            idx:  [3, 4]

Expected behavior
Like the above output, how should I match them

@ereoh
Copy link
Collaborator

ereoh commented Oct 11, 2024

Hello, we have two examples that use MaskClassVisualizer, see if those help?

examples/03_example_widebandsig53_dataset.ipynb
examples/04_example_wideband_modulations_dataset.ipynb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants