{"id":15027412,"url":"https://github.com/atduskgreg/opencv-processing","last_synced_at":"2025-05-15T19:09:54.871Z","repository":{"id":7767661,"uuid":"9136356","full_name":"atduskgreg/opencv-processing","owner":"atduskgreg","description":"OpenCV for Processing. A creative coding computer vision library based on the official OpenCV Java API","archived":false,"fork":false,"pushed_at":"2023-06-12T19:31:23.000Z","size":247311,"stargazers_count":1343,"open_issues_count":47,"forks_count":462,"subscribers_count":116,"default_branch":"master","last_synced_at":"2025-04-08T01:36:42.725Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atduskgreg.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-03-31T21:09:02.000Z","updated_at":"2025-03-10T12:51:58.000Z","dependencies_parsed_at":"2022-09-13T15:45:01.341Z","dependency_job_id":"cf4f8423-0783-4101-9437-139d7d15d624","html_url":"https://github.com/atduskgreg/opencv-processing","commit_stats":{"total_commits":138,"total_committers":12,"mean_commits":11.5,"dds":0.2536231884057971,"last_synced_commit":"e1fc18291b75228dbf2cc861ee64eb2e3df566d6"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atduskgreg%2Fopencv-processing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atduskgreg%2Fopencv-processing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atduskgreg%2Fopencv-processing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atduskgreg%2Fopencv-processing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atduskgreg","download_url":"https://codeload.github.com/atduskgreg/opencv-processing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254404356,"owners_count":22065641,"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","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":"2024-09-24T20:06:23.368Z","updated_at":"2025-05-15T19:09:49.861Z","avatar_url":"https://github.com/atduskgreg.png","language":"Java","funding_links":[],"categories":["Libraries","人工智能"],"sub_categories":["Contributions"],"readme":"## OpenCV for Processing\n\n**A Processing library for the [OpenCV](http://opencv.org/) computer vision library.**\n\nOpenCV for Processing is based on OpenCV's official Java bindings. It attempts to provide convenient wrappers for common OpenCV functions that are friendly to beginners and feel familiar to the Processing environment.\n\nSee the included examples below for an overview of what's possible and links to the relevant example code. Complete documentation is available here:\n\n**[OpenCV for Processing reference](http://atduskgreg.github.io/opencv-processing/reference/)**\n\nOpenCV for Processing is based on the officially supported [OpenCV Java API](http://docs.opencv.org/java/), currently at version 2.4.5. In addition to using the wrapped functionality, you can import OpenCV modules and use any of its documented functions: [OpenCV javadocs](http://docs.opencv.org/java/). See the advanced examples (HistogramSkinDetection, DepthFromStereo, and Marker Detection) below for details. (This style of API was inspired by Kyle McDonald's [ofxCv addon](https://github.com/kylemcdonald/ofxCv) for OpenFrameworks.) \n\nContributions welcome.\n\n### Installing\n\nOpenCV for Processing currently supports Mac OSX, 32-bit and 64-bit Windows, 32- and 64-bit Linux. Android support is hopefully coming soon (pull requests welcome).\n\n_NB: When running on the Mac, make sure you have Processing set to 64-bit mode in the Preferences_\n\nSee [here](https://github.com/atduskgreg/opencv-processing/releases) for the latest release.\n\n### Examples\n\n#### LiveCamTest\n\nAccess a live camera and do image processing on the result, specifically face detection.\n\nCode: [LiveCamTest.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/LiveCamTest/LiveCamTest.pde)\n\n_Note: There's a bug that prevents live camera access in current versions of Processing 2.0 on machines with a Retina display._\n\n#### FaceDetection\n\nDetect faces in images.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/8634017624/\" title=\"Screen Shot 2013-04-08 at 1.22.18 PM by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm9.staticflickr.com/8543/8634017624_35f7ef05ce.jpg\" width=\"500\" height=\"358\" alt=\"Screen Shot 2013-04-08 at 1.22.18 PM\"\u003e\u003c/a\u003e\n\nCode: [FaceDetection.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/FaceDetection/FaceDetection.pde)\n\n#### BrightnessContrast\n\nAdjust the brightness and contrast of color and gray images.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/9155239258/\" title=\"brightness and contrast by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm3.staticflickr.com/2841/9155239258_41a7df36c6.jpg\" width=\"500\" height=\"358\" alt=\"brightness and contrast\"\u003e\u003c/a\u003e\n\nCode: [BrightnessContrast.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/BrightnessContrast/BrightnessContrast.pde)\n\n#### FilterImages\n\nBasic filtering operations on images: threshold, blur, and adaptive thresholds.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/8643666252/\" title=\"Screen Shot 2013-04-12 at 1.42.30 PM by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm9.staticflickr.com/8240/8643666252_be0da1c751.jpg\" width=\"500\" height=\"358\" alt=\"Screen Shot 2013-04-12 at 1.42.30 PM\"\u003e\u003c/a\u003e\n\nCode: [FilterImages.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/FilterImages/FilterImages.pde)\n\n#### FindContours\n\nFind contours in images and calculate polygon approximations of the contours (i.e., the closest straight line that fits the contour).\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/9024663015/\" title=\"contours with polygon approximations by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm4.staticflickr.com/3719/9024663015_f419b117b1.jpg\" width=\"500\" height=\"208\" alt=\"contours with polygon approximations\"\u003e\u003c/a\u003e\n\nCode: [FindContours.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/FindContours/FindContours.pde)\n\n#### FindEdges\n\nThree different edge-detection techniques: Canny, Scharr, and Sobel.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/8635989723/\" title=\"Screen Shot 2013-04-10 at 2.03.59 AM by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm9.staticflickr.com/8109/8635989723_170b69dca0.jpg\" width=\"500\" height=\"358\" alt=\"Screen Shot 2013-04-10 at 2.03.59 AM\"\u003e\u003c/a\u003e\n\nCode: [FindEdges.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/FindEdges/FindEdges.pde)\n\n#### FindLines\n\nFind straight lines in the image using Hough line detection.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/9263329608/\" title=\"Hough line detection by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm4.staticflickr.com/3781/9263329608_735ce228bb.jpg\" width=\"486\" height=\"500\" alt=\"Hough line detection\"\u003e\u003c/a\u003e\n\nCode: [HoughLineDetection.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/HoughLineDetection/HoughLineDetection.pde)\n\n#### BrightestPoint\n\nFind the brightest point in an image.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/9199572469/\" title=\"finding the brightest point by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm8.staticflickr.com/7407/9199572469_4a25c83062.jpg\" width=\"500\" height=\"366\" alt=\"finding the brightest point\"\u003e\u003c/a\u003e\n\nCode: [BrightestPoint.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/BrightestPoint/BrightestPoint.pde)\n\n#### RegionOfInterest\n\nAssign a sub-section (or Region of Interest) of the image to be processed. Video of this example in action here: [Region of Interest demo on Vimeo](https://vimeo.com/69009345).\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/9077805277/\" title=\"region of interest by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm4.staticflickr.com/3795/9077805277_084d87a3a5.jpg\" width=\"500\" height=\"358\" alt=\"region of interest\"\u003e\u003c/a\u003e\n\nCode: [RegionOfInterest.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/RegionOfInterest/RegionOfInterest.pde)\n\n#### ImageDiff\n\nFind the difference between two images in order to subtract the background or detect a new object in a scene.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/8640005799/\" title=\"Screen Shot 2013-04-11 at 2.10.35 PM by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm9.staticflickr.com/8114/8640005799_44b48e01ae.jpg\" width=\"500\" height=\"409\" alt=\"Screen Shot 2013-04-11 at 2.10.35 PM\"\u003e\u003c/a\u003e\n\nCode: [ImageDiff.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/ImageDiff/ImageDiff.pde)\n\n#### DilationAndErosion\n\nThin (erode) and expand (dilate) an image in order to close holes. These are known as \"morphological\" operations.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/9075875005/\" title=\"dilation and erosion by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm3.staticflickr.com/2818/9075875005_8f7cde3ed7.jpg\" width=\"496\" height=\"500\" alt=\"dilation and erosion\"\u003e\u003c/a\u003e\n\nCode: [DilationAndErosion.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/DilationAndErosion/DilationAndErosion.pde)\n\n#### BackgroundSubtraction\n\nDetect moving objects in a scene. Use background subtraction to distinguish background from foreground and contour tracking to track the foreground objects.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/9220336868/\" title=\"Background Subtraction by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm8.staticflickr.com/7292/9220336868_bed3498528.jpg\" width=\"500\" height=\"369\" alt=\"Background Subtraction\"\u003e\u003c/a\u003e\n\nCode: [BackgroundSubtraction.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/BackgroundSubtraction/BackgroundSubtraction.pde)\n\n\n#### WorkingWithColorImages\n\nDemonstration of what you can do color images in OpenCV (threshold, blur, etc) and what you can't (lots of other operations).\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/9136033334/\" title=\"color operations: threshold and blur by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm6.staticflickr.com/5451/9136033334_3345dfa057.jpg\" width=\"500\" height=\"358\" alt=\"color operations: threshold and blur\"\u003e\u003c/a\u003e\n\nCode: [WorkingWithColorImages.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/WorkingWithColorImages/WorkingWithColorImages.pde)\n\n#### ColorChannels ####\n\nSeparate a color image into red, green, blue or hue, saturation, and value channels in order to work with the channels individually.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/9246157901/\" title=\"ColorChannels by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm3.staticflickr.com/2847/9246157901_08ccf19e7d.jpg\" width=\"488\" height=\"500\" alt=\"ColorChannels\"\u003e\u003c/a\u003e\n\nCode: [ColorChannels](https://github.com/atduskgreg/opencv-processing/blob/master/examples/ColorChannels/ColorChannels.pde)\n\n#### FindHistogram\n\nDemonstrates use of the findHistogram() function and the Histogram class to get and draw histograms for grayscale and individual color channels.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/9174190443/\" title=\"gray, red, green, blue histograms by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm8.staticflickr.com/7287/9174190443_224a740ce8.jpg\" width=\"500\" height=\"355\" alt=\"gray, red, green, blue histograms\"\u003e\u003c/a\u003e\n\nCode: [FindHistogram.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/FindHistogram/FindHistogram.pde)\n\n#### HueRangeSelection\n\nDetect objects based on their color. Demonstrates the use of HSV color space as well as range-based image filtering.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/9193745547/\" title=\"Hue-based color detection by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm4.staticflickr.com/3799/9193745547_8f09e55a39.jpg\" width=\"500\" height=\"397\" alt=\"Hue-based color detection\"\u003e\u003c/a\u003e\n\nCode: [HueRangeSelection.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/HueRangeSelection/HueRangeSelection.pde)\n\n#### CalibrationDemo (in progress)\n\nAn example of the process involved in calibrating a camera. Currently only detects the corners in a chessboard pattern.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/8706849024/\" title=\"Screen Shot 2013-05-04 at 2.03.23 AM by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm9.staticflickr.com/8267/8706849024_f2d938ec51.jpg\" width=\"500\" height=\"382\" alt=\"Screen Shot 2013-05-04 at 2.03.23 AM\"\u003e\u003c/a\u003e\n\nCode: [CalibrationDemo.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/CalibrationDemo/CalibrationDemo.pde)\n\n#### HistogramSkinDetection\n\nA more advanced example. Detecting skin in an image based on colors in a region of color space. Warning: uses un-wrapped OpenCV objects and functions.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/8707167599/\" title=\"Screen Shot 2013-05-04 at 2.25.18 PM by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm9.staticflickr.com/8135/8707167599_d38fbdfe30.jpg\" width=\"500\" height=\"171\" alt=\"Screen Shot 2013-05-04 at 2.25.18 PM\"\u003e\u003c/a\u003e\n\nCode: [HistogramSkinDetection.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/HistogramSkinDetection/HistogramSkinDetection.pde)\n\n#### DepthFromStereo\n\nAn advanced example. Calculates depth information from a pair of stereo images. Warning: uses un-wrapped OpenCV objects and functions.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/8642493130/\" title=\"Screen Shot 2013-04-12 at 2.27.30 AM by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm9.staticflickr.com/8260/8642493130_f99dd76f3d.jpg\" width=\"500\" height=\"404\" alt=\"Screen Shot 2013-04-12 at 2.27.30 AM\"\u003e\u003c/a\u003e\n\nCode: [DepthFromStereo.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/DepthFromStereo/DepthFromStereo.pde)\n\n#### WarpPerspective (in progress)\n\nUn-distort an object that's in perspective. Coming to the real API soon.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/9279197332/\" title=\"Warp Perspective by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm3.staticflickr.com/2861/9279197332_ca6beb3760.jpg\" width=\"500\" height=\"416\" alt=\"Warp Perspective\"\u003e\u003c/a\u003e\n\nCode: [WarpPerspective.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/WarpPerspective/WarpPerspective.pde)\n\n#### MarkerDetection\n\nAn in-depth advanced example. Detect a CV marker in an image, warp perspective, and detect the number stored in the marker. Many steps in the code. Uses many un-wrapped OpenCV objects and functions.\n\n\u003ca href=\"http://www.flickr.com/photos/unavoidablegrain/8642309968/\" title=\"Screen Shot 2013-04-12 at 12.20.17 AM by atduskgreg, on Flickr\"\u003e\u003cimg src=\"http://farm9.staticflickr.com/8522/8642309968_257e397db2.jpg\" width=\"500\" height=\"225\" alt=\"Screen Shot 2013-04-12 at 12.20.17 AM\"\u003e\u003c/a\u003e\n\nCode: [MarkerDetection.pde](https://github.com/atduskgreg/opencv-processing/blob/master/examples/MarkerDetection/MarkerDetection.pde)\n\n#### MorphologyOperations\n\nOpen and close an image, or do more complicated morphological transformations.\n\n\u003ca href=\"https://flic.kr/p/tazj7r\" title=\"Morphology operations\"\u003e\u003cimg src=\"https://farm6.staticflickr.com/5340/17829980821_1734e8bab8_z_d.jpg\" width=\"640\" height=\"393\" alt=\"Morphology operations\"\u003e\u003c/a\u003e\n\nCode: [MorphologyOperations.pde](examples/MorphologyOperations/MorphologyOperations.pde)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatduskgreg%2Fopencv-processing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatduskgreg%2Fopencv-processing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatduskgreg%2Fopencv-processing/lists"}