{"id":15551464,"url":"https://github.com/knosmos/set-solve","last_synced_at":"2026-05-17T19:37:45.662Z","repository":{"id":169420679,"uuid":"416986137","full_name":"knosmos/set-solve","owner":"knosmos","description":"Cheating on SET with computer vision","archived":false,"fork":false,"pushed_at":"2022-02-27T02:49:24.000Z","size":5588,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T01:45:51.164Z","etag":null,"topics":["image-processing","opencv","set-game"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knosmos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-14T04:18:31.000Z","updated_at":"2022-07-30T13:42:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"5eb437a1-8e26-4300-b0eb-36179c121530","html_url":"https://github.com/knosmos/set-solve","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":0.04761904761904767,"last_synced_commit":"35768bee162e8623923e4416be063ba355f57c7f"},"previous_names":["knosmos/set-solve"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/knosmos/set-solve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knosmos%2Fset-solve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knosmos%2Fset-solve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knosmos%2Fset-solve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knosmos%2Fset-solve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knosmos","download_url":"https://codeload.github.com/knosmos/set-solve/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knosmos%2Fset-solve/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33152098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-processing","opencv","set-game"],"created_at":"2024-10-02T14:05:06.174Z","updated_at":"2026-05-17T19:37:45.616Z","avatar_url":"https://github.com/knosmos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Playing Set with Computer Vision\n\n![setsolve](https://user-images.githubusercontent.com/30610197/155866087-8139f7b6-1a5d-4793-b088-161ea118dd58.png)\nUses OpenCV to play SET, a card game where the goal is to find three cards where each \"feature\" - number, color, shape, shading - are all the same, or all different.\n\n## How does it work?\n\n### Card Segmentation\nThe first step is to segment the cards. We do this by thresholding the image,\nthen running a contour detection algorithm which gives the outline of each \"region\".\nThen we find the largest twelve rectangular contours, which finds the cards relatively\nreliably. Finally, we run a perspective transformation to unwarp the cards.\n\n### Number Detection\nTo find how many shapes there are on one card, we run the contour detection again\non that single card. After filtering out contours that are too small (noise), we\nsimply count the number of contours.\n\n### Color Detection\nWe find the average color of a segmented contour, and compare it to prerecorded values\nfor red, green and purple. Color detection sometimes errors, because red and purple\ncan be mistaken for one another under different lighting conditions.\n\n### Shape Detection\nWe run OpenCV's `moments` function on one of the segmented contours, which gives various \ncharacteristics of the shape. We then compare the result to prerecorded values to determine\nwhether the card is a squiggle, diamond or ellipse.\n\n### Shading Detection\nThis is done by finding how much of the card is colored. A solid-shaded card will have\nmore colored pixels than a striped or empty-shaded card. We also run a Sobel edge-detection\nalgorithm; a large number of edge pixels indicates that the card is striped.\n\n### SET Determination\nThis is the easiest part - just a complete search on all possible SETs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknosmos%2Fset-solve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknosmos%2Fset-solve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknosmos%2Fset-solve/lists"}