{"id":28298148,"url":"https://github.com/squirrelsquirrel78/opencv-python","last_synced_at":"2025-08-15T15:14:06.907Z","repository":{"id":114471024,"uuid":"76299731","full_name":"squirrelsquirrel78/opencv-python","owner":"squirrelsquirrel78","description":"adventures in opencv!","archived":false,"fork":false,"pushed_at":"2016-12-13T00:50:44.000Z","size":5242,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-15T18:01:18.729Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/squirrelsquirrel78.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":"2016-12-12T22:07:17.000Z","updated_at":"2016-12-12T22:31:48.000Z","dependencies_parsed_at":"2023-06-08T07:15:35.177Z","dependency_job_id":null,"html_url":"https://github.com/squirrelsquirrel78/opencv-python","commit_stats":null,"previous_names":["squirrelsquirrel88/opencv-python","squirrelsquirrel78/opencv-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/squirrelsquirrel78/opencv-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrelsquirrel78%2Fopencv-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrelsquirrel78%2Fopencv-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrelsquirrel78%2Fopencv-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrelsquirrel78%2Fopencv-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squirrelsquirrel78","download_url":"https://codeload.github.com/squirrelsquirrel78/opencv-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrelsquirrel78%2Fopencv-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270586468,"owners_count":24611317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-05-23T06:13:14.733Z","updated_at":"2025-08-15T15:14:06.888Z","avatar_url":"https://github.com/squirrelsquirrel78.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# opencv-python\nspatiotemporal?\n## 01 Image Loading\n```python\nimg = cv2.imread('file.png', cv2.IMREAD_GRAYSCALE) # reads image in grayscale\ncv2.imshow('myWindow', img) # opens window with image\ncv2.waitKey(0) # waits for any key to be pressed\ncv2.destroyAllWindows()\ncv2.imwrite('newFile.png', img) # writes new img\n```\n\n### 02 Video Loading\n```python\nwebcam = cv2.VideoCapture(0)\n\nwhile True:\n\tret, frame = webcam.read() # we only care about frame\n\tgrayVersion = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # creates object with grayscale of webcam\n\t\n\tcv2.imshow('myColoredWebcam', frame) \n\tcv2.imshow('myGrayscaleWebcam', grayVersion)\n\t\n\tif cv2.waitKey(1) \u0026 0xFF == ord('q'):\n\t\tbreak\n\nwebcam.release()\ncv2.destoryAllWindows()\n```\n\n### 03 Drawing\n```python\nimg = cv2.imread('file.png'), cv2.IMREAD_COLOR) # reads image in color\n\n# line\ncv2.line(img, tuple start point, tuple end point, tuple BGR)\n# rectangle\ncv2.rectangle(img, tuple start point, tuple end point, tuple BGR, int borderWidth) # -1 as border fills in shape\n# circle\ncv2.circle(img, tuple center, int radius, tuple BGR, int borderWidth)\n# polygon\npts = np.array([ [10,10],[20,30],[40,50],[20,20] ], np.int32)\ncv2.polylines(img, [pts], boolean connectEndPointToStartPoint?, tuple BGR, int borderWidth)\n# text\nfont = cv2.FONT_HERSHEY_SIMPLEX\ncv2.putText(img, String text, tuple start point, font, int size, tuple BGR, cv2.LINE_AA)\n```\n\n### 04 IMG OPS\n```python\nimg = cv2.imread(...)\n\nonePixel = img[15,15] # returns array BGR\nimg [15,15] = [255,255,255]\n\n# Region of Image: ROI\nroi = img[100:200,120:220]\nimg[0:50,0:50] = roi # copies all color values over\n\n# adding\nsum = img1 + img2 # adds color values\nweighted = cv2.addWeighted(img1, 0.6, img2, 0.4, 0) # adds color values by weight\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquirrelsquirrel78%2Fopencv-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquirrelsquirrel78%2Fopencv-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquirrelsquirrel78%2Fopencv-python/lists"}