feat(find_model gui): toggle to overlay full SAM21 cluster (yellow)
Adds a 4th checkbox 'Punti SAM21 (gialli)' that draws the full SAM21 segmentation (input to both the plane partition and Open3DModel) on the RGB result canvas. The backend now returns sam21_points_px and n_sam21 alongside the existing accepted/excluded splits. Useful as a sanity check: visualise what was actually segmented vs what the plane filter kept/rejected vs where the STL got placed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
767d91acdc
commit
2fe7a7a7fa
3 files changed
+15
-4
No files matched your search
+7
-4
@@ -540,7 +540,7 @@ $('findBtn').addEventListener('click', async () => {
|
||||
}
|
||||
});
|
||||
|
||||
['findShowModel', 'findShowAccepted', 'findShowExcluded'].forEach(id =>
|
||||
['findShowModel', 'findShowAccepted', 'findShowExcluded', 'findShowSam21'].forEach(id =>
|
||||
$(id).addEventListener('change', drawFindResult));
|
||||
|
||||
function drawFindResult() {
|
||||
@@ -552,9 +552,12 @@ function drawFindResult() {
|
||||
findCtx.fillStyle = color;
|
||||
for (const [u, v] of pts) findCtx.fillRect(u - r, v - r, r*2+1, r*2+1);
|
||||
};
|
||||
if ($('findShowExcluded').checked) dot(findResult.excluded_points_px, '#e74c3c', 1);
|
||||
if ($('findShowAccepted').checked) dot(findResult.accepted_points_px, '#3ecf8e', 1);
|
||||
if ($('findShowModel').checked) dot(findResult.model_points_px, '#4da3ff', 1);
|
||||
// Draw order: SAM21 cluster (background) -> excluded -> accepted -> model
|
||||
// (foreground), so the Open3DModel STL projection wins over everything.
|
||||
if ($('findShowSam21').checked) dot(findResult.sam21_points_px || [], '#ffd83d', 1);
|
||||
if ($('findShowExcluded').checked) dot(findResult.excluded_points_px, '#e74c3c', 1);
|
||||
if ($('findShowAccepted').checked) dot(findResult.accepted_points_px, '#3ecf8e', 1);
|
||||
if ($('findShowModel').checked) dot(findResult.model_points_px, '#4da3ff', 1);
|
||||
}
|
||||
|
||||
function loadRecipesIfNeeded() {
|
||||
|
||||
Reference in new issue
Block a user