├── .Rbuildignore ├── .github ├── .gitignore ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── R-CMD-check.yaml │ ├── pkgdown.yaml │ └── test-coverage.yaml ├── .gitignore ├── DESCRIPTION ├── LICENSE ├── NAMESPACE ├── NEWS.md ├── R ├── ImageClass.R ├── QueueClass.R ├── Rvision-package.R ├── StreamClass.R ├── VideoClass.R ├── VideoStackClass.R ├── VideoWriterClass.R ├── ack.R ├── arithmetic.R ├── backgrounder.R ├── blob.R ├── calib3d.R ├── comparisons.R ├── conversions.R ├── display.R ├── draw.R ├── feature.R ├── filters.R ├── generic.R ├── geometry.R ├── logical.R ├── morphology.R ├── opticalFlow.R ├── shape.R ├── statistics.R ├── transform.R ├── utils.R ├── ximgproc.R └── zzz.R ├── README.md ├── Rvision.Rproj ├── _pkgdown.yml ├── codecov.yml ├── configure ├── configure.ucrt ├── configure.win ├── data └── cc_table.rda ├── docs ├── 404.html ├── LICENSE-text.html ├── apple-touch-icon-120x120.png ├── apple-touch-icon-152x152.png ├── apple-touch-icon-180x180.png ├── apple-touch-icon-60x60.png ├── apple-touch-icon-76x76.png ├── apple-touch-icon.png ├── articles │ ├── index.html │ ├── z1_install.html │ ├── z2_io.html │ ├── z3_basic.html │ ├── z4_inplace.html │ ├── z5_gpu.html │ └── z6_queue.html ├── authors.html ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── index.html ├── link.svg ├── logo.svg ├── news │ └── index.html ├── pkgdown.js ├── pkgdown.yml ├── reference │ ├── CLAHE.html │ ├── Image-class.html │ ├── LUT.html │ ├── Queue-class.html │ ├── Rplot001.png │ ├── Rvision.html │ ├── RvisionAck.html │ ├── Stream-class.html │ ├── Video-class.html │ ├── VideoWriter-class.html │ ├── adaptiveThreshold.html │ ├── addWeighted.html │ ├── anisotropicDiffusion.html │ ├── api.html │ ├── arcLength.html │ ├── as.array.Rcpp_Image.html │ ├── autothreshold.html │ ├── bilateralFilter.html │ ├── bitdepth.html │ ├── blur.html │ ├── border.html │ ├── boxFilter.html │ ├── canny.html │ ├── capacity.html │ ├── cartToPolar.html │ ├── cc_table.html │ ├── changeBitDepth.html │ ├── changeColorSpace.html │ ├── click.html │ ├── cloneImage.html │ ├── codec.html │ ├── col2bgr.html │ ├── colorspace.html │ ├── compare.html │ ├── computeECC.html │ ├── concatenate.html │ ├── connectedComponents.html │ ├── contourArea.html │ ├── convexHull.html │ ├── convexityDefects.html │ ├── countNonZero.html │ ├── destroyDisplay.html │ ├── dim.Rcpp_Image.html │ ├── dim.Rcpp_Queue.html │ ├── dim.Rcpp_Stream.html │ ├── dim.Rcpp_Video.html │ ├── dim.Rcpp_VideoWriter.html │ ├── display.html │ ├── distanceTransform.html │ ├── drawArrow.html │ ├── drawCircle.html │ ├── drawEllipse.html │ ├── drawLine.html │ ├── drawPolyline.html │ ├── drawRectangle.html │ ├── drawRotatedRectangle.html │ ├── drawText.html │ ├── edgePreservingFilter.html │ ├── exp.html │ ├── extractChannel.html │ ├── farneback.html │ ├── figures │ │ └── logo.png │ ├── fillConvexPoly.html │ ├── fillPoly.html │ ├── filter2D.html │ ├── findContours.html │ ├── findNonZero.html │ ├── findTransformECC.html │ ├── findTransformORB.html │ ├── fitEllipse.html │ ├── flip.html │ ├── floodFill.html │ ├── fourcc.html │ ├── fps.html │ ├── frame.html │ ├── full.html │ ├── gaussianBlur.html │ ├── getGaborKernel.html │ ├── getPerspectiveTransform.html │ ├── getStructuringElement.html │ ├── getTextSize.html │ ├── grabCut.html │ ├── histEq.html │ ├── histmatch.html │ ├── houghCircles.html │ ├── huInvariants.html │ ├── imageArithmetic.html │ ├── imageLogic.html │ ├── imageMinMax.html │ ├── imhist.html │ ├── improfile.html │ ├── inPlaceArithmetic.html │ ├── inPlaceComparison.html │ ├── inPlaceLogical.html │ ├── inRange.html │ ├── index.html │ ├── inpaint.html │ ├── insertChannel.html │ ├── invert.html │ ├── isBlob.html │ ├── isImage.html │ ├── isQueue.html │ ├── isStream.html │ ├── isVideo.html │ ├── isVideoWriter.html │ ├── laplacian.html │ ├── log.html │ ├── matchShapes.html │ ├── matchTemplate.html │ ├── mean.Rcpp_Image.html │ ├── mean.list.html │ ├── medianBlur.html │ ├── merge.html │ ├── min.Rcpp_Image.html │ ├── minAreaRect.html │ ├── minMaxLoc.html │ ├── moments.html │ ├── morph.html │ ├── newDisplay.html │ ├── niBlackThreshold.html │ ├── nrow.Rcpp_Image.html │ ├── ones.html │ ├── pget.html │ ├── pixelsInContour.html │ ├── plot.Image.html │ ├── plot.blob.html │ ├── plotOF-1.png │ ├── plotOF.html │ ├── polarToCart.html │ ├── pow.html │ ├── pset.html │ ├── queue_dimensions.html │ ├── randn.html │ ├── randu.html │ ├── readFrame.html │ ├── readHIS.html │ ├── readMulti.html │ ├── readNext.html │ ├── reduce.html │ ├── release.html │ ├── reset.html │ ├── resize.html │ ├── rotateScale.html │ ├── scharr.html │ ├── selectROI.html │ ├── sepFilter2D.html │ ├── setProp.html │ ├── setTo.html │ ├── simpleBlobDetector.html │ ├── sobel.html │ ├── spatialGradient.html │ ├── split.html │ ├── sqrBoxFilter.html │ ├── sqrt.html │ ├── stream_dimensions.html │ ├── sub-.Rcpp_Image.html │ ├── subImage.html │ ├── sum.html │ ├── thinning.html │ ├── threshold.html │ ├── tile.html │ ├── timelapse.html │ ├── video_dimensions.html │ ├── videowriter_dimensions.html │ ├── warpAffine.html │ ├── warpPerspective.html │ ├── watershed.html │ ├── write.Image.html │ ├── writeFrame.html │ ├── writeMulti.html │ ├── writerOuput.html │ └── zeros.html └── sitemap.xml ├── inst ├── CITATION ├── sample_img │ ├── balloon1.png │ ├── balloon2.png │ ├── checkerboard6x9.png │ ├── dots.jpg │ └── multipage.tif └── sample_vid │ ├── Balloon.mp4 │ └── calibration.mp4 ├── logo.png ├── logo.svg ├── man ├── CLAHE.Rd ├── Image-class.Rd ├── LUT.Rd ├── ORBkeypoints.Rd ├── Queue-class.Rd ├── Rvision.Rd ├── RvisionAck.Rd ├── Stream-class.Rd ├── Video-class.Rd ├── VideoStack-class.Rd ├── VideoWriter-class.Rd ├── adaptiveThreshold.Rd ├── addWeighted.Rd ├── anisotropicDiffusion.Rd ├── api.Rd ├── approxPolyDP.Rd ├── arcLength.Rd ├── as.array.Rcpp_Image.Rd ├── autothreshold.Rd ├── bilateralFilter.Rd ├── bitdepth.Rd ├── blur.Rd ├── border.Rd ├── boxFilter.Rd ├── boxPoints.Rd ├── calibrateCamera.Rd ├── canny.Rd ├── capacity.Rd ├── cartToPolar.Rd ├── cc_table.Rd ├── changeBitDepth.Rd ├── changeColorSpace.Rd ├── click.Rd ├── cloneImage.Rd ├── codec.Rd ├── col2bgr.Rd ├── colorspace.Rd ├── compare.Rd ├── computeECC.Rd ├── concatenate.Rd ├── connectedComponents.Rd ├── contourArea.Rd ├── convexHull.Rd ├── convexityDefects.Rd ├── cornerSubPix.Rd ├── countNonZero.Rd ├── destroyDisplay.Rd ├── dim.Rcpp_Image.Rd ├── dim.Rcpp_Queue.Rd ├── dim.Rcpp_Stream.Rd ├── dim.Rcpp_Video.Rd ├── dim.Rcpp_VideoWriter.Rd ├── dim.VideoStack.Rd ├── display.Rd ├── distanceTransform.Rd ├── drawArrow.Rd ├── drawCircle.Rd ├── drawEllipse.Rd ├── drawLine.Rd ├── drawPolyline.Rd ├── drawRectangle.Rd ├── drawRotatedRectangle.Rd ├── drawText.Rd ├── edgePreservingFilter.Rd ├── exp.Rd ├── extractChannel.Rd ├── farneback.Rd ├── figures │ ├── logo.png │ ├── z8_comparison.png │ └── z8_coverage.png ├── fillConvexPoly.Rd ├── fillPoly.Rd ├── filter2D.Rd ├── findChessboardCorners.Rd ├── findContours.Rd ├── findHomography.Rd ├── findNonZero.Rd ├── findTransformECC.Rd ├── findTransformORB.Rd ├── fitEllipse.Rd ├── flip.Rd ├── floodFill.Rd ├── fourcc.Rd ├── fps.Rd ├── frame.Rd ├── full.Rd ├── gaussianBlur.Rd ├── getAffineTransform.Rd ├── getGaborKernel.Rd ├── getOptimalNewCameraMatrix.Rd ├── getPerspectiveTransform.Rd ├── getStructuringElement.Rd ├── getTextSize.Rd ├── goodFeaturesToTrack.Rd ├── grabCut.Rd ├── histEq.Rd ├── histmatch.Rd ├── houghCircles.Rd ├── houghLinesP.Rd ├── huInvariants.Rd ├── imageArithmetic.Rd ├── imageLogic.Rd ├── imageMinMax.Rd ├── imhist.Rd ├── improfile.Rd ├── inPlaceArithmetic.Rd ├── inPlaceComparison.Rd ├── inPlaceLogical.Rd ├── inRange.Rd ├── initUndistortRectifyMap.Rd ├── inpaint.Rd ├── insertChannel.Rd ├── invert.Rd ├── invertFourcc.Rd ├── isBlob.Rd ├── isImage.Rd ├── isQueue.Rd ├── isStream.Rd ├── isVideo.Rd ├── isVideoStack.Rd ├── isVideoWriter.Rd ├── laplacian.Rd ├── log.Rd ├── matchKeypoints.Rd ├── matchShapes.Rd ├── matchTemplate.Rd ├── mean.Rcpp_Image.Rd ├── mean.list.Rd ├── medianBlur.Rd ├── merge.Rd ├── min.Rcpp_Image.Rd ├── minAreaRect.Rd ├── minMaxLoc.Rd ├── moments.Rd ├── morph.Rd ├── newDisplay.Rd ├── niBlackThreshold.Rd ├── nrow.Rcpp_Image.Rd ├── ones.Rd ├── pget.Rd ├── pixelsInContour.Rd ├── plot.Image.Rd ├── plot.blob.Rd ├── plotOF.Rd ├── polarToCart.Rd ├── pow.Rd ├── pset.Rd ├── pyrDown.Rd ├── pyrUp.Rd ├── queue_dimensions.Rd ├── randn.Rd ├── randu.Rd ├── readFrame.Rd ├── readHIS.Rd ├── readMulti.Rd ├── readNext.Rd ├── reduce.Rd ├── release.Rd ├── remap.Rd ├── reset.Rd ├── resize.Rd ├── rotate.Rd ├── rotateScale.Rd ├── scharr.Rd ├── selectROI.Rd ├── sepFilter2D.Rd ├── setProp.Rd ├── setTo.Rd ├── simpleBlobDetector.Rd ├── sobel.Rd ├── spatialGradient.Rd ├── split.Rd ├── sqrBoxFilter.Rd ├── sqrt.Rd ├── stream_dimensions.Rd ├── sub-.Rcpp_Image.Rd ├── sub-.VideoStack.Rd ├── subImage.Rd ├── sum.Rd ├── thinning.Rd ├── threshold.Rd ├── tile.Rd ├── timelapse.Rd ├── undistort.Rd ├── undistortPoints.Rd ├── videoStack.Rd ├── video_dimensions.Rd ├── videostack_dimensions.Rd ├── videowriter_dimensions.Rd ├── warpAffine.Rd ├── warpPerspective.Rd ├── watershed.Rd ├── write.Image.Rd ├── writeFrame.Rd ├── writeMulti.Rd ├── writerOuput.Rd └── zeros.Rd ├── pkgdown └── favicon │ ├── apple-touch-icon-120x120.png │ ├── apple-touch-icon-152x152.png │ ├── apple-touch-icon-180x180.png │ ├── apple-touch-icon-60x60.png │ ├── apple-touch-icon-76x76.png │ ├── apple-touch-icon.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ └── favicon.ico ├── src ├── Capture.h ├── Image.h ├── Makevars ├── Makevars.win ├── Queue.h ├── RcppExports.cpp ├── Stream.h ├── Video.h ├── VideoWriter.h ├── arithmetic.h ├── autothresh.h ├── blob.h ├── calib3d.h ├── comparisons.h ├── display.h ├── draw.h ├── feature.h ├── filters.h ├── geometry.h ├── logical.h ├── morphology.h ├── opencvarma.h ├── opticalFlow.h ├── shape.h ├── statistics.h ├── transform.h ├── utils.h ├── visionModule.cpp └── ximgproc.h └── vignettes ├── z1_install.R ├── z1_install.Rmd ├── z1_install.html ├── z2_io.R ├── z2_io.Rmd ├── z2_io.html ├── z3_basic.R ├── z3_basic.Rmd ├── z3_basic.html ├── z4_inplace.R ├── z4_inplace.Rmd ├── z4_inplace.html ├── z5_gpu.R ├── z5_gpu.Rmd ├── z5_gpu.html ├── z6_queue.R ├── z6_queue.Rmd ├── z6_queue.html ├── z7_stack.R ├── z7_stack.Rmd ├── z7_stack.html ├── z8_calib.R ├── z8_calib.Rmd └── z8_calib.html /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | helpers 4 | LICENSE 5 | scripts 6 | vignettes/old 7 | _pkgdown.yaml 8 | pkgdown 9 | docs 10 | index.Rmd 11 | logo.* 12 | ci_script 13 | ^\.github$ 14 | ^_pkgdown\.yml$ 15 | ^docs$ 16 | ^pkgdown$ 17 | ^codecov\.yml$ 18 | ^doc$ 19 | ^Meta$ 20 | .vscode -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a bug report to help Rvision improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 20 | 21 | **Describe the bug** 22 | A clear and concise description of what the bug is. 23 | 24 | **To Reproduce** 25 | Steps to reproduce the behavior 26 | 27 | **Expected behavior** 28 | A clear and concise description of what you expected to happen. 29 | 30 | **Screenshots** 31 | If applicable, add screenshots to help explain your problem. 32 | 33 | **Computer (please complete the following information):** 34 | - Operating system: [e.g. MacOS] 35 | - Version [e.g. 11.2.1] 36 | 37 | **R (please complete the following information):** 38 | - R version: [e.g. 4.0.4] 39 | - Rvision version: [e.g. 0.4.2] 40 | - ROpenCVLite version: [e.g. 4.50.0] 41 | 42 | **Additional context** 43 | Add any other context about the problem here. 44 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea to improve Rvision 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 21 | 22 | **Is your feature request related to a problem? Please describe.** 23 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 24 | 25 | **Describe the solution you'd like** 26 | A clear and concise description of what you want to happen. 27 | 28 | **Describe alternatives you've considered** 29 | A clear and concise description of any alternative solutions or features you've considered. 30 | 31 | **Additional context** 32 | Add any other context or screenshots about the feature request here. 33 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | release: 9 | types: [published] 10 | workflow_dispatch: 11 | 12 | name: pkgdown 13 | 14 | jobs: 15 | pkgdown: 16 | runs-on: ubuntu-latest 17 | # Only restrict concurrency for non-PR jobs 18 | concurrency: 19 | group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} 20 | env: 21 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 22 | steps: 23 | - uses: actions/checkout@v3 24 | 25 | - uses: r-lib/actions/setup-pandoc@v2 26 | 27 | - uses: r-lib/actions/setup-r@v2 28 | with: 29 | use-public-rspm: true 30 | 31 | - uses: r-lib/actions/setup-r-dependencies@v2 32 | with: 33 | extra-packages: any::pkgdown, local::. 34 | needs: website 35 | 36 | - name: Build site 37 | run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) 38 | shell: Rscript {0} 39 | 40 | - name: Deploy to GitHub pages 🚀 41 | if: github.event_name != 'pull_request' 42 | uses: JamesIves/github-pages-deploy-action@v4.4.1 43 | with: 44 | clean: false 45 | branch: gh-pages 46 | folder: docs 47 | -------------------------------------------------------------------------------- /.github/workflows/test-coverage.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: test-coverage 10 | 11 | jobs: 12 | test-coverage: 13 | runs-on: ubuntu-latest 14 | env: 15 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 16 | 17 | steps: 18 | - uses: actions/checkout@v3 19 | 20 | - uses: r-lib/actions/setup-r@v2 21 | with: 22 | use-public-rspm: true 23 | 24 | - uses: r-lib/actions/setup-r-dependencies@v2 25 | with: 26 | extra-packages: any::covr 27 | needs: coverage 28 | 29 | - name: Test coverage 30 | run: | 31 | covr::codecov( 32 | quiet = FALSE, 33 | clean = FALSE, 34 | install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") 35 | ) 36 | shell: Rscript {0} 37 | 38 | - name: Show testthat output 39 | if: always() 40 | run: | 41 | ## -------------------------------------------------------------------- 42 | find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true 43 | shell: bash 44 | 45 | - name: Upload test results 46 | if: failure() 47 | uses: actions/upload-artifact@v3 48 | with: 49 | name: coverage-test-failures 50 | path: ${{ runner.temp }}/package 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | src/*.o 6 | src/*.so 7 | src/*.dll 8 | src-* 9 | scripts 10 | vignettes/old 11 | src/.DS_Store 12 | .DS_Store 13 | tmp.def 14 | *.insyncdl 15 | docs 16 | /doc/ 17 | /Meta/ 18 | .vscode -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: Rvision 2 | Type: Package 3 | Title: Computer Vision Library for R 4 | Version: 0.8.1 5 | Date: 2024-08-01 6 | Authors@R: c( 7 | person("Simon", "Garnier", email = "garnier@njit.edu", role = c("aut", "cre"), 8 | comment = c(ORCID = "0000-0002-3886-3974")), 9 | person("Muschelli", "John", email = "muschellij2@gmail.com", role = c("ctb", "cph")) 10 | ) 11 | Maintainer: Simon Garnier 12 | Description: An OpenCV-based computer vision library providing methods to read 13 | and manipulate video and image files, as well as camera streams. 14 | License: GPL-3 15 | LazyData: TRUE 16 | NeedsCompilation: yes 17 | Depends: 18 | R (>= 4.0.0) 19 | Imports: 20 | Rcpp (>= 1.0.1), 21 | RcppArmadillo, 22 | ROpenCVLite (>= 4.90.2), 23 | methods, 24 | pbapply, 25 | stats, 26 | graphics 27 | LinkingTo: Rcpp, RcppArmadillo 28 | RcppModules: class_Image, class_Capture, class_VideoWriter, 29 | methods_Arithmetic, methods_Statistics, methods_Comparisons, methods_Logical, 30 | methods_OpticalFlow, methods_Blob, methods_Morphology, methods_Filters, 31 | methods_Display, methods_Draw, methods_Geometry, methods_Shape, methods_Transform, 32 | methods_Feature, methods_Autothresh, methods_Ximgproc, methods_Calib3d 33 | RoxygenNote: 7.3.2 34 | Biarch: false 35 | StagedInstall: false 36 | Encoding: UTF-8 37 | Suggests: 38 | covr, 39 | knitr, 40 | rmarkdown 41 | VignetteBuilder: knitr 42 | URL: https://swarm-lab.github.io/Rvision/, 43 | https://github.com/swarm-lab/Rvision 44 | BugReports: https://github.com/swarm-lab/Rvision/issues 45 | -------------------------------------------------------------------------------- /R/Rvision-package.R: -------------------------------------------------------------------------------- 1 | #' Rvision: Computer vision library for R 2 | #' 3 | #' The \code{Rvision} package contains an OpenCV-based computer vision library 4 | #' providing methods to read and manipulate video and image files, as well as 5 | #' camera streams. 6 | #' 7 | #' @author Simon Garnier 8 | #' @author John Muschelli 9 | #' 10 | #' Maintainer: Simon Garnier 11 | #' 12 | #' @details 13 | #' \tabular{ll}{ 14 | #' Package: \tab Rvision\cr 15 | #' Type: \tab Package\cr 16 | #' Version: \tab 0.8.0\cr 17 | #' Date: \tab 2024-01-31\cr 18 | #' License: \tab GPL-3\cr 19 | #' } 20 | #' 21 | #' @references More about OpenCV at \url{http://opencv.org/}. 22 | #' 23 | #' @name Rvision 24 | "_PACKAGE" -------------------------------------------------------------------------------- /R/ack.R: -------------------------------------------------------------------------------- 1 | # ------ 2 | #' Image and video samples 3 | #' 4 | #' \code{\link{Rvision}} provides a few image and video samples for illustrating 5 | #' the examples of its different functions. Below are references to the original 6 | #' material from which these samples have been extracted. 7 | #' 8 | #' @name RvisionAck 9 | #' 10 | #' @docType data 11 | #' 12 | #' @references 13 | #' \itemize{ 14 | #' \item{"Big Buck Bunny", © copyright 2008, Blender Foundation / 15 | #' \url{www.bigbuckbunny.org} - Distributed under the Creative Commons 16 | #' Attribution 3.0 license.} 17 | #' \item{EC Funded CAVIAR project/IST 2001 37540 - 18 | #' \url{http://homepages.inf.ed.ac.uk/rbf/CAVIAR/}} 19 | #' \item{Pixabay / \url{https://pixabay.com/en/dots-blue-background-fabric-313325/} 20 | #' - Distributed under the Creative Commons CC0 Public Domain license.} 21 | #' } 22 | NULL 23 | -------------------------------------------------------------------------------- /R/backgrounder.R: -------------------------------------------------------------------------------- 1 | backgrounder <- function(video, n = 10, method = "mean") { 2 | if (!isVideo(video)) 3 | stop("This is not a Video object.") 4 | 5 | if (n > video$nframes()) 6 | stop("n should be smaller than the total number of frames in the video.") 7 | 8 | frames <- round(seq.int(1, video$nframes() - 2, length.out = n)) 9 | 10 | print("Loading images in memory.") 11 | l1 <- c() 12 | for (i in 1:n) { 13 | l1 <- c(l1, readFrame(video, frames[i])) 14 | } 15 | print("Done.") 16 | 17 | if (method == "mean") { 18 | out <- mean(l1) 19 | } else if (method == "median") { 20 | l2 <- lapply(l1, as.array) 21 | 22 | l3 <- list() 23 | for (i in 1:l1[[1]]$nchan()) { 24 | l3[[i]] <- simplify2array(lapply(l2, function(m, i) m[, , i], i = i)) 25 | } 26 | 27 | print("Computing median image. This is a slow process, please be patient.") 28 | 29 | mat <- array(NA, dim = dim(l1[[1]])) 30 | for (i in 1:l1[[1]]$nchan()) { 31 | print(paste0("Processing channel ", i, " out of ", l1[[1]]$nchan())) 32 | mat[, , i] <- pbapply::pbapply(l3[[i]], c(1, 2), stats::median.default) 33 | } 34 | 35 | if (bitdepth(l1[[1]]) == "8U") { 36 | mat <- mat * 256 37 | out <- image(mat) 38 | changeBitDepth(out, 8, target = "self") 39 | } else { 40 | out <- image(mat) 41 | } 42 | print("Done.") 43 | } else { 44 | stop("'method' should be 'mean' or 'median'") 45 | } 46 | 47 | out 48 | } 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /R/utils.R: -------------------------------------------------------------------------------- 1 | .now <- function() { 2 | options(digits.secs = 6) 3 | time <- as.numeric(Sys.time()) * 1000 4 | options(digits.secs = NULL) 5 | time 6 | } 7 | 8 | 9 | #' @title Color to BGR Conversion 10 | #' 11 | #' @description R color to BRG (blue/green/red) conversion. 12 | #' 13 | #' @param col Vector of any of the three kinds of R color specifications, i.e., 14 | #' either a color name (as listed by \code{\link{colors}}()), a hexadecimal 15 | #' string of the form "\code{#rrggbb}" or "\code{#rrggbbaa}" (see \code{\link{rgb}}), 16 | #' or a positive integer \code{i} meaning \code{\link{palette}()[i]}. 17 | #' 18 | #' @param alpha Logical value indicating whether the alpha channel (opacity) 19 | #' values should be returned. 20 | #' 21 | #' @details \code{\link{NA}} (as integer or character) and "NA" mean transparent. 22 | #' 23 | #' Values of \code{col} not of one of these types are coerced: real vectors are 24 | #' coerced to integer and other types to character. (factors are coerced to 25 | #' character: in all other cases the class is ignored when doing the coercion.) 26 | #' 27 | #' Zero and negative values of \code{col} are an error. 28 | #' 29 | #' @return An integer matrix with three or four (for \code{alpha = TRUE}) rows 30 | #' and number of columns the length of \code{col}. If col has names these are 31 | #' used as the column names of the return value. 32 | #' 33 | #' @author Simon Garnier, \email{garnier@@njit.edu} 34 | #' 35 | #' @seealso \code{\link{col2rgb}}, \code{\link{rgb}}, \code{\link{palette}} 36 | #' 37 | #' @examples 38 | #' col2bgr("red") 39 | #' col2bgr(1:10) 40 | #' 41 | #' @export 42 | col2bgr <- function(col, alpha = FALSE) { 43 | if (alpha) { 44 | col2rgb(col, alpha)[c(3:1, 4), , drop = FALSE] 45 | } else { 46 | col2rgb(col, alpha)[3:1, , drop = FALSE] 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Rvision.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | StripTrailingWhitespace: Yes 16 | 17 | BuildType: Package 18 | PackageUseDevtools: Yes 19 | PackageInstallArgs: --with-keep.source 20 | PackageCheckArgs: --as-cran 21 | PackageRoxygenize: rd,collate,namespace,vignette 22 | -------------------------------------------------------------------------------- /_pkgdown.yml: -------------------------------------------------------------------------------- 1 | url: https://swarm-lab.github.io/Rvision/ 2 | 3 | template: 4 | bootstrap: 5 5 | bootswatch: simplex 6 | 7 | authors: 8 | Simon Garnier: 9 | href: https://www.theswarmlab.com 10 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | 3 | coverage: 4 | status: 5 | project: 6 | default: 7 | target: auto 8 | threshold: 1% 9 | informational: true 10 | patch: 11 | default: 12 | target: auto 13 | threshold: 1% 14 | informational: true 15 | -------------------------------------------------------------------------------- /configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -x 3 | set -e 4 | 5 | ${R_HOME}/bin/Rscript -e "if (nzchar(Sys.getenv('CI')) & !ROpenCVLite::isOpenCVInstalled()) ROpenCVLite::installOpenCV(batch = TRUE)" 6 | ${R_HOME}/bin/Rscript -e "if (nzchar(Sys.getenv('CI')) & ROpenCVLite::isOpenCVInstalled() & unlist(strsplit(as.character(utils::packageVersion('ROpenCVLite')), '[.]'))[3] != gsub('[^0-9]', '', ROpenCVLite::opencvVersion())) ROpenCVLite::installOpenCV(batch = TRUE)" 7 | ${R_HOME}/bin/Rscript -e "if (!ROpenCVLite::isOpenCVInstalled()) { cat('------------------ OPENCV NOT FOUND --------------------\n') ; cat('\n') ; cat('OpenCV was not found in your library. Please install OpenCV as follows:') ; cat('\n') ; cat('\n') ; cat('ROpenCVLite::installOpenCV(batch = TRUE)\n') ; cat('\n') ; cat('--------------------------------------------------------\n') ; cat('\n') ; stop('OpenCV not found.') }" 8 | -------------------------------------------------------------------------------- /configure.ucrt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -x 3 | set -e 4 | 5 | ${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e "if (nzchar(Sys.getenv('CI')) & !ROpenCVLite::isOpenCVInstalled()) ROpenCVLite::installOpenCV(batch = TRUE)" 6 | ${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e "if (nzchar(Sys.getenv('CI')) & ROpenCVLite::isOpenCVInstalled() & unlist(strsplit(as.character(utils::packageVersion('ROpenCVLite')), '[.]'))[3] != gsub('[^0-9]', '', ROpenCVLite::opencvVersion())) ROpenCVLite::installOpenCV(batch = TRUE)" 7 | ${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e "if (!ROpenCVLite::isOpenCVInstalled()) { cat('------------------ OPENCV NOT FOUND --------------------\n') ; cat('\n') ; cat('OpenCV was not found in your library. Please install OpenCV as follows:') ; cat('\n') ; cat('\n') ; cat('ROpenCVLite::installOpenCV(batch = TRUE)\n') ; cat('\n') ; cat('--------------------------------------------------------\n') ; cat('\n') ; stop('OpenCV not found.') }" 8 | ${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e " 9 | r_arch <- list.dirs(paste0(R.home(), '/bin'), FALSE, FALSE) 10 | opencv_arch <- ifelse(r_arch == 'i386', 'x86', 'x64') 11 | 12 | for (i in 1:length(opencv_arch)) { 13 | dest <- file.path('$R_PACKAGE_DIR', paste0('libs/', r_arch[i])) 14 | dir.create(dest, recursive = TRUE, showWarnings = FALSE) 15 | opencv_DLLs <- list.files(paste0(ROpenCVLite::OpenCVPath(), '/', opencv_arch[i], '/mingw/bin'), '.dll', full.names = TRUE) 16 | void <- lapply(opencv_DLLs, function(x) { 17 | file.copy(x, dest) 18 | }) 19 | } 20 | " 21 | -------------------------------------------------------------------------------- /configure.win: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -x 3 | set -e 4 | 5 | ${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e "if (nzchar(Sys.getenv('CI')) & !ROpenCVLite::isOpenCVInstalled()) ROpenCVLite::installOpenCV(batch = TRUE)" 6 | ${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e "if (nzchar(Sys.getenv('CI')) & ROpenCVLite::isOpenCVInstalled() & unlist(strsplit(as.character(utils::packageVersion('ROpenCVLite')), '[.]'))[3] != gsub('[^0-9]', '', ROpenCVLite::opencvVersion())) ROpenCVLite::installOpenCV(batch = TRUE)" 7 | ${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e "if (!ROpenCVLite::isOpenCVInstalled()) { cat('------------------ OPENCV NOT FOUND --------------------\n') ; cat('\n') ; cat('OpenCV was not found in your library. Please install OpenCV as follows:') ; cat('\n') ; cat('\n') ; cat('ROpenCVLite::installOpenCV(batch = TRUE)\n') ; cat('\n') ; cat('--------------------------------------------------------\n') ; cat('\n') ; stop('OpenCV not found.') }" 8 | ${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e " 9 | r_arch <- list.dirs(paste0(R.home(), '/bin'), FALSE, FALSE) 10 | opencv_arch <- ifelse(r_arch == 'i386', 'x86', 'x64') 11 | 12 | for (i in 1:length(opencv_arch)) { 13 | dest <- file.path('$R_PACKAGE_DIR', paste0('libs/', r_arch[i])) 14 | dir.create(dest, recursive = TRUE, showWarnings = FALSE) 15 | opencv_DLLs <- list.files(paste0(ROpenCVLite::OpenCVPath(), '/', opencv_arch[i], '/mingw/bin'), '.dll', full.names = TRUE) 16 | void <- lapply(opencv_DLLs, function(x) { 17 | file.copy(x, dest) 18 | }) 19 | } 20 | " -------------------------------------------------------------------------------- /data/cc_table.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/data/cc_table.rda -------------------------------------------------------------------------------- /docs/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/docs/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/docs/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/docs/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/docs/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/docs/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /docs/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/docs/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/docs/favicon-16x16.png -------------------------------------------------------------------------------- /docs/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/docs/favicon-32x32.png -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/docs/favicon.ico -------------------------------------------------------------------------------- /docs/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /docs/pkgdown.yml: -------------------------------------------------------------------------------- 1 | pandoc: 3.2.1 2 | pkgdown: 2.1.0 3 | pkgdown_sha: ~ 4 | articles: 5 | z1_install: z1_install.html 6 | z2_io: z2_io.html 7 | z3_basic: z3_basic.html 8 | z4_inplace: z4_inplace.html 9 | z5_gpu: z5_gpu.html 10 | z6_queue: z6_queue.html 11 | z7_stack: z7_stack.html 12 | z8_calib: z8_calib.html 13 | last_built: 2024-08-02T15:56Z 14 | urls: 15 | reference: https://swarm-lab.github.io/Rvision/reference 16 | article: https://swarm-lab.github.io/Rvision/articles 17 | -------------------------------------------------------------------------------- /docs/reference/Rplot001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/docs/reference/Rplot001.png -------------------------------------------------------------------------------- /docs/reference/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/docs/reference/figures/logo.png -------------------------------------------------------------------------------- /docs/reference/plotOF-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/docs/reference/plotOF-1.png -------------------------------------------------------------------------------- /inst/CITATION: -------------------------------------------------------------------------------- 1 | citHeader("To cite Rvision in publications use:") 2 | 3 | year <- sub("-.*", "", meta$Date) 4 | note <- sprintf("R package version %s", meta$Version) 5 | 6 | citEntry( 7 | entry = "Manual", 8 | title = "{Rvision} - A computer vision library for R", 9 | author = "Simon Garnier and John Muschelli", 10 | journal = "", 11 | year = year, 12 | volume = "", 13 | number = "", 14 | pages = "", 15 | note = note, 16 | url = "https://swarm-lab.github.io/Rvision/", 17 | textVersion = paste0( 18 | "Simon Garnier and John Muschelli (", year, "). Rvision - A computer vision library for R. ", note, "." 19 | ) 20 | ) 21 | -------------------------------------------------------------------------------- /inst/sample_img/balloon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/inst/sample_img/balloon1.png -------------------------------------------------------------------------------- /inst/sample_img/balloon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/inst/sample_img/balloon2.png -------------------------------------------------------------------------------- /inst/sample_img/checkerboard6x9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/inst/sample_img/checkerboard6x9.png -------------------------------------------------------------------------------- /inst/sample_img/dots.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/inst/sample_img/dots.jpg -------------------------------------------------------------------------------- /inst/sample_img/multipage.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/inst/sample_img/multipage.tif -------------------------------------------------------------------------------- /inst/sample_vid/Balloon.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/inst/sample_vid/Balloon.mp4 -------------------------------------------------------------------------------- /inst/sample_vid/calibration.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/inst/sample_vid/calibration.mp4 -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/logo.png -------------------------------------------------------------------------------- /man/LUT.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/transform.R 3 | \name{LUT} 4 | \alias{LUT} 5 | \title{Look-up Table Transform} 6 | \usage{ 7 | LUT(image, lut, target = "new") 8 | } 9 | \arguments{ 10 | \item{image}{An 8-bit (8U) \code{\link{Image}} object.} 11 | 12 | \item{lut}{A look-up table. This should be a vector with 256 elements, or a 13 | \code{256 x n} matrix, with n corresponding to the number of channels in 14 | \code{image}. If \code{lut} is a vector and \code{image} has more than one 15 | channel, then \code{lut} is recycled for each channel.} 16 | 17 | \item{target}{The location where the results should be stored. It can take 3 18 | values: 19 | \describe{ 20 | \item{"new":}{a new \code{\link{Image}} object is created and the results 21 | are stored inside (the default).} 22 | \item{"self":}{the results are stored back into \code{image} (faster but 23 | destructive).} 24 | \item{An \code{\link{Image}} object:}{the results are stored in another 25 | existing \code{\link{Image}} object. This is fast and will not replace the 26 | content of \code{image} but will replace that of \code{target}. Note that 27 | if \code{target} does not have the same dimensions, number of channels, 28 | and bit depth as \code{image}, nothing will be stored.} 29 | }} 30 | } 31 | \value{ 32 | If \code{target="new"}, the function returns an \code{\link{Image}} 33 | object. If \code{target="self"}, the function returns nothing and modifies 34 | \code{image} in place. If \code{target} is an \code{\link{Image}} object, 35 | the function returns nothing and modifies that \code{\link{Image}} object in 36 | place. 37 | } 38 | \description{ 39 | \code{LUT} performs a look-up table transform of an 40 | \code{\link{Image}} object. 41 | } 42 | \examples{ 43 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 44 | high_contrast_lut <- 255 * pbeta(0:255 / 255, 4, 4) 45 | high_contrast_balloon <- LUT(balloon, high_contrast_lut) 46 | 47 | } 48 | \seealso{ 49 | \code{\link{Image}}, \code{\link{histmatch}} 50 | } 51 | \author{ 52 | Simon Garnier, \email{garnier@njit.edu} 53 | } 54 | -------------------------------------------------------------------------------- /man/Rvision.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Rvision-package.R 3 | \docType{package} 4 | \name{Rvision} 5 | \alias{Rvision-package} 6 | \alias{Rvision} 7 | \title{Rvision: Computer vision library for R} 8 | \description{ 9 | The \code{Rvision} package contains an OpenCV-based computer vision library 10 | providing methods to read and manipulate video and image files, as well as 11 | camera streams. 12 | } 13 | \details{ 14 | \tabular{ll}{ 15 | Package: \tab Rvision\cr 16 | Type: \tab Package\cr 17 | Version: \tab 0.8.0\cr 18 | Date: \tab 2024-01-31\cr 19 | License: \tab GPL-3\cr 20 | } 21 | } 22 | \references{ 23 | More about OpenCV at \url{http://opencv.org/}. 24 | } 25 | \seealso{ 26 | Useful links: 27 | \itemize{ 28 | \item \url{https://swarm-lab.github.io/Rvision/} 29 | \item \url{https://github.com/swarm-lab/Rvision} 30 | \item Report bugs at \url{https://github.com/swarm-lab/Rvision/issues} 31 | } 32 | 33 | } 34 | \author{ 35 | Simon Garnier 36 | 37 | John Muschelli 38 | 39 | Maintainer: Simon Garnier 40 | } 41 | -------------------------------------------------------------------------------- /man/RvisionAck.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ack.R 3 | \docType{data} 4 | \name{RvisionAck} 5 | \alias{RvisionAck} 6 | \title{Image and video samples} 7 | \description{ 8 | \code{\link{Rvision}} provides a few image and video samples for illustrating 9 | the examples of its different functions. Below are references to the original 10 | material from which these samples have been extracted. 11 | } 12 | \references{ 13 | \itemize{ 14 | \item{"Big Buck Bunny", © copyright 2008, Blender Foundation / 15 | \url{www.bigbuckbunny.org} - Distributed under the Creative Commons 16 | Attribution 3.0 license.} 17 | \item{EC Funded CAVIAR project/IST 2001 37540 - 18 | \url{http://homepages.inf.ed.ac.uk/rbf/CAVIAR/}} 19 | \item{Pixabay / \url{https://pixabay.com/en/dots-blue-background-fabric-313325/} 20 | - Distributed under the Creative Commons CC0 Public Domain license.} 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /man/VideoStack-class.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoStackClass.R 3 | \docType{class} 4 | \name{VideoStack-class} 5 | \alias{VideoStack-class} 6 | \alias{VideoStack} 7 | \title{An S4 Class Containing a Video Stack} 8 | \description{ 9 | A \code{VideoStack} object contains a stack of 10 | \code{\link{Video}} objects with similar dimensions and frame rate. 11 | } 12 | \section{Slots}{ 13 | 14 | \describe{ 15 | \item{\code{.Data}}{A list of \code{\link{Video}} objects.} 16 | 17 | \item{\code{nframes}}{A vector of the number of frames in each video of the stack.} 18 | }} 19 | 20 | \seealso{ 21 | \code{\link{Video}} 22 | } 23 | \author{ 24 | Simon Garnier, \email{garnier@njit.edu} 25 | } 26 | -------------------------------------------------------------------------------- /man/addWeighted.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/arithmetic.R 3 | \name{addWeighted} 4 | \alias{addWeighted} 5 | \title{Weighted Sum of Two Images} 6 | \usage{ 7 | addWeighted(e1, e2, weight = c(0.5, 0.5), target = "new") 8 | } 9 | \arguments{ 10 | \item{e1}{An \code{\link{Image}} object.} 11 | 12 | \item{e2}{An \code{\link{Image}} object.} 13 | 14 | \item{weight}{A 2-element vector of the respective weight of each image 15 | (default: c(0.5, 0.5)). If the two weights do not add up to 1, they will be 16 | rescaled accordingly.} 17 | 18 | \item{target}{The location where the results should be stored. It can take 3 19 | values: 20 | \describe{ 21 | \item{"new":}{a new \code{\link{Image}} object is created and the results 22 | are stored inside (the default).} 23 | \item{"self":}{the results are stored back into \code{e1} (faster but 24 | destructive).} 25 | \item{An \code{\link{Image}} object:}{the results are stored in another 26 | existing \code{\link{Image}} object. This is fast and will not replace the 27 | content of \code{e1} but will replace that of \code{target}. Note that 28 | if \code{target} does not have the same dimensions, number of channels, and 29 | bit depth as \code{e1}, nothing will be stored.} 30 | }} 31 | } 32 | \value{ 33 | If \code{target="new"}, the function returns an \code{\link{Image}} 34 | object. If \code{target="self"}, the function returns nothing and modifies 35 | \code{e1} in place. If \code{target} is an \code{\link{Image}} object, 36 | the function returns nothing and modifies that \code{\link{Image}} object in 37 | place. 38 | } 39 | \description{ 40 | This function computes the weighted sum of two 41 | \code{\link{Image}} objects. 42 | } 43 | \examples{ 44 | balloon1 <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 45 | balloon2 <- image(system.file("sample_img/balloon2.png", package = "Rvision")) 46 | balloon_weighted <- addWeighted(balloon1, balloon2) 47 | 48 | } 49 | \seealso{ 50 | \code{\link{Image}} 51 | } 52 | \author{ 53 | Simon Garnier, \email{garnier@njit.edu} 54 | } 55 | -------------------------------------------------------------------------------- /man/anisotropicDiffusion.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ximgproc.R 3 | \name{anisotropicDiffusion} 4 | \alias{anisotropicDiffusion} 5 | \title{Anisotropic Diffusion} 6 | \usage{ 7 | anisotropicDiffusion(image, alpha = 0.1, K = 1, n_iters = 1, target = "new") 8 | } 9 | \arguments{ 10 | \item{image}{An 8-bit (8U) 3-channel \code{\link{Image}} object.} 11 | 12 | \item{alpha}{The amount of time to step forward by on each iteration 13 | (normally, it's between 0 and 1; default: 0.1).} 14 | 15 | \item{K}{Sensitivity to the edges (default: 1).} 16 | 17 | \item{n_iters}{The number of diffusion iterations.} 18 | 19 | \item{target}{The location where the results should be stored. It can take 3 20 | values: 21 | \describe{ 22 | \item{"new":}{a new \code{\link{Image}} object is created and the results 23 | are stored inside (the default).} 24 | \item{"self":}{the results are stored back into \code{image} (faster but 25 | destructive).} 26 | \item{An \code{\link{Image}} object:}{the results are stored in another 27 | existing \code{\link{Image}} object. This is fast and will not replace the 28 | content of \code{image} but will replace that of \code{target}. Note that 29 | if \code{target} does not have the same dimensions, number of channels, and 30 | bit depth as \code{image}, an error may be thrown.} 31 | }} 32 | } 33 | \value{ 34 | If \code{target="new"}, the function returns an \code{\link{Image}} 35 | object. If \code{target="self"}, the function returns nothing and modifies 36 | \code{image} in place. If \code{target} is an \code{\link{Image}} object, 37 | the function returns nothing and modifies that \code{\link{Image}} object in 38 | place. 39 | } 40 | \description{ 41 | \code{anisotropicDiffusion} Perona-Malik anisotropic diffusion 42 | to an \code{\link{Image}} object. 43 | } 44 | \examples{ 45 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 46 | balloon_smooth <- anisotropicDiffusion(balloon) 47 | 48 | } 49 | \seealso{ 50 | \code{\link{Image}}, \code{\link{gaussianBlur}} 51 | } 52 | \author{ 53 | Simon Garnier, \email{garnier@njit.edu} 54 | } 55 | -------------------------------------------------------------------------------- /man/api.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoWriterClass.R 3 | \name{api} 4 | \alias{api} 5 | \title{API of a Video Writer} 6 | \usage{ 7 | api(x) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{\link{VideoWriter}} object.} 11 | } 12 | \value{ 13 | A character string corresponding to the API used by the 14 | \code{\link{VideoWriter}} object to write the video. 15 | } 16 | \description{ 17 | Retrieve the API of a \code{\link{VideoWriter}} object. 18 | } 19 | \examples{ 20 | \dontrun{ 21 | writer <- videoWriter("test.mp4", "H264", 25, 1080, 1920) 22 | api(writer) 23 | release(writer) 24 | } 25 | 26 | } 27 | \seealso{ 28 | \code{\link{VideoWriter}}, \code{\link{videoWriter}} 29 | } 30 | \author{ 31 | Simon Garnier, \email{garnier@njit.edu} 32 | } 33 | -------------------------------------------------------------------------------- /man/approxPolyDP.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shape.R 3 | \name{approxPolyDP} 4 | \alias{approxPolyDP} 5 | \title{Calculate a Contour Perimeter or a Curve Length} 6 | \usage{ 7 | approxPolyDP(curve, epsilon, closed = TRUE) 8 | } 9 | \arguments{ 10 | \item{curve}{An m x 2 matrix of 2D coordinates.} 11 | 12 | \item{epsilon}{A numeric specifying the approximation accuracy. This is the 13 | maximum distance between the original curve and its approximation.} 14 | 15 | \item{closed}{A logical indicating whether the curve is closed (perimeter) or 16 | not (default: TRUE).} 17 | } 18 | \value{ 19 | A matrix with two columns: 20 | \describe{ 21 | \item{"x": }{the x coordinates of the approximated curve.} 22 | \item{"y": }{the y coordinates of the approximated curve.} 23 | } 24 | } 25 | \description{ 26 | \code{approxPolyDP} approximates a curve or a polygon with 27 | another curve/polygon with less vertices so that the distance between them 28 | is less or equal to the specified precision. It uses the Douglas-Peucker 29 | algorithm. 30 | } 31 | \examples{ 32 | dots <- image(system.file("sample_img/dots.jpg", package = "Rvision")) 33 | dots_gray <- changeColorSpace(dots, "GRAY") 34 | dots_bin <- dots_gray < 200 35 | contours <- findContours(dots_bin) 36 | ix <- contours$contours[, 1] == 0 37 | approxPolyDP(contours$contours[ix, 2:3], 10) 38 | 39 | } 40 | \references{ 41 | Douglas, D. H., & Peucker, T. K. (1973). ALGORITHMS FOR THE 42 | REDUCTION OF THE NUMBER OF POINTS REQUIRED TO REPRESENT A DIGITIZED LINE OR 43 | ITS CARICATURE. Cartographica: The International Journal for Geographic 44 | Information and Geovisualization, 10(2), 112–122. 45 | doi:10.3138/FM57-6770-U75U-7727 46 | } 47 | \seealso{ 48 | \code{\link{findContours}} 49 | } 50 | \author{ 51 | Simon Garnier, \email{garnier@njit.edu} 52 | } 53 | -------------------------------------------------------------------------------- /man/arcLength.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shape.R 3 | \name{arcLength} 4 | \alias{arcLength} 5 | \title{Calculate a Contour Perimeter or a Curve Length} 6 | \usage{ 7 | arcLength(curve, closed = TRUE) 8 | } 9 | \arguments{ 10 | \item{curve}{An m x 2 matrix of 2D coordinates.} 11 | 12 | \item{closed}{A boolean indicating whether the curve is closed (perimeter) or 13 | not (default: TRUE).} 14 | } 15 | \value{ 16 | A numerical value. 17 | } 18 | \description{ 19 | \code{arcLength} estimates a closed contour perimeter or a curve 20 | length from a set of 2D coordinates. 21 | } 22 | \examples{ 23 | dots <- image(system.file("sample_img/dots.jpg", package = "Rvision")) 24 | dots_gray <- changeColorSpace(dots, "GRAY") 25 | dots_bin <- dots_gray < 200 26 | contours <- findContours(dots_bin) 27 | ix <- contours$contours[, 1] == 0 28 | arcLength(contours$contours[ix, 2:3]) 29 | 30 | } 31 | \seealso{ 32 | \code{\link{findContours}} 33 | } 34 | \author{ 35 | Simon Garnier, \email{garnier@njit.edu} 36 | } 37 | -------------------------------------------------------------------------------- /man/as.array.Rcpp_Image.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{as.array.Rcpp_Image} 4 | \alias{as.array.Rcpp_Image} 5 | \alias{as.matrix.Rcpp_Image} 6 | \title{Convert Image to Array or Matrix} 7 | \usage{ 8 | \method{as.array}{Rcpp_Image}(x, ...) 9 | } 10 | \arguments{ 11 | \item{x}{An \code{\link{Image}} object.} 12 | 13 | \item{...}{Ignored.} 14 | } 15 | \value{ 16 | A matrix or array of the same dimensions as the \code{\link{Image}} 17 | object. 18 | } 19 | \description{ 20 | Attempts to turn its argument into a matrix or an array. 21 | } 22 | \examples{ 23 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 24 | balloon_mat <- as.matrix(balloon) 25 | 26 | } 27 | \seealso{ 28 | \code{\link{Image}}, \code{\link{matrix}}, \code{\link{array}} 29 | } 30 | \author{ 31 | Simon Garnier, \email{garnier@njit.edu} 32 | } 33 | -------------------------------------------------------------------------------- /man/bitdepth.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{bitdepth} 4 | \alias{bitdepth} 5 | \title{The Bit Depth of an Image} 6 | \usage{ 7 | bitdepth(x) 8 | } 9 | \arguments{ 10 | \item{x}{An \code{\link{Image}} object.} 11 | } 12 | \value{ 13 | A character string indicating the bit depth of the image. For now, it 14 | can only be one of the following: 15 | \describe{ 16 | \item{8U:}{an image with a bit depth of 8 unsigned bits.} 17 | \item{16U:}{an image with a bit depth of 16 unsigned bits.} 18 | } 19 | } 20 | \description{ 21 | This function returns the bit depth of an \code{\link{Image}} 22 | object, that is the number of bits of information used to encode each 23 | channel of each pixel in an image. 24 | } 25 | \examples{ 26 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 27 | bitdepth(balloon) 28 | 29 | } 30 | \seealso{ 31 | \code{\link{Image}}, \code{\link{colorspace}}. 32 | } 33 | \author{ 34 | Simon Garnier, \email{garnier@njit.edu} 35 | } 36 | -------------------------------------------------------------------------------- /man/boxFilter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/filters.R 3 | \name{boxFilter} 4 | \alias{boxFilter} 5 | \title{Blurs an Image Using a Box Filter} 6 | \usage{ 7 | boxFilter(image, k_height = 5, k_width = 5, target = "new", in_place = NULL) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{k_height}{The half-height in pixels of the kernel (default: 5).} 13 | 14 | \item{k_width}{The half-width in pixels of the kernel (default: 5).} 15 | 16 | \item{target}{The location where the results should be stored. It can take 3 17 | values: 18 | \describe{ 19 | \item{"new":}{a new \code{\link{Image}} object is created and the results 20 | are stored inside (the default).} 21 | \item{"self":}{the results are stored back into \code{image} (faster but 22 | destructive).} 23 | \item{An \code{\link{Image}} object:}{the results are stored in another 24 | existing \code{\link{Image}} object. This is fast and will not replace the 25 | content of \code{image} but will replace that of \code{target}. Note that 26 | if \code{target} does not have the same dimensions, number of channels, and 27 | bit depth as \code{image}, an error may be thrown.} 28 | }} 29 | 30 | \item{in_place}{Deprecated. Use \code{target} instead.} 31 | } 32 | \value{ 33 | If \code{target="new"}, the function returns an \code{\link{Image}} 34 | object. If \code{target="self"}, the function returns nothing and modifies 35 | \code{image} in place. If \code{target} is an \code{\link{Image}} object, 36 | the function returns nothing and modifies that \code{\link{Image}} object in 37 | place. 38 | } 39 | \description{ 40 | \code{boxFilter} convolves the source image with the 41 | specified box kernel (a matrix of 1s). The result is a blurred version of 42 | the source image. 43 | } 44 | \examples{ 45 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 46 | balloon_blur <- boxFilter(balloon, 11, 11) 47 | 48 | } 49 | \seealso{ 50 | \code{\link{Image}}, \code{\link{blur}}, \code{\link{gaussianBlur}} 51 | } 52 | \author{ 53 | Simon Garnier, \email{garnier@njit.edu} 54 | } 55 | -------------------------------------------------------------------------------- /man/boxPoints.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shape.R 3 | \name{boxPoints} 4 | \alias{boxPoints} 5 | \title{Find Vertices of a Rotated Rectangle} 6 | \usage{ 7 | boxPoints(rect) 8 | } 9 | \arguments{ 10 | \item{rect}{A list describing a rotated rectangle as created by 11 | \code{\link{minAreaRect}} and \code{\link{fitEllipse}}.} 12 | } 13 | \value{ 14 | A matrix containing the coordinates of the four vertices of the 15 | rotated rectangle in the following order: bottom left, top left, top right, 16 | and bottom right. 17 | } 18 | \description{ 19 | \code{boxPoints} finds the four vertices of a rotated rectangle 20 | computed by \code{\link{minAreaRect}} or \code{\link{fitEllipse}}. 21 | } 22 | \examples{ 23 | rect <- minAreaRect(rnorm(100), rnorm(100)) 24 | boxPoints(rect) 25 | 26 | } 27 | \seealso{ 28 | \code{\link{minAreaRect}}, \code{\link{fitEllipse}} 29 | } 30 | \author{ 31 | Simon Garnier, \email{garnier@njit.edu} 32 | } 33 | -------------------------------------------------------------------------------- /man/canny.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/feature.R 3 | \name{canny} 4 | \alias{canny} 5 | \title{Canny Edge Detector} 6 | \usage{ 7 | canny( 8 | image, 9 | threshold1, 10 | threshold2, 11 | aperture_size = 3, 12 | L2_gradient = FALSE, 13 | target = "new" 14 | ) 15 | } 16 | \arguments{ 17 | \item{image}{An \code{\link{Image}} object.} 18 | 19 | \item{threshold1}{A numeric indicating the first threshold for the hysteresis 20 | procedure} 21 | 22 | \item{threshold2}{A numeric indicating the second threshold for the hysteresis 23 | procedure} 24 | 25 | \item{aperture_size}{Aperture size for the Sobel operator (default: 3).} 26 | 27 | \item{L2_gradient}{A logical flag, indicating whether a more accurate L2 norm 28 | should be used to calculate the image gradient magnitude, or whether the 29 | default L1 norm is enough (default: FALSE).} 30 | 31 | \item{target}{The location where the results should be stored. It can take 3 32 | values: 33 | \describe{ 34 | \item{"new":}{a new \code{\link{Image}} object is created and the results 35 | are stored inside (the default).} 36 | \item{An \code{\link{Image}} object:}{the results are stored in another 37 | existing \code{\link{Image}} object. Note that \code{target} has to be an 38 | 8-bit ("8U") single-channel image with the same dimensions as \code{image}, 39 | otherwise an error will be thrown.} 40 | }} 41 | } 42 | \value{ 43 | If \code{target="new"}, the function returns an \code{\link{Image}} 44 | object. If \code{target} is an \code{\link{Image}} object, the function 45 | returns nothing and modifies that \code{\link{Image}} object in place. 46 | } 47 | \description{ 48 | \code{canny} finds edges in an image using the Canny algorithm. 49 | } 50 | \examples{ 51 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 52 | balloon_canny <- canny(balloon, 50, 50) 53 | 54 | } 55 | \references{ 56 | Canny J. A computational approach to edge detection. IEEE Trans 57 | Pattern Anal Mach Intell. 1986;8: 679–698. doi:10.1109/TPAMI.1986.4767851 58 | } 59 | \author{ 60 | Simon Garnier, \email{garnier@njit.edu} 61 | } 62 | -------------------------------------------------------------------------------- /man/capacity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/QueueClass.R 3 | \name{capacity} 4 | \alias{capacity} 5 | \title{Capacity of a Queue} 6 | \usage{ 7 | capacity(x) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{\link{Queue}} object.} 11 | } 12 | \value{ 13 | A numeric value. 14 | } 15 | \description{ 16 | \code{capacity} returns the maximum number of elements that a 17 | \code{\link{Queue}} object can contain. 18 | } 19 | \examples{ 20 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 21 | buf <- queue(balloon) 22 | capacity(buf) 23 | 24 | } 25 | \seealso{ 26 | \code{\link{Queue}}, \code{\link{queue}} 27 | } 28 | \author{ 29 | Simon Garnier, \email{garnier@njit.edu} 30 | } 31 | -------------------------------------------------------------------------------- /man/cc_table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conversions.R 3 | \docType{data} 4 | \name{cc_table} 5 | \alias{cc_table} 6 | \title{Table of Color Space Conversions} 7 | \format{ 8 | An object of class \code{"data.frame"}. 9 | } 10 | \usage{ 11 | data(cc_table) 12 | } 13 | \description{ 14 | A data frame containing all the possible color space conversions 15 | that can be done with \code{\link{changeColorSpace}}. 16 | } 17 | \examples{ 18 | data(cc_table) 19 | cc_table 20 | 21 | } 22 | \seealso{ 23 | \code{\link{Image}}, \code{\link{changeColorSpace}} 24 | } 25 | \keyword{datasets} 26 | -------------------------------------------------------------------------------- /man/changeColorSpace.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conversions.R 3 | \name{changeColorSpace} 4 | \alias{changeColorSpace} 5 | \title{Convert Image to New Color Space} 6 | \usage{ 7 | changeColorSpace(image, colorspace, target = "new", in_place = NULL) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{colorspace}{A string corresponding to the color space the image should 13 | be converted to. Not all conversions between color spaces are possible. All 14 | available color space conversions can be found in \code{\link{cc_table}}.} 15 | 16 | \item{target}{The location where the results should be stored. It can take 3 17 | values: 18 | \describe{ 19 | \item{"new":}{a new \code{\link{Image}} object is created and the results 20 | are stored inside (the default).} 21 | \item{"self":}{the results are stored back into \code{image} (faster but 22 | destructive).} 23 | \item{An \code{\link{Image}} object:}{the results are stored in another 24 | existing \code{\link{Image}} object. This is fast and will not replace the 25 | content of \code{image} but will replace that of \code{target}. Note that 26 | \code{target} must have the same dimensions as \code{image}.} 27 | }} 28 | 29 | \item{in_place}{Deprecated. Use \code{target} instead.} 30 | } 31 | \value{ 32 | If \code{target="new"}, the function returns an \code{\link{Image}} 33 | object. If \code{target="self"}, the function returns nothing and modifies 34 | \code{image} in place. If \code{target} is an \code{\link{Image}} object, 35 | the function returns nothing and modifies that \code{\link{Image}} object in 36 | place. 37 | } 38 | \description{ 39 | This function takes an \code{\link{Image}} object and converts 40 | it to another color space (e.g BGR to grayscale). 41 | } 42 | \examples{ 43 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 44 | grey_balloon <- changeColorSpace(balloon, "GRAY") 45 | 46 | } 47 | \seealso{ 48 | \code{\link{Image}}, \code{\link{changeBitDepth}} 49 | } 50 | \author{ 51 | Simon Garnier, \email{garnier@njit.edu} 52 | } 53 | -------------------------------------------------------------------------------- /man/click.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/display.R 3 | \name{click} 4 | \alias{click} 5 | \title{Detect Mouse Click on Image Display} 6 | \usage{ 7 | click(image, scale = 1, window_name = "Display") 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{scale}{The scaling of the display relative to the image size (default: 1).} 13 | 14 | \item{window_name}{A character string representing the name of the display 15 | window (default: "Display").} 16 | } 17 | \value{ 18 | A data frame with the following 3 columns: 19 | \describe{ 20 | \item{x: }{the x coordinate of the mouse click.} 21 | \item{y: }{the y coordinate of the mouse click.} 22 | \item{button: }{the mouse button that was pressed (0: left button; 1: right 23 | button.)} 24 | } 25 | } 26 | \description{ 27 | \code{click} display an image in a new or existing display 28 | window and waits for a mouse click on the display window to be detected. 29 | } 30 | \examples{ 31 | \dontrun{ 32 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 33 | click(balloon) 34 | } 35 | 36 | } 37 | \seealso{ 38 | \code{\link{Image}}, \code{\link{newDisplay}}, \code{\link{display}} 39 | } 40 | \author{ 41 | Simon Garnier, \email{garnier@njit.edu} 42 | } 43 | -------------------------------------------------------------------------------- /man/cloneImage.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{cloneImage} 4 | \alias{cloneImage} 5 | \title{Make a copy of an Image object} 6 | \usage{ 7 | cloneImage(x, target = "new") 8 | } 9 | \arguments{ 10 | \item{x}{An \code{\link{Image}} object.} 11 | 12 | \item{target}{The location where the results should be stored. It can take 2 13 | values: 14 | \describe{ 15 | \item{"new":}{a new \code{\link{Image}} object is created and the results 16 | are stored inside (the default).} 17 | \item{An \code{\link{Image}} object:}{the results are stored in another 18 | existing \code{\link{Image}} object. This is fast and will not replace the 19 | content of \code{image} but will replace that of \code{target}. Note that 20 | if \code{target} does not have the same dimensions, number of channels, 21 | and bit depth as \code{image}, an error may be thrown.} 22 | }} 23 | } 24 | \value{ 25 | An \code{\link{Image}} object. 26 | } 27 | \description{ 28 | \code{\link{Image}} objects are pointers toward C++ objects 29 | stored in memory. When copying an \code{\link{Image}} object using an 30 | assignment operator, this creates a copy of the pointer, but not a copy of 31 | the C++ object. Any operation on the copied \code{\link{Image}} object will 32 | therefore result in a modification of the orginal \code{\link{Image}} object. 33 | This function duplicates the original \code{\link{Image}} object instead, 34 | allowing safe operations on it while maintaining the integrity of the 35 | original \code{\link{Image}} object. 36 | } 37 | \examples{ 38 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 39 | balloon_clone <- cloneImage(balloon) 40 | 41 | } 42 | \seealso{ 43 | \code{\link{Image}} 44 | } 45 | \author{ 46 | Simon Garnier, \email{garnier@njit.edu} 47 | } 48 | -------------------------------------------------------------------------------- /man/codec.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoClass.R, R/VideoStackClass.R, 3 | % R/VideoWriterClass.R, R/generic.R 4 | \name{codec.Rcpp_Video} 5 | \alias{codec.Rcpp_Video} 6 | \alias{codec.VideoStack} 7 | \alias{codec.Rcpp_VideoWriter} 8 | \alias{codec} 9 | \title{Codec of a Video} 10 | \usage{ 11 | \method{codec}{Rcpp_Video}(x) 12 | 13 | \method{codec}{VideoStack}(x) 14 | 15 | \method{codec}{Rcpp_VideoWriter}(x) 16 | 17 | codec(x) 18 | } 19 | \arguments{ 20 | \item{x}{A \code{\link{Video}}, \code{\link{VideoStack}}, or 21 | \code{\link{VideoWriter}} object.} 22 | } 23 | \value{ 24 | A character string corresponding to the 25 | \href{https://www.fourcc.org/codecs.php}{FOURCC} code of the codec. 26 | } 27 | \description{ 28 | Retrieve the codec of a \code{\link{Video}}, 29 | \code{\link{VideoStack}}, or \code{\link{VideoWriter}} object. 30 | } 31 | \examples{ 32 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 33 | codec(balloon) 34 | 35 | } 36 | \seealso{ 37 | \code{\link{Video}}, \code{\link{VideoStack}}, 38 | \code{\link{VideoWriter}}, \code{\link{videoWriter}} 39 | } 40 | \author{ 41 | Simon Garnier, \email{garnier@njit.edu} 42 | } 43 | -------------------------------------------------------------------------------- /man/col2bgr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{col2bgr} 4 | \alias{col2bgr} 5 | \title{Color to BGR Conversion} 6 | \usage{ 7 | col2bgr(col, alpha = FALSE) 8 | } 9 | \arguments{ 10 | \item{col}{Vector of any of the three kinds of R color specifications, i.e., 11 | either a color name (as listed by \code{\link{colors}}()), a hexadecimal 12 | string of the form "\code{#rrggbb}" or "\code{#rrggbbaa}" (see \code{\link{rgb}}), 13 | or a positive integer \code{i} meaning \code{\link{palette}()[i]}.} 14 | 15 | \item{alpha}{Logical value indicating whether the alpha channel (opacity) 16 | values should be returned.} 17 | } 18 | \value{ 19 | An integer matrix with three or four (for \code{alpha = TRUE}) rows 20 | and number of columns the length of \code{col}. If col has names these are 21 | used as the column names of the return value. 22 | } 23 | \description{ 24 | R color to BRG (blue/green/red) conversion. 25 | } 26 | \details{ 27 | \code{\link{NA}} (as integer or character) and "NA" mean transparent. 28 | 29 | Values of \code{col} not of one of these types are coerced: real vectors are 30 | coerced to integer and other types to character. (factors are coerced to 31 | character: in all other cases the class is ignored when doing the coercion.) 32 | 33 | Zero and negative values of \code{col} are an error. 34 | } 35 | \examples{ 36 | col2bgr("red") 37 | col2bgr(1:10) 38 | 39 | } 40 | \seealso{ 41 | \code{\link{col2rgb}}, \code{\link{rgb}}, \code{\link{palette}} 42 | } 43 | \author{ 44 | Simon Garnier, \email{garnier@njit.edu} 45 | } 46 | -------------------------------------------------------------------------------- /man/colorspace.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{colorspace} 4 | \alias{colorspace} 5 | \title{The Color Space of an Image} 6 | \usage{ 7 | colorspace(x) 8 | } 9 | \arguments{ 10 | \item{x}{An \code{\link{Image}} object.} 11 | } 12 | \value{ 13 | A character string indicating the color space of the image. For now, 14 | it can only be one of the following: 15 | \describe{ 16 | \item{BGR:}{an image with 3 channels, Blue, Green, and Red.} 17 | \item{BGRA:}{an image with 3 channels, Blue, Green, Red, and Alpha 18 | (transparency).} 19 | \item{GRAY:}{a grayscale image (1 channel only).} 20 | } 21 | } 22 | \description{ 23 | This function returns the color space of an \code{\link{Image}} 24 | object, that is the range of colors of an image. 25 | } 26 | \examples{ 27 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 28 | colorspace(balloon) 29 | 30 | } 31 | \seealso{ 32 | \code{\link{Image}}, \code{\link{bitdepth}}. 33 | } 34 | \author{ 35 | Simon Garnier, \email{garnier@njit.edu} 36 | } 37 | -------------------------------------------------------------------------------- /man/computeECC.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/transform.R 3 | \name{computeECC} 4 | \alias{computeECC} 5 | \title{Enhanced Correlation Coefficient Value} 6 | \usage{ 7 | computeECC(template, image, mask = NULL) 8 | } 9 | \arguments{ 10 | \item{template}{A grayscale \code{\link{Image}} object.} 11 | 12 | \item{image}{A grayscale \code{\link{Image}} object of the same dimensions as 13 | \code{template}.} 14 | 15 | \item{mask}{A binary \code{\link{Image}} object of the same dimensions as 16 | \code{template}. Only the pixels of \code{image} where \code{mask} is 17 | nonzero are used in the computation. If \code{NULL}, all pixels are used.} 18 | } 19 | \value{ 20 | A numerical value. 21 | } 22 | \description{ 23 | \code{computeECC} computes the Enhanced Correlation Coefficient 24 | (ECC) value between two images. 25 | } 26 | \examples{ 27 | file1 <- system.file("sample_img/balloon1.png", package = "Rvision") 28 | file2 <- system.file("sample_img/balloon2.png", package = "Rvision") 29 | balloon1 <- changeColorSpace(image(file1), "GRAY") 30 | balloon2 <- changeColorSpace(image(file2), "GRAY") 31 | computeECC(balloon1, balloon2) 32 | 33 | } 34 | \references{ 35 | Evangelidis, G. D., and Psarakis, E. Z. (2008). Parametric image 36 | alignment using enhanced correlation coefficient maximization. IEEE Trans. 37 | Pattern Anal. Mach. Intell. 30, 1858–1865. doi:10.1109/TPAMI.2008.113. 38 | } 39 | \seealso{ 40 | \code{\link{findTransformECC}} 41 | } 42 | \author{ 43 | Simon Garnier, \email{garnier@njit.edu} 44 | } 45 | -------------------------------------------------------------------------------- /man/contourArea.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shape.R 3 | \name{contourArea} 4 | \alias{contourArea} 5 | \title{Area of a Contour} 6 | \usage{ 7 | contourArea(x, y, oriented = FALSE) 8 | } 9 | \arguments{ 10 | \item{x}{A vector of the x coordinates of the contour vertices.} 11 | 12 | \item{y}{A vector of the y coordinates of the contour vertices.} 13 | 14 | \item{oriented}{A boolean indicating whether to return the oriented area of 15 | the contour or not (default: FALSE).} 16 | } 17 | \value{ 18 | If `oriented = FALSE`, the function return the area in pixels enclosed 19 | within the contour. If `oriented = TRUE`, the function returns a signed area 20 | value depending on the contour orientation (clockwise or counter-clokwise). 21 | Using this feature, you can determine the orientation of a contour by taking 22 | the sign of the area. 23 | } 24 | \description{ 25 | \code{polyArea} computes the surface area of a polygon. 26 | } 27 | \note{ 28 | The function will certainly return a wrong result for contours with 29 | self-intersections. 30 | } 31 | \examples{ 32 | contourArea(c(0, 1, 1, 0), c(0, 0, 1, 1)) 33 | 34 | } 35 | \author{ 36 | Simon Garnier, \email{garnier@njit.edu} 37 | } 38 | -------------------------------------------------------------------------------- /man/convexHull.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shape.R 3 | \name{convexHull} 4 | \alias{convexHull} 5 | \title{Compute the Convex Hull of a Set of Points} 6 | \usage{ 7 | convexHull(x, y, clockwise = TRUE) 8 | } 9 | \arguments{ 10 | \item{x}{A vector of x coordinates.} 11 | 12 | \item{y}{A vector of y coordinates of the same lenght as \code{x}.} 13 | 14 | \item{clockwise}{If TRUE (the default), the output convex hull is oriented 15 | clockwise. Otherwise, it is oriented counter-clockwise.} 16 | } 17 | \value{ 18 | A vector indicating the index of the points on the convex hull. 19 | } 20 | \description{ 21 | \code{convexHull} computes the subset of points which lie on the 22 | convex hull of the set of points specified. 23 | } 24 | \examples{ 25 | convexHull(rnorm(100), rnorm(100)) 26 | 27 | } 28 | \author{ 29 | Simon Garnier, \email{garnier@njit.edu} 30 | } 31 | -------------------------------------------------------------------------------- /man/convexityDefects.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shape.R 3 | \name{convexityDefects} 4 | \alias{convexityDefects} 5 | \title{Find the Convexity Defects of a Polygon} 6 | \usage{ 7 | convexityDefects(x) 8 | } 9 | \arguments{ 10 | \item{x}{A Nx2 matrix of the X-Y coordinates of a polygon (e.g., a contour 11 | produced by \code{\link{findContours}})} 12 | } 13 | \value{ 14 | A matrix with 4 columns: 15 | \describe{ 16 | \item{"start_index": }{index of the first point of the contour belonging to 17 | a convexity defect.} 18 | \item{"end_index": }{index of the last point of the contour belonging to 19 | a convexity defect.} 20 | \item{"farthest_pt_index": }{index of the point of the contour belonging to 21 | a convexity defect and that is the farthest away from the convex hull.} 22 | \item{"fixpt_depth": }{distance between the farthest contour point and the 23 | convex hull.} 24 | } 25 | } 26 | \description{ 27 | \code{convexityDefects} finds the convexity defects of a polygon, 28 | that is the area that do not belong to an object but are located inside of 29 | its convex hull. 30 | } 31 | \examples{ 32 | dots <- image(system.file("sample_img/dots.jpg", package = "Rvision")) 33 | dots_gray <- changeColorSpace(dots, "GRAY") 34 | dots_bin <- dots_gray < 200 35 | contours <- findContours(dots_bin) 36 | contour0 <- contours$contours[contours$contours[, 1] == 0, 2:3] 37 | convexityDefects(contour0) 38 | 39 | } 40 | \seealso{ 41 | \code{\link{findContours}}, \code{\link{convexHull}} 42 | } 43 | \author{ 44 | Simon Garnier, \email{garnier@njit.edu} 45 | } 46 | -------------------------------------------------------------------------------- /man/countNonZero.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statistics.R 3 | \name{countNonZero} 4 | \alias{countNonZero} 5 | \title{Count Non-Zero Pixels} 6 | \usage{ 7 | countNonZero(image) 8 | } 9 | \arguments{ 10 | \item{image}{A single-channel \code{\link{Image}} object.} 11 | } 12 | \value{ 13 | An integer. 14 | } 15 | \description{ 16 | \code{countNonZero} returns the number of non-zero pixels in an 17 | \code{\link{Image}} object. 18 | } 19 | \examples{ 20 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 21 | changeColorSpace(balloon, "GRAY", "self") 22 | countNonZero(balloon > 100) 23 | 24 | } 25 | \seealso{ 26 | \code{\link{Image}} 27 | } 28 | \author{ 29 | Simon Garnier, \email{garnier@njit.edu} 30 | } 31 | -------------------------------------------------------------------------------- /man/destroyDisplay.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/display.R 3 | \name{destroyDisplay} 4 | \alias{destroyDisplay} 5 | \alias{destroyAllDisplays} 6 | \title{Destroy \code{\link{Image}} Display} 7 | \usage{ 8 | destroyDisplay(window_name) 9 | destroyAllDisplays() 10 | } 11 | \arguments{ 12 | \item{window_name}{A character string representing the name of the display 13 | window (default: "Display").} 14 | } 15 | \value{ 16 | This function does not return anything. 17 | } 18 | \description{ 19 | \code{destroyDisplay} closes a specific existing 20 | \code{\link{Image}} display window. \code{destroyAllDisplays} all existing 21 | \code{\link{Image}} display window. 22 | } 23 | \examples{ 24 | \dontrun{ 25 | newDisplay("Test display") 26 | destroyDisplay("Test display") 27 | destroyAllDisplays() 28 | } 29 | } 30 | \seealso{ 31 | \code{\link{Image}}, \code{\link{newDisplay}}, \code{\link{display}} 32 | } 33 | \author{ 34 | Simon Garnier, \email{garnier@njit.edu} 35 | } 36 | -------------------------------------------------------------------------------- /man/dim.Rcpp_Image.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{dim.Rcpp_Image} 4 | \alias{dim.Rcpp_Image} 5 | \title{Dimensions of an Image} 6 | \usage{ 7 | \method{dim}{Rcpp_Image}(x) 8 | } 9 | \arguments{ 10 | \item{x}{An \code{\link{Image}} object.} 11 | } 12 | \value{ 13 | A vector with 3 values corresponding to the number of rows, columns 14 | and channels of the image (in this order). 15 | } 16 | \description{ 17 | Retrieve the dimensions an \code{\link{Image}} object. 18 | } 19 | \examples{ 20 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 21 | dim(balloon) 22 | 23 | } 24 | \seealso{ 25 | \code{\link{Image}}, \code{\link{image}} 26 | } 27 | \author{ 28 | Simon Garnier, \email{garnier@njit.edu} 29 | } 30 | -------------------------------------------------------------------------------- /man/dim.Rcpp_Queue.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/QueueClass.R 3 | \name{dim.Rcpp_Queue} 4 | \alias{dim.Rcpp_Queue} 5 | \title{Dimensions of a Queue} 6 | \usage{ 7 | \method{dim}{Rcpp_Queue}(x) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{\link{Queue}} object.} 11 | } 12 | \value{ 13 | A vector with 3 values corresponding to the number of rows, columns 14 | and length of the queue (in this order). 15 | } 16 | \description{ 17 | Retrieve the dimensions a \code{\link{Queue}} object. 18 | } 19 | \examples{ 20 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 21 | buf <- queue(balloon) 22 | dim(buf) 23 | 24 | } 25 | \seealso{ 26 | \code{\link{Queue}}, \code{\link{queue}} 27 | } 28 | \author{ 29 | Simon Garnier, \email{garnier@njit.edu} 30 | } 31 | -------------------------------------------------------------------------------- /man/dim.Rcpp_Stream.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/StreamClass.R 3 | \name{dim.Rcpp_Stream} 4 | \alias{dim.Rcpp_Stream} 5 | \title{Dimensions of a Stream} 6 | \usage{ 7 | \method{dim}{Rcpp_Stream}(x) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{\link{Stream}} object.} 11 | } 12 | \value{ 13 | A vector with 2 values corresponding to the number of rows and columns 14 | of the stream (in this order). 15 | } 16 | \description{ 17 | Retrieve the dimensions a \code{\link{Stream}} object. 18 | } 19 | \examples{ 20 | \dontrun{ 21 | live <- stream(0) 22 | sim(live) 23 | release(live) 24 | } 25 | 26 | } 27 | \seealso{ 28 | \code{\link{Stream}}, \code{\link{stream}} 29 | } 30 | \author{ 31 | Simon Garnier, \email{garnier@njit.edu} 32 | } 33 | -------------------------------------------------------------------------------- /man/dim.Rcpp_Video.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoClass.R 3 | \name{dim.Rcpp_Video} 4 | \alias{dim.Rcpp_Video} 5 | \title{Dimensions of a Video} 6 | \usage{ 7 | \method{dim}{Rcpp_Video}(x) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{\link{Video}} object.} 11 | } 12 | \value{ 13 | A vector with 3 values corresponding to the number of rows, columns 14 | and frames of the video (in this order). 15 | } 16 | \description{ 17 | Retrieve the dimensions a \code{\link{Video}} object. 18 | } 19 | \examples{ 20 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 21 | dim(balloon) 22 | 23 | } 24 | \seealso{ 25 | \code{\link{Video}}, \code{\link{video}} 26 | } 27 | \author{ 28 | Simon Garnier, \email{garnier@njit.edu} 29 | } 30 | -------------------------------------------------------------------------------- /man/dim.Rcpp_VideoWriter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoWriterClass.R 3 | \name{dim.Rcpp_VideoWriter} 4 | \alias{dim.Rcpp_VideoWriter} 5 | \title{Dimensions of a Video Writer} 6 | \usage{ 7 | \method{dim}{Rcpp_VideoWriter}(x) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{\link{VideoWriter}} object.} 11 | } 12 | \value{ 13 | A vector with 2 values corresponding to the number of rows and columns 14 | of the video writer (in this order). 15 | } 16 | \description{ 17 | Retrieve the dimensions a \code{\link{VideoWriter}} object. 18 | } 19 | \examples{ 20 | \dontrun{ 21 | writer <- videoWriter("test.mp4", "H264", 25, 1080, 1920) 22 | dim(writer) 23 | release(writer) 24 | } 25 | 26 | } 27 | \seealso{ 28 | \code{\link{VideoWriter}}, \code{\link{videoWriter}} 29 | } 30 | \author{ 31 | Simon Garnier, \email{garnier@njit.edu} 32 | } 33 | -------------------------------------------------------------------------------- /man/dim.VideoStack.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoStackClass.R 3 | \name{dim.VideoStack} 4 | \alias{dim.VideoStack} 5 | \title{Dimensions of a VideoStack} 6 | \usage{ 7 | \method{dim}{VideoStack}(x) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{\link{VideoStack}} object.} 11 | } 12 | \value{ 13 | A vector with 3 values corresponding to the number of rows, columns 14 | and frames of the video stack (in this order). 15 | } 16 | \description{ 17 | Retrieve the dimensions a \code{\link{VideoStack}} object. 18 | } 19 | \examples{ 20 | path <- system.file("sample_vid/Balloon.mp4", package = "Rvision") 21 | balloonStack <- videoStack(path, path) 22 | dim(balloonStack) 23 | 24 | } 25 | \seealso{ 26 | \code{\link{VideoStack}}, \code{\link{videoStack}} 27 | } 28 | \author{ 29 | Simon Garnier, \email{garnier@njit.edu} 30 | } 31 | -------------------------------------------------------------------------------- /man/drawArrow.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/draw.R 3 | \name{drawArrow} 4 | \alias{drawArrow} 5 | \title{Draw Arrows on an \code{\link{Image}}} 6 | \usage{ 7 | drawArrow( 8 | image, 9 | pt1_x, 10 | pt1_y, 11 | pt2_x, 12 | pt2_y, 13 | tip_length = 0.1, 14 | color = "red", 15 | thickness = 1 16 | ) 17 | } 18 | \arguments{ 19 | \item{image}{An \code{\link{Image}} object.} 20 | 21 | \item{pt1_x}{A numeric value or vector representing the x coordinates of the 22 | first end of each arrow.} 23 | 24 | \item{pt1_y}{A numeric value or vector representing the y coordinates of the 25 | first end of each arrow.} 26 | 27 | \item{pt2_x}{A numeric value or vector representing the x coordinates of the 28 | second end of each arrow.} 29 | 30 | \item{pt2_y}{A numeric value or vector representing the y coordinates of the 31 | second end of each arrow.} 32 | 33 | \item{tip_length}{A numeric value or vector representing the length of each 34 | arrow's tip as a fraction of each arrow's length (default: 0.1).} 35 | 36 | \item{color}{A value or vector of any kind of R color specification compatible 37 | with \code{\link{col2bgr}} representing the color of each arrow (default: 38 | "red").} 39 | 40 | \item{thickness}{A numeric value or vector representing the thickness in 41 | pixels of each arrow (default: 1).} 42 | } 43 | \value{ 44 | This function does not return anything. It modifies \code{image} in 45 | place. 46 | } 47 | \description{ 48 | \code{drawArrow} draws arrow segments from the first point to 49 | the second over an \code{\link{Image}} object. This operation is destructive: 50 | it changes irreversibly the \code{\link{Image}} object and cannot be undone. 51 | } 52 | \examples{ 53 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 54 | drawArrow(balloon, 1, 1, ncol(balloon) / 2, nrow(balloon) / 2, thickness = 3) 55 | 56 | } 57 | \seealso{ 58 | \code{\link{Image}}, \code{\link{drawLine}} 59 | } 60 | \author{ 61 | Simon Garnier, \email{garnier@njit.edu} 62 | } 63 | -------------------------------------------------------------------------------- /man/drawCircle.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/draw.R 3 | \name{drawCircle} 4 | \alias{drawCircle} 5 | \title{Draw Circles on an \code{\link{Image}}} 6 | \usage{ 7 | drawCircle(image, x, y, radius, color = "red", thickness = 1) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{x}{A numeric value or vector representing the x coordinates of the 13 | centers of each circle.} 14 | 15 | \item{y}{A numeric value or vector representing the y coordinates of the 16 | centers of each circle.} 17 | 18 | \item{radius}{A numeric value or vector representing the radii of each circle.} 19 | 20 | \item{color}{A value or vector of any kind of R color specification compatible 21 | with \code{\link{col2bgr}} representing the color of each circle's outline 22 | (default: "red").} 23 | 24 | \item{thickness}{A numeric value or vector representing the thickness in 25 | pixels of each circle's outline (default: 1). If negative, then a filled 26 | rectangle is drawn.} 27 | } 28 | \value{ 29 | This function does not return anything. It modifies \code{image} in 30 | place. 31 | } 32 | \description{ 33 | \code{drawCirlc} draws circles over an \code{\link{Image}} 34 | object. This operation is destructive: it changes irreversibly the 35 | \code{\link{Image}} object and cannot be undone. 36 | } 37 | \examples{ 38 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 39 | drawCircle(balloon, 365, 245, 90, thickness = 3) 40 | 41 | } 42 | \seealso{ 43 | \code{\link{Image}}, \code{\link{drawEllipse}} 44 | } 45 | \author{ 46 | Simon Garnier, \email{garnier@njit.edu} 47 | } 48 | -------------------------------------------------------------------------------- /man/drawLine.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/draw.R 3 | \name{drawLine} 4 | \alias{drawLine} 5 | \title{Draw Lines on an \code{\link{Image}}} 6 | \usage{ 7 | drawLine(image, pt1_x, pt1_y, pt2_x, pt2_y, color = "red", thickness = 1) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{pt1_x}{A numeric value or vector representing the x coordinates of the 13 | first end of each line.} 14 | 15 | \item{pt1_y}{A numeric value or vector representing the y coordinates of the 16 | first end of each line.} 17 | 18 | \item{pt2_x}{A numeric value or vector representing the x coordinates of the 19 | second end of each line.} 20 | 21 | \item{pt2_y}{A numeric value or vector representing the y coordinates of the 22 | second end of each line.} 23 | 24 | \item{color}{A value or vector of any kind of R color specification compatible 25 | with \code{\link{col2bgr}} representing the color of each line (default: 26 | "red").} 27 | 28 | \item{thickness}{A numeric value or vector representing the thickness in 29 | pixels of each line (default: 1).} 30 | } 31 | \value{ 32 | This function does not return anything. It modifies \code{image} in 33 | place. 34 | } 35 | \description{ 36 | \code{drawLine} draws lines over an \code{\link{Image}} object. 37 | This operation is destructive: it changes irreversibly the \code{\link{Image}} 38 | object and cannot be undone. 39 | } 40 | \examples{ 41 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 42 | drawLine(balloon, 1, 1, ncol(balloon), nrow(balloon), thickness = 3) 43 | 44 | } 45 | \seealso{ 46 | \code{\link{Image}}, \code{\link{drawArrow}} 47 | } 48 | \author{ 49 | Simon Garnier, \email{garnier@njit.edu} 50 | } 51 | -------------------------------------------------------------------------------- /man/drawPolyline.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/draw.R 3 | \name{drawPolyline} 4 | \alias{drawPolyline} 5 | \title{Draw Polygonal Lines on an Image} 6 | \usage{ 7 | drawPolyline(image, line, closed = FALSE, color = "red", thickness = 1) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{line}{An m x 2 matrix (or an object that can be converted to an 13 | m x 2 matrix) or a list of m x 2 matrices, with the first column containing 14 | the x coordinates of the polygonal lines and the second column containing 15 | the y coordinates of the polygonal lines.} 16 | 17 | \item{closed}{A boolean indicating whether the drawn polylines are closed or 18 | not (default: FALSE). If they are closed, the function draws a line from the 19 | last vertex of each curve to its first vertex.} 20 | 21 | \item{color}{A value or vector of any kind of R color specification compatible 22 | with \code{\link{col2bgr}} representing the color to fill the polygon with 23 | (default: "white").} 24 | 25 | \item{thickness}{A numeric value representing the thickness in pixels of the 26 | line (default: 1).} 27 | } 28 | \value{ 29 | This function does not return anything. It modifies \code{image} in 30 | place. 31 | } 32 | \description{ 33 | \code{drawPolyline} draws polygonal lines over an 34 | \code{\link{Image}} object. This operation is destructive: it changes 35 | irreversibly the \code{\link{Image}} object and cannot be undone. 36 | } 37 | \examples{ 38 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 39 | poly <- data.frame(x = c(290, 290, 440, 440), y = c(170, 325, 325, 170)) 40 | drawPolyline(balloon, poly, closed = FALSE, color = "red", thickness = 3) 41 | 42 | } 43 | \seealso{ 44 | \code{\link{Image}}, \code{\link{selectROI}}, \code{\link{fillConvexPoly}} 45 | } 46 | \author{ 47 | Simon Garnier, \email{garnier@njit.edu} 48 | } 49 | -------------------------------------------------------------------------------- /man/drawRectangle.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/draw.R 3 | \name{drawRectangle} 4 | \alias{drawRectangle} 5 | \title{Draw Rectangles on an \code{\link{Image}}} 6 | \usage{ 7 | drawRectangle(image, pt1_x, pt1_y, pt2_x, pt2_y, color = "red", thickness = 1) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{pt1_x}{A numeric value or vector representing the x coordinates of a 13 | corner of each rectangle.} 14 | 15 | \item{pt1_y}{A numeric value or vector representing the y coordinates of a 16 | corner of each rectangle.} 17 | 18 | \item{pt2_x}{A numeric value or vector representing the x coordinates of the 19 | corners opposite to pt1.} 20 | 21 | \item{pt2_y}{A numeric value or vector representing the y coordinates of the 22 | corners opposite to pt1.} 23 | 24 | \item{color}{A value or vector of any kind of R color specification compatible 25 | with \code{\link{col2bgr}} representing the color of each rectangle's outline 26 | (default: "red").} 27 | 28 | \item{thickness}{A numeric value or vector representing the thickness in 29 | pixels of each rectangle's outline (default: 1). If negative, then a filled 30 | rectangle is drawn.} 31 | } 32 | \value{ 33 | This function does not return anything. It modifies \code{image} in 34 | place. 35 | } 36 | \description{ 37 | \code{drawRectangle} draws rectangles over an \code{\link{Image}} 38 | object. This operation is destructive: it changes irreversibly the 39 | \code{\link{Image}} object and cannot be undone. 40 | } 41 | \examples{ 42 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 43 | drawRectangle(balloon, 290, 170, 440, 325, thickness = 3) 44 | 45 | } 46 | \seealso{ 47 | \code{\link{Image}}, \code{\link{drawRotatedRectangle}} 48 | } 49 | \author{ 50 | Simon Garnier, \email{garnier@njit.edu} 51 | } 52 | -------------------------------------------------------------------------------- /man/drawRotatedRectangle.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/draw.R 3 | \name{drawRotatedRectangle} 4 | \alias{drawRotatedRectangle} 5 | \title{Draw Rotated Rectangles on an \code{\link{Image}}} 6 | \usage{ 7 | drawRotatedRectangle( 8 | image, 9 | x, 10 | y, 11 | axis1, 12 | axis2, 13 | angle, 14 | color = "red", 15 | thickness = 1 16 | ) 17 | } 18 | \arguments{ 19 | \item{image}{An \code{\link{Image}} object.} 20 | 21 | \item{x}{A numeric value or vector representing the x coordinates of the 22 | center of each rectangle.} 23 | 24 | \item{y}{A numeric value or vector representing the y coordinates of the 25 | center of each rectangle.} 26 | 27 | \item{axis1}{A numeric value or vector representing the length of the 28 | first axis of each rectangle.} 29 | 30 | \item{axis2}{A numeric value or vector representing the length of the 31 | second axis of each rectangle.} 32 | 33 | \item{angle}{A numeric value or vector representing the angle in degrees 34 | between \code{axis1} and the horizontal.} 35 | 36 | \item{color}{A value or vector of any kind of R color specification compatible 37 | with \code{\link{col2bgr}} representing the color of each rectangle's outline 38 | (default: "red").} 39 | 40 | \item{thickness}{A numeric value or vector representing the thickness in 41 | pixels of each rectangle's outline (default: 1). If negative, then a filled 42 | rectangle is drawn.} 43 | } 44 | \value{ 45 | This function does not return anything. It modifies \code{image} in 46 | place. 47 | } 48 | \description{ 49 | \code{drawRotatedRectangle} draws rotated rectangles over an 50 | \code{\link{Image}} object. This operation is destructive: it changes 51 | irreversibly the \code{\link{Image}} object and cannot be undone. 52 | } 53 | \examples{ 54 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 55 | drawRotatedRectangle(balloon, 290, 170, 440, 325, 60, thickness = 3) 56 | 57 | } 58 | \seealso{ 59 | \code{\link{Image}}, \code{\link{drawRectangle}}, \code{\link{drawEllipse}} 60 | } 61 | \author{ 62 | Simon Garnier, \email{garnier@njit.edu} 63 | } 64 | -------------------------------------------------------------------------------- /man/exp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/zzz.R 3 | \name{exp} 4 | \alias{exp} 5 | \title{Exponential Generic for Image objects} 6 | \usage{ 7 | exp(x, target = "new") 8 | } 9 | \arguments{ 10 | \item{x}{A 32- or 64-bit (32F or 64F) \code{\link{Image}} object.} 11 | 12 | \item{target}{The location where the results should be stored when passing a 13 | sum of images to the function. It can take 3 values: 14 | \describe{ 15 | \item{"new":}{a new \code{\link{Image}} object is created and the results 16 | are stored inside (the default).} 17 | \item{"self":}{the results are stored back into \code{x} (faster but 18 | destructive).} 19 | \item{An \code{\link{Image}} object:}{the results are stored in another 20 | existing \code{\link{Image}} object. This is fast but will replace the 21 | content of \code{target}. Note that \code{target} should have the same 22 | dimensions, bitdepth, and number of channels as \code{x}, otherwise an 23 | error will be thrown.} 24 | }} 25 | } 26 | \value{ 27 | If \code{target="new"}, the function returns an \code{\link{Image}} 28 | object. If \code{target="self"}, the function returns nothing and modifies 29 | \code{x} in place. If \code{target} is an \code{\link{Image}} object, the 30 | function returns nothing and modifies that \code{\link{Image}} object in 31 | place. 32 | } 33 | \description{ 34 | Overloaded \code{\link[base]{exp}} to handle \code{\link{Image}} 35 | objects. 36 | } 37 | \examples{ 38 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 39 | changeBitDepth(balloon, "32F", 1 / 255, "self") 40 | exp(balloon) 41 | 42 | } 43 | \seealso{ 44 | \code{\link{log}}, \code{\link{pow}}, \code{\link{sqrt}} 45 | } 46 | \author{ 47 | Simon Garnier, \email{garnier@njit.edu} 48 | } 49 | -------------------------------------------------------------------------------- /man/extractChannel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{extractChannel} 4 | \alias{extractChannel} 5 | \title{Extract Single Channel from Image} 6 | \usage{ 7 | extractChannel(image, channel, target = "new") 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{channel}{An integer specifying the index of the channel to extract.} 13 | 14 | \item{target}{The location where the results should be stored. It can take 2 15 | values: 16 | \describe{ 17 | \item{"new":}{a new \code{\link{Image}} object is created and the results 18 | are stored inside (the default).} 19 | \item{An \code{\link{Image}} object:}{the results are stored in another 20 | existing \code{\link{Image}} object. This is fast and will not replace the 21 | content of \code{image} but will replace that of \code{target}. Note that 22 | if \code{target} does not have the same dimensions and bit depth as 23 | \code{image}, an error may be thrown. \code{target} should also be a 24 | single-channel \code{\link{Image}} object or an error will be thrown.} 25 | }} 26 | } 27 | \value{ 28 | If \code{target="new"}, the function returns a single-channel 29 | \code{\link{Image}} object. If \code{target} is an \code{\link{Image}} 30 | object, the function returns nothing and modifies that \code{\link{Image}} 31 | object in place. 32 | } 33 | \description{ 34 | \code{extractChannel} extracts a single color channel from the 35 | source image. 36 | } 37 | \examples{ 38 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 39 | extractChannel(balloon, 2) 40 | 41 | } 42 | \seealso{ 43 | \code{\link{Image}}, \code{\link{split}}, \code{\link{merge}} 44 | } 45 | \author{ 46 | Simon Garnier, \email{garnier@njit.edu} 47 | } 48 | -------------------------------------------------------------------------------- /man/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/man/figures/logo.png -------------------------------------------------------------------------------- /man/figures/z8_comparison.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/man/figures/z8_comparison.png -------------------------------------------------------------------------------- /man/figures/z8_coverage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/man/figures/z8_coverage.png -------------------------------------------------------------------------------- /man/fillConvexPoly.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/draw.R 3 | \name{fillConvexPoly} 4 | \alias{fillConvexPoly} 5 | \title{Fill Convex Polygon with Color in Image} 6 | \usage{ 7 | fillConvexPoly(image, polygon, color = "white") 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{polygon}{An m x 2 matrix (or an object that can be converted to an 13 | m x 2 matrix), with the first column containing the x coordinates of the 14 | polygon and the second column containing the y coordinates of the polygon.} 15 | 16 | \item{color}{A value or vector of any kind of R color specification compatible 17 | with \code{\link{col2bgr}} representing the color to fill the polygon with 18 | (default: "white").} 19 | } 20 | \value{ 21 | This function does not return anything. It modifies \code{image} in 22 | place. 23 | } 24 | \description{ 25 | \code{fillConvexPoly} fills all the pixels of an image withing a 26 | given convex polygon with a given color. This function is much faster than 27 | the function \code{\link{fillPoly}}. It can fill not only convex polygons 28 | but any monotonic polygon without self-intersections, that is, a polygon 29 | whose contour intersects every horizontal line (scan line) twice at the most 30 | (though, its top-most and/or the bottom edge could be horizontal). 31 | } 32 | \examples{ 33 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 34 | poly <- data.frame(x = c(290, 290, 440, 440), y = c(170, 325, 325, 170)) 35 | fillConvexPoly(balloon, poly, color = "red") 36 | 37 | } 38 | \seealso{ 39 | \code{\link{Image}}, \code{\link{selectROI}}, \code{\link{fillPoly}} 40 | } 41 | \author{ 42 | Simon Garnier, \email{garnier@njit.edu} 43 | } 44 | -------------------------------------------------------------------------------- /man/fillPoly.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/draw.R 3 | \name{fillPoly} 4 | \alias{fillPoly} 5 | \title{Fill Polygon with Color in Image} 6 | \usage{ 7 | fillPoly(image, polygon, color = "white") 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{polygon}{An m x 2 matrix (or an object that can be converted to an 13 | m x 2 matrix) or a list of m x 2 matrices, with the first column containing 14 | the x coordinates of the polygons and the second column containing the y 15 | coordinates of the polygons.} 16 | 17 | \item{color}{A value or vector of any kind of R color specification compatible 18 | with \code{\link{col2bgr}} representing the color to fill the polygon with 19 | (default: "white").} 20 | } 21 | \value{ 22 | This function does not return anything. It modifies \code{image} in 23 | place. 24 | } 25 | \description{ 26 | \code{fillPoly} fills all the pixels of an image withing a 27 | given polygon with a given color. 28 | } 29 | \examples{ 30 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 31 | poly <- data.frame(x = c(290, 290, 440, 440), y = c(170, 325, 325, 170)) 32 | fillPoly(balloon, poly, color = "red") 33 | 34 | } 35 | \seealso{ 36 | \code{\link{Image}}, \code{\link{selectROI}}, \code{\link{fillConvexPoly}} 37 | } 38 | \author{ 39 | Simon Garnier, \email{garnier@njit.edu} 40 | } 41 | -------------------------------------------------------------------------------- /man/findNonZero.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/logical.R 3 | \name{findNonZero} 4 | \alias{findNonZero} 5 | \title{Find Non-Zero Pixels in an Image} 6 | \usage{ 7 | findNonZero(image, values = FALSE) 8 | } 9 | \arguments{ 10 | \item{image}{A single-channel \code{\link{Image}} object.} 11 | 12 | \item{values}{A logical indicating whether the values of the non-zero pixels 13 | should also be returned (default: FALSE).} 14 | } 15 | \value{ 16 | If \code{values=FALSE}, a matrix with two columns, corresponding to 17 | the x (columns) and y (rows) coordinates of the non-zero pixels. If 18 | \code{values=TRUE}, an additional column corresponding to the pixel values 19 | will also be returned. 20 | } 21 | \description{ 22 | \code{findNonZero} retrieves the locations of all non-zero 23 | pixels in an image. 24 | } 25 | \examples{ 26 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 27 | balloon_gray <- changeColorSpace(balloon, "GRAY") 28 | findNonZero(balloon_gray) 29 | 30 | } 31 | \seealso{ 32 | \code{\link{Image}} 33 | } 34 | \author{ 35 | Simon Garnier, \email{garnier@njit.edu} 36 | } 37 | -------------------------------------------------------------------------------- /man/fitEllipse.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shape.R 3 | \name{fitEllipse} 4 | \alias{fitEllipse} 5 | \title{Fit an Ellipse Around a Set of 2D Points} 6 | \usage{ 7 | fitEllipse(x, y, method = "original") 8 | } 9 | \arguments{ 10 | \item{x}{A vector of x coordinates.} 11 | 12 | \item{y}{A vector of y coordinates of the same lenght as \code{x}.} 13 | 14 | \item{method}{A character string indicating the method to use in order to fit 15 | the ellipse. It can take the following values: 16 | \describe{ 17 | \item{'original': }{least square.} 18 | \item{'ams': }{Approximate Mean Square (AMS) proposed in Taubin (1991).} 19 | \item{'direct': }{Direct least square method proposed in Fitzgibbon, Pilu, 20 | and Fisher (1999).} 21 | }} 22 | } 23 | \value{ 24 | A list containing the height and width (in pixels) of the ellipse, 25 | the angle (in degrees) of its main axis with respect to the vertical axis, 26 | and the x and y coordinates of its center. 27 | } 28 | \description{ 29 | \code{fitEllipse} calculates the ellipse that fits a set of 2D 30 | points. 31 | } 32 | \examples{ 33 | fitEllipse(rnorm(100), rnorm(100)) 34 | 35 | } 36 | \references{ 37 | Taubin G. Estimation of planar curves, surfaces, and nonplanar 38 | space curves defined by implicit equations with applications to edge and 39 | range image segmentation. IEEE Trans Pattern Anal Mach Intell. 1991;13: 40 | 1115–1138. doi:10.1109/34.103273 41 | 42 | Fitzgibbon A, Pilu M, Fisher RB. Direct least square fitting of 43 | ellipses. IEEE Trans Pattern Anal Mach Intell. 1999;21: 476–480. 44 | doi:10.1109/34.765658 45 | } 46 | \seealso{ 47 | \code{\link{minAreaRect}}, \code{\link{boxPoints}} 48 | } 49 | \author{ 50 | Simon Garnier, \email{garnier@njit.edu} 51 | } 52 | -------------------------------------------------------------------------------- /man/fourcc.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoWriterClass.R 3 | \name{fourcc} 4 | \alias{fourcc} 5 | \title{Codec Name to FOURCC Code} 6 | \usage{ 7 | fourcc(x) 8 | } 9 | \arguments{ 10 | \item{x}{A 4-element character chain corresponding to the name of a valid 11 | video codec. A list of valid codec names can be found at this archived 12 | page of the fourcc site \href{https://www.fourcc.org/codecs.php}{https://www.fourcc.org/codecs.php}.} 13 | } 14 | \value{ 15 | An integer value corresponding to the FOURCC code of the video codec. 16 | } 17 | \description{ 18 | \code{fourcc} translates the 4-character name of a video codec 19 | into its corresponding \href{https://www.fourcc.org/codecs.php}{FOURCC} code. 20 | } 21 | \examples{ 22 | fourcc("xvid") 23 | 24 | } 25 | \seealso{ 26 | \code{\link{VideoWriter}}, \code{\link{videoWriter}}, 27 | \code{\link{codec}}, \code{\link{invertFourcc}} 28 | } 29 | \author{ 30 | Simon Garnier, \email{garnier@njit.edu} 31 | } 32 | -------------------------------------------------------------------------------- /man/fps.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoClass.R, R/VideoStackClass.R, 3 | % R/VideoWriterClass.R, R/generic.R 4 | \name{fps.Rcpp_Video} 5 | \alias{fps.Rcpp_Video} 6 | \alias{fps.VideoStack} 7 | \alias{fps.Rcpp_VideoWriter} 8 | \alias{fps} 9 | \title{Frame Rate of a Video} 10 | \usage{ 11 | \method{fps}{Rcpp_Video}(x) 12 | 13 | \method{fps}{VideoStack}(x) 14 | 15 | \method{fps}{Rcpp_VideoWriter}(x) 16 | 17 | fps(x) 18 | } 19 | \arguments{ 20 | \item{x}{A \code{\link{Video}}, \code{\link{VideoStack}}, or 21 | \code{\link{VideoWriter}} object.} 22 | } 23 | \value{ 24 | A numeric value. 25 | } 26 | \description{ 27 | Retrieve the frame rate (in frames per second) of a 28 | \code{\link{Video}}, \code{\link{VideoStack}}, or \code{\link{VideoWriter}} 29 | object. 30 | } 31 | \examples{ 32 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 33 | fps(balloon) 34 | 35 | } 36 | \seealso{ 37 | \code{\link{Video}}, \code{\link{VideoStack}}, 38 | \code{\link{VideoWriter}}, \code{\link{videoWriter}} 39 | } 40 | \author{ 41 | Simon Garnier, \email{garnier@njit.edu} 42 | } 43 | -------------------------------------------------------------------------------- /man/frame.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/QueueClass.R, R/VideoClass.R, 3 | % R/VideoStackClass.R, R/generic.R 4 | \name{frame.Rcpp_Queue} 5 | \alias{frame.Rcpp_Queue} 6 | \alias{frame.Rcpp_Video} 7 | \alias{frame<-.Rcpp_Video} 8 | \alias{frame.VideoStack} 9 | \alias{frame<-.VideoStack} 10 | \alias{frame} 11 | \alias{frame<-} 12 | \title{Reader Head Position} 13 | \usage{ 14 | \method{frame}{Rcpp_Queue}(x) 15 | 16 | \method{frame}{Rcpp_Video}(x) 17 | 18 | \method{frame}{Rcpp_Video}(x) <- value 19 | 20 | \method{frame}{VideoStack}(x) 21 | 22 | \method{frame}{VideoStack}(x) <- value 23 | 24 | frame(x) 25 | 26 | frame(x) <- value 27 | } 28 | \arguments{ 29 | \item{x}{A \code{\link{Video}}, \code{\link{VideoStack}} or 30 | \code{\link{Queue}} object.} 31 | 32 | \item{value}{The index of the frame to be read next.} 33 | } 34 | \value{ 35 | A numeric value or `x` with a new head position. 36 | } 37 | \description{ 38 | Retrieve or set the index of the frame to be read next in a 39 | \code{\link{Video}}, \code{\link{VideoStack}} or \code{\link{Queue}} object. 40 | } 41 | \note{ 42 | Frame index starts at 1 (i.e. the first image has index 1). 43 | } 44 | \examples{ 45 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 46 | frame(balloon) 47 | 48 | } 49 | \seealso{ 50 | \code{\link{Video}}, \code{\link{VideoStack}}, \code{\link{Queue}} 51 | } 52 | \author{ 53 | Simon Garnier, \email{garnier@njit.edu} 54 | } 55 | -------------------------------------------------------------------------------- /man/full.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/QueueClass.R 3 | \name{full} 4 | \alias{full} 5 | \alias{empty} 6 | \title{Test for a Full/Empty Queue Object} 7 | \usage{ 8 | full(x) 9 | 10 | empty(x) 11 | } 12 | \arguments{ 13 | \item{x}{A \code{\link{Queue}} object.} 14 | } 15 | \value{ 16 | A logical. 17 | } 18 | \description{ 19 | \code{full} tests whether a \code{\link{Queue}} object is full, 20 | that is whether the number of frames it contains is equal to its capacity. 21 | \code{empty} tests whether a \code{\link{Queue}} object is empty, that is 22 | whether it contains no frames. 23 | } 24 | \examples{ 25 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 26 | buf <- queue(balloon) 27 | full(buf) 28 | 29 | } 30 | \seealso{ 31 | \code{\link{Queue}}, \code{\link{queue}}, \code{\link{capacity}} 32 | } 33 | \author{ 34 | Simon Garnier, \email{garnier@njit.edu} 35 | } 36 | -------------------------------------------------------------------------------- /man/getAffineTransform.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/transform.R 3 | \name{getAffineTransform} 4 | \alias{getAffineTransform} 5 | \title{Affine Transform} 6 | \usage{ 7 | getAffineTransform(from, to, from_dim, to_dim = from_dim) 8 | } 9 | \arguments{ 10 | \item{from}{A 4x2 matrix indicating the location (x, y) of 4 points in the 11 | source image.} 12 | 13 | \item{to}{A 4x2 matrix indicating the location (x, y) of 4 points in the 14 | destination image. The order of the points must correspond to the order in 15 | \code{from}.} 16 | 17 | \item{from_dim}{A vector which first two elements indicate the number of rows 18 | and columns of the source image.} 19 | 20 | \item{to_dim}{A vector which first two elements indicate the number of rows 21 | and columns of the destination image. If not specified, \code{from_dim} will 22 | be used as a default.} 23 | } 24 | \value{ 25 | A 3x3 matrix. 26 | } 27 | \description{ 28 | \code{getAffineTransform} computes the matrix of an affine 29 | transform from 4 pairs of corresponding points in a source and destination 30 | image. 31 | } 32 | \examples{ 33 | from <- matrix(c(1, 1, 2, 5, 6, 5, 5, 1), nrow = 4, byrow = TRUE) 34 | to <- matrix(c(1, 1, 1, 5, 5, 5, 5, 1), nrow = 4, byrow = TRUE) 35 | getAffineTransform(from, to, c(1080, 1920), c(1080, 1920)) 36 | 37 | } 38 | \seealso{ 39 | \code{\link{warpAffine}}, \code{\link{findHomography}} 40 | } 41 | \author{ 42 | Simon Garnier, \email{garnier@njit.edu} 43 | } 44 | -------------------------------------------------------------------------------- /man/getGaborKernel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/filters.R 3 | \name{getGaborKernel} 4 | \alias{getGaborKernel} 5 | \title{Gabor Filter Kernels} 6 | \usage{ 7 | getGaborKernel( 8 | width = 31, 9 | height = 31, 10 | sigma = 5, 11 | theta = pi, 12 | lambda = 31, 13 | gamma = 5, 14 | psi = 0 15 | ) 16 | } 17 | \arguments{ 18 | \item{width}{The width in pixels of the kernel (default: 31).} 19 | 20 | \item{height}{The height in pixels of the kernel (default: 31).} 21 | 22 | \item{sigma}{The standard deviation of the Gaussian envelope (default: 5).} 23 | 24 | \item{theta}{The orientation of the normal to the parallel stripes of a Gabor 25 | function (default: \code{\link{pi}}).} 26 | 27 | \item{lambda}{The wavelength of the sinusoidal factor (default: 31).} 28 | 29 | \item{gamma}{The spatial aspect ratio (default: 5).} 30 | 31 | \item{psi}{A phase offset (default: 0).} 32 | } 33 | \value{ 34 | A matrix of Gabor coefficients. 35 | } 36 | \description{ 37 | \code{getGaborKernel} is a convenience function to create Gabor 38 | kernels that can be used to filter images with \code{\link{filter2D}}. 39 | } 40 | \note{ 41 | For more details about Gabor filter equations and parameters, 42 | see: \href{https://en.wikipedia.org/wiki/Gabor_filter}{Gabor filter}. 43 | } 44 | \examples{ 45 | getGaborKernel() 46 | 47 | } 48 | \seealso{ 49 | \code{\link{filter2D}} 50 | } 51 | \author{ 52 | Simon Garnier, \email{garnier@njit.edu} 53 | } 54 | -------------------------------------------------------------------------------- /man/getPerspectiveTransform.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/transform.R 3 | \name{getPerspectiveTransform} 4 | \alias{getPerspectiveTransform} 5 | \title{Perspective Transform} 6 | \usage{ 7 | getPerspectiveTransform(from, to, from_dim, to_dim = from_dim) 8 | } 9 | \arguments{ 10 | \item{from}{A 4x2 matrix indicating the location (x, y) of 4 points in the 11 | source image.} 12 | 13 | \item{to}{A 4x2 matrix indicating the location (x, y) of 4 points in the 14 | destination image. The order of the points must correspond to the order in 15 | \code{from}.} 16 | 17 | \item{from_dim}{A vector which first two elements indicate the number of rows 18 | and columns of the source image.} 19 | 20 | \item{to_dim}{A vector which first two elements indicate the number of rows 21 | and columns of the destination image. If not specified, \code{from_dim} will 22 | be used as a default.} 23 | } 24 | \value{ 25 | A 3x3 matrix. 26 | } 27 | \description{ 28 | \code{getPerspectiveTransform} computes the matrix of a perspective 29 | transform from 4 pairs of corresponding points in a source and destination 30 | image. 31 | } 32 | \examples{ 33 | from <- matrix(c(1, 1, 2, 5, 6, 5, 5, 1), nrow = 4, byrow = TRUE) 34 | to <- matrix(c(1, 1, 1, 5, 5, 5, 5, 1), nrow = 4, byrow = TRUE) 35 | getPerspectiveTransform(from, to, c(1080, 1920), c(1080, 1920)) 36 | 37 | } 38 | \seealso{ 39 | \code{\link{warpPerspective}}, \code{\link{findHomography}} 40 | } 41 | \author{ 42 | Simon Garnier, \email{garnier@njit.edu} 43 | } 44 | -------------------------------------------------------------------------------- /man/getStructuringElement.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/filters.R 3 | \name{getStructuringElement} 4 | \alias{getStructuringElement} 5 | \title{Structuring Elements} 6 | \usage{ 7 | getStructuringElement( 8 | k_shape = "rectangle", 9 | k_height = 5, 10 | k_width = 5, 11 | anchor = c(-1, -1) 12 | ) 13 | } 14 | \arguments{ 15 | \item{k_shape}{A string corresponding to the shape of the structuring element. 16 | Valid kernel shapes are: 17 | \itemize{ 18 | \item{"rectangle" (the default)} 19 | \item{"cross"} 20 | \item{"ellipse"} 21 | }} 22 | 23 | \item{k_height}{The half-height in pixels of the structuring element.} 24 | 25 | \item{k_width}{The half-width in pixels of the structuring element.} 26 | 27 | \item{anchor}{A 2-element numeric vector defining the anchor position within 28 | the cross-shaped structuring element. The default value (−1,−1) means that 29 | the anchor is at the center. Note that only the shape of a cross-shaped 30 | kernel depends on the anchor position.} 31 | } 32 | \value{ 33 | A matrix of 0s and 1s. 34 | } 35 | \description{ 36 | \code{getStructuringElement} is a convenience function to create 37 | structuring elements with defined shapes that can be used to filter images 38 | with \code{\link{filter2D}}. 39 | } 40 | \examples{ 41 | getStructuringElement() 42 | 43 | } 44 | \seealso{ 45 | \code{\link{filter2D}} 46 | } 47 | \author{ 48 | Simon Garnier, \email{garnier@njit.edu} 49 | } 50 | -------------------------------------------------------------------------------- /man/getTextSize.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/draw.R 3 | \name{getTextSize} 4 | \alias{getTextSize} 5 | \title{Calculate the Height and Width of a Text String} 6 | \usage{ 7 | getTextSize( 8 | text, 9 | font_face = "simplex", 10 | font_scale = 1, 11 | italic = FALSE, 12 | thickness = 1 13 | ) 14 | } 15 | \arguments{ 16 | \item{text}{A character string representing the text to be drawn.} 17 | 18 | \item{font_face}{A character string representing the font type of the text 19 | (default: "simplex"). See notes for a list of available font types.} 20 | 21 | \item{font_scale}{A numeric value representing the scale factor by which the 22 | font-specific base size is multiplied (default: 1).} 23 | 24 | \item{italic}{A logical specifying whether the text should italicized 25 | (default: FALSE).} 26 | 27 | \item{thickness}{A numeric value representing the thickness in pixels of the 28 | line (default: 1).} 29 | } 30 | \value{ 31 | A two-element vector corresponding to the height and width of the 32 | text string. 33 | } 34 | \description{ 35 | \code{getTextSize} calculates the size of a box that contains 36 | the specified text string, the tight box surrounding it, and the baseline. 37 | } 38 | \examples{ 39 | getTextSize("I'm a balloon") 40 | 41 | } 42 | \seealso{ 43 | \code{\link{Image}}, \code{\link{drawText}} 44 | } 45 | \author{ 46 | Simon Garnier, \email{garnier@njit.edu} 47 | } 48 | -------------------------------------------------------------------------------- /man/histmatch.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/transform.R 3 | \name{histmatch} 4 | \alias{histmatch} 5 | \title{Histogram Matching/Specification} 6 | \usage{ 7 | histmatch(image, reference, target = "new") 8 | } 9 | \arguments{ 10 | \item{image}{An 8-bit (8U) \code{\link{Image}} object to transform.} 11 | 12 | \item{reference}{An 8-bit (8U) \code{\link{Image}} object which histogram 13 | will be used as a reference to transform \code{image}.} 14 | 15 | \item{target}{The location where the results should be stored. It can take 3 16 | values: 17 | \describe{ 18 | \item{"new":}{a new \code{\link{Image}} object is created and the results 19 | are stored inside (the default).} 20 | \item{"self":}{the results are stored back into \code{image} (faster but 21 | destructive).} 22 | \item{An \code{\link{Image}} object:}{the results are stored in another 23 | existing \code{\link{Image}} object. This is fast and will not replace the 24 | content of \code{image} but will replace that of \code{target}. Note that 25 | if \code{target} does not have the same dimensions, number of channels, 26 | and bit depth as \code{image}, nothing will be stored.} 27 | }} 28 | } 29 | \value{ 30 | If \code{target="new"}, the function returns an \code{\link{Image}} 31 | object. If \code{target="self"}, the function returns nothing and modifies 32 | \code{image} in place. If \code{target} is an \code{\link{Image}} object, 33 | the function returns nothing and modifies that \code{\link{Image}} object in 34 | place. 35 | } 36 | \description{ 37 | \code{histmatch} transforms an \code{\link{Image}} object so 38 | that its histogram matches (approximately) that of another 39 | \code{\link{Image}} object. 40 | } 41 | \examples{ 42 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 43 | dots <- image(system.file("sample_img/dots.jpg", package = "Rvision")) 44 | dots_matched <- histmatch(dots, balloon) 45 | 46 | } 47 | \seealso{ 48 | \code{\link{Image}}, \code{\link{histmatch}} 49 | } 50 | \author{ 51 | Simon Garnier, \email{garnier@njit.edu} 52 | } 53 | -------------------------------------------------------------------------------- /man/houghLinesP.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/feature.R 3 | \name{houghLinesP} 4 | \alias{houghLinesP} 5 | \title{Probabilistic Hough Line Detector} 6 | \usage{ 7 | houghLinesP( 8 | image, 9 | rho, 10 | theta, 11 | threshold, 12 | min_line_length = 0, 13 | max_line_gap = 0 14 | ) 15 | } 16 | \arguments{ 17 | \item{image}{An 8-bit (8U) single-channel (GRAY) binary \code{\link{Image}} 18 | object.} 19 | 20 | \item{rho}{The distance resolution of the accumulator in pixels.} 21 | 22 | \item{theta}{The angle resolution of the accumulator in radians.} 23 | 24 | \item{threshold}{The accumulator threshold parameter. Only lines that get 25 | more votes than that threshold are returned.} 26 | 27 | \item{min_line_length}{The minimum line length. Line segments shorter than 28 | that are rejected.} 29 | 30 | \item{max_line_gap}{The maximum allowed gap between points on the same line 31 | segment to link them.} 32 | } 33 | \value{ 34 | A matrix with 4 columns corresponding to the x and y coordinates of 35 | the extremities of each detected line. 36 | } 37 | \description{ 38 | \code{houghLinesP} finds line segments in a binary image using 39 | the probabilistic Hough transform. 40 | } 41 | \examples{ 42 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 43 | balloon_canny <- canny(balloon, 50, 50) 44 | lines <- houghLinesP(balloon_canny, 1, pi / 180, 80, 0, 50) 45 | 46 | } 47 | \seealso{ 48 | \code{\link{houghCircles}} 49 | } 50 | \author{ 51 | Simon Garnier, \email{garnier@njit.edu} 52 | } 53 | -------------------------------------------------------------------------------- /man/improfile.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shape.R 3 | \name{improfile} 4 | \alias{improfile} 5 | \title{Pixel Values Along a Line Segment} 6 | \usage{ 7 | improfile(image, xi, yi, connectivity = 8, left_to_right = FALSE) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{xi, yi}{Two-element vectors containing the x and y coordinates of the 13 | start and end points of a line segment. The points can lie outside of the 14 | image boundaries but then the line will be clipped on the image boundaries.} 15 | 16 | \item{connectivity}{The connectivity neighborhood to decide whether 2 pixels 17 | are contiguous. This parameter can take two values: 18 | \describe{ 19 | \item{4: }{the neighborhood of a pixel are the four pixels located above 20 | (north), below (south), to the left (west) and right (east) of the pixel.} 21 | \item{8 (the default): }{the neighborhood of a pixel includes the four 22 | 4-neighbors and the four pixels along the diagonal directions (northeast, 23 | northwest, southeast, and southwest).} 24 | }} 25 | 26 | \item{left_to_right}{If `TRUE`, the line segment is traversed from the 27 | leftmost endpoint to the rightmost endpoint, regardless of the order in 28 | which they are specified in \code{xi} and \code{yi}. Otherwise (the default), 29 | the line is traversed in the order in which the points are specified in 30 | \code{xi} and \code{yi}.} 31 | } 32 | \value{ 33 | A matrix in which the first two columns indicate the coordinates of 34 | the points traversed by the line segment, and the other columns indicate the 35 | color values at each location. 36 | } 37 | \description{ 38 | \code{improfile} finds all pixels intersected by a line segment 39 | and returns their coordinates and color values. 40 | } 41 | \examples{ 42 | dots <- image(system.file("sample_img/dots.jpg", package = "Rvision")) 43 | improfile(dots, c(1, ncol(dots)), c(nrow(dots) / 2, nrow(dots) / 2)) 44 | 45 | } 46 | \author{ 47 | Simon Garnier, \email{garnier@njit.edu} 48 | } 49 | -------------------------------------------------------------------------------- /man/inPlaceArithmetic.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/arithmetic.R, R/zzz.R 3 | \name{inPlaceArithmetic} 4 | \alias{inPlaceArithmetic} 5 | \alias{\%i+\%} 6 | \alias{\%i-\%} 7 | \alias{\%i*\%} 8 | \alias{\%i/\%} 9 | \alias{\%i^\%} 10 | \title{In Place Arithmetic Operators for Images} 11 | \usage{ 12 | e1 \%i+\% e2 13 | 14 | e1 \%i-\% e2 15 | 16 | e1 \%i*\% e2 17 | 18 | e1 \%i/\% e2 19 | 20 | e1 \%i^\% e2 21 | } 22 | \arguments{ 23 | \item{e1, e2}{Either 2 \code{\link{Image}} objects or 1 \code{\link{Image}} 24 | object and 1 numeric value/vector. If a vector and its length is less than 25 | the number of channels of the image, then it is recycled to match it.} 26 | } 27 | \value{ 28 | These operators do not return anything. They modify the image in 29 | place (destructive operation). If 2 images are passed to the operators, only 30 | the one of the left side of the operator is modified; the other is left 31 | untouched. 32 | } 33 | \description{ 34 | In Place Arithmetic Operators for Images 35 | } 36 | \examples{ 37 | balloon1 <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 38 | balloon2 <- image(system.file("sample_img/balloon2.png", package = "Rvision")) 39 | balloon1 \%i+\% balloon2 40 | 41 | } 42 | \seealso{ 43 | \code{\link{Image}} 44 | } 45 | \author{ 46 | Simon Garnier, \email{garnier@njit.edu} 47 | } 48 | -------------------------------------------------------------------------------- /man/inPlaceComparison.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/comparisons.R, R/zzz.R 3 | \name{inPlaceComparison} 4 | \alias{inPlaceComparison} 5 | \alias{\%i>\%} 6 | \alias{\%i<\%} 7 | \alias{\%i>=\%} 8 | \alias{\%i<=\%} 9 | \alias{\%i==\%} 10 | \alias{\%i!=\%} 11 | \title{In Place Comparison Operators for Images} 12 | \usage{ 13 | e1 \%i>\% e2 14 | 15 | e1 \%i<\% e2 16 | 17 | e1 \%i>=\% e2 18 | 19 | e1 \%i<=\% e2 20 | 21 | e1 \%i==\% e2 22 | 23 | e1 \%i!=\% e2 24 | } 25 | \arguments{ 26 | \item{e1, e2}{Either 2 \code{\link{Image}} objects or 1 \code{\link{Image}} 27 | object and 1 numeric value/vector. If a vector and its length is less than 28 | the number of channels of the image, then it is recycled to match it.} 29 | } 30 | \value{ 31 | These operators do not return anything. They modify the image in 32 | place (destructive operation). If 2 images are passed to the operators, only 33 | the one of the left side of the operator is modified; the other is left 34 | untouched. 35 | } 36 | \description{ 37 | In Place Comparison Operators for Images 38 | } 39 | \examples{ 40 | balloon1 <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 41 | balloon2 <- image(system.file("sample_img/balloon2.png", package = "Rvision")) 42 | balloon1 \%i>\% balloon2 43 | 44 | } 45 | \seealso{ 46 | \code{\link{Image}} 47 | } 48 | \author{ 49 | Simon Garnier, \email{garnier@njit.edu} 50 | } 51 | -------------------------------------------------------------------------------- /man/initUndistortRectifyMap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calib3d.R 3 | \name{initUndistortRectifyMap} 4 | \alias{initUndistortRectifyMap} 5 | \title{Compute an Undistortion and Rectification Transformation Map} 6 | \usage{ 7 | initUndistortRectifyMap( 8 | camera_matrix, 9 | dist_coefs, 10 | new_camera_matrix = camera_matrix, 11 | nrow, 12 | ncol 13 | ) 14 | } 15 | \arguments{ 16 | \item{camera_matrix}{A 3x3 camera intrinsic matrix as returned by 17 | \code{\link{calibrateCamera}}.} 18 | 19 | \item{dist_coefs}{A single row matrix with 4, 5, 8, 12 or 14 elements as 20 | returned by \code{\link{calibrateCamera}}.} 21 | 22 | \item{new_camera_matrix}{A 3x3 camera intrinsic matrix as returned by 23 | \code{\link{getOptimalNewCameraMatrix}} if you chose to execute this 24 | optional step (default: \code{camera_matrix}).} 25 | 26 | \item{nrow, ncol}{The number of rows and columns of the undistorted image.} 27 | } 28 | \value{ 29 | A 2xN matrix of transformed X/Y coordinates. 30 | } 31 | \description{ 32 | \code{initUndistortRectifyMap} computes the joint undistortion 33 | and rectification transformation and represents the result in the form of 34 | maps for \code{\link{remap}}. The undistorted image looks like original, as 35 | if it is captured with a camera using the camera matrix \code{new_camera_matrix} 36 | and zero distortion. In case of a monocular camera, \code{new_camera_matrix} 37 | is usually equal to \code{camera_matrix}, or it can be computed by 38 | \code{\link{getOptimalNewCameraMatrix}} for a better control over scaling. 39 | } 40 | \examples{ 41 | # See the help vignette: 42 | \dontrun{ 43 | vignette("z8_calib", package = "Rvision") 44 | } 45 | 46 | } 47 | \seealso{ 48 | \code{\link{undistort}}, \code{\link{calibrateCamera}}, 49 | \code{\link{getOptimalNewCameraMatrix}} 50 | } 51 | \author{ 52 | Simon Garnier, \email{garnier@njit.edu} 53 | } 54 | -------------------------------------------------------------------------------- /man/insertChannel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{insertChannel} 4 | \alias{insertChannel} 5 | \title{Insert Single Channel into Image} 6 | \usage{ 7 | insertChannel(image, channel, insert) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{channel}{An integer specifying the index of the channel that will be 13 | replaced by \code{insert}} 14 | 15 | \item{insert}{A single-channel \code{\link{Image}} object with the same bit 16 | depth as \code{image}.} 17 | } 18 | \value{ 19 | The function returns nothing and modifies \code{image} in place. 20 | } 21 | \description{ 22 | \code{insertChannel} insert a single color channel into the 23 | target image. 24 | } 25 | \examples{ 26 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 27 | red <- extractChannel(balloon, 3) 28 | insertChannel(balloon, 1, red) 29 | 30 | } 31 | \seealso{ 32 | \code{\link{Image}}, \code{\link{split}}, \code{\link{merge}} 33 | } 34 | \author{ 35 | Simon Garnier, \email{garnier@njit.edu} 36 | } 37 | -------------------------------------------------------------------------------- /man/invert.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/filters.R 3 | \name{invert} 4 | \alias{invert} 5 | \title{Invert Colors} 6 | \usage{ 7 | invert(image, target = "new", in_place = NULL) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{target}{The location where the results should be stored. It can take 3 13 | values: 14 | \describe{ 15 | \item{"new":}{a new \code{\link{Image}} object is created and the results 16 | are stored inside (the default).} 17 | \item{"self":}{the results are stored back into \code{image} (faster but 18 | destructive).} 19 | \item{An \code{\link{Image}} object:}{the results are stored in another 20 | existing \code{\link{Image}} object. This is fast and will not replace the 21 | content of \code{image} but will replace that of \code{target}. Note that 22 | if \code{target} does not have the same dimensions, number of channels, and 23 | bit depth as \code{image}, an error may be thrown.} 24 | }} 25 | 26 | \item{in_place}{Deprecated. Use \code{target} instead.} 27 | } 28 | \value{ 29 | If \code{target="new"}, the function returns an \code{\link{Image}} 30 | object. If \code{target="self"}, the function returns nothing and modifies 31 | \code{image} in place. If \code{target} is an \code{\link{Image}} object, 32 | the function returns nothing and modifies that \code{\link{Image}} object in 33 | place. 34 | } 35 | \description{ 36 | \code{invert} returns an image which colors are the linear 37 | inverse of that of the original image. 38 | } 39 | \examples{ 40 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 41 | balloon_inv <- invert(balloon) 42 | 43 | } 44 | \seealso{ 45 | \code{\link{Image}} 46 | } 47 | \author{ 48 | Simon Garnier, \email{garnier@njit.edu} 49 | } 50 | -------------------------------------------------------------------------------- /man/invertFourcc.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoWriterClass.R 3 | \name{invertFourcc} 4 | \alias{invertFourcc} 5 | \title{FOURCC Code to Codec Name} 6 | \usage{ 7 | invertFourcc(x) 8 | } 9 | \arguments{ 10 | \item{x}{A integer.} 11 | } 12 | \value{ 13 | A 4-character strings corresponding to the video codec. 14 | } 15 | \description{ 16 | \code{invertFourcc} translates a 17 | \href{https://www.fourcc.org/codecs.php}{FOURCC} code into the 4-character 18 | name of the corresponding video codec. 19 | } 20 | \examples{ 21 | invertFourcc(1684633208) 22 | 23 | } 24 | \seealso{ 25 | \code{\link{VideoWriter}}, \code{\link{videoWriter}}, 26 | \code{\link{codec}}, \code{\link{fourcc}} 27 | } 28 | \author{ 29 | Simon Garnier, \email{garnier@njit.edu} 30 | } 31 | -------------------------------------------------------------------------------- /man/isBlob.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/blob.R 3 | \name{isBlob} 4 | \alias{isBlob} 5 | \title{Test for a Blob Object} 6 | \usage{ 7 | isBlob(object) 8 | } 9 | \arguments{ 10 | \item{object}{Any R object.} 11 | } 12 | \value{ 13 | A logical indicating whether the object is of class 14 | \code{blob} (TRUE) or not (FALSE). 15 | } 16 | \description{ 17 | Tests whether the object is of class \code{blob}. 18 | } 19 | \examples{ 20 | dots <- image(system.file("sample_img/dots.jpg", package = "Rvision")) 21 | blobs <- simpleBlobDetector(invert(dots), min_threshold = 25, max_threshold = 220, 22 | filter_by_area = TRUE, min_area = 200, max_area = Inf, 23 | filter_by_color = FALSE) 24 | isBlob(blobs) 25 | 26 | } 27 | \seealso{ 28 | \code{\link{simpleBlobDetector}} 29 | } 30 | \author{ 31 | Simon Garnier, \email{garnier@njit.edu} 32 | } 33 | -------------------------------------------------------------------------------- /man/isImage.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{isImage} 4 | \alias{isImage} 5 | \title{Test for an Image Object} 6 | \usage{ 7 | isImage(object) 8 | } 9 | \arguments{ 10 | \item{object}{Any R object.} 11 | } 12 | \value{ 13 | A logical indicating whether the object is of class 14 | \code{\link{Image}} (TRUE) or not (FALSE). 15 | } 16 | \description{ 17 | Tests whether the object is of class \code{\link{Image}} 18 | } 19 | \examples{ 20 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 21 | isImage(balloon) 22 | 23 | } 24 | \seealso{ 25 | \code{\link{Image}}, \code{\link{image}} 26 | } 27 | \author{ 28 | Simon Garnier, \email{garnier@njit.edu} 29 | } 30 | -------------------------------------------------------------------------------- /man/isQueue.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/QueueClass.R 3 | \name{isQueue} 4 | \alias{isQueue} 5 | \title{Test for a Queue object} 6 | \usage{ 7 | isQueue(object) 8 | } 9 | \arguments{ 10 | \item{object}{Any R object.} 11 | } 12 | \value{ 13 | A logical indicating whether the object is of class 14 | \code{\link{Queue}} (TRUE) or not (FALSE). 15 | } 16 | \description{ 17 | Tests whether the object is of class \code{\link{Queue}}. 18 | } 19 | \examples{ 20 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 21 | buf <- queue(balloon) 22 | isQueue(buf) 23 | 24 | } 25 | \seealso{ 26 | \code{\link{Queue}}, \code{\link{queue}} 27 | } 28 | \author{ 29 | Simon Garnier, \email{garnier@njit.edu} 30 | } 31 | -------------------------------------------------------------------------------- /man/isStream.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/StreamClass.R 3 | \name{isStream} 4 | \alias{isStream} 5 | \title{Test for a Stream Object} 6 | \usage{ 7 | isStream(object) 8 | } 9 | \arguments{ 10 | \item{object}{Any R object.} 11 | } 12 | \value{ 13 | A logical indicating whether the object is of class 14 | \code{\link{Stream}} (TRUE) or not (FALSE). 15 | } 16 | \description{ 17 | Tests whether the object is of class \code{\link{Stream}}. 18 | } 19 | \examples{ 20 | \dontrun{ 21 | live <- stream(0) 22 | isStream(live) 23 | release(live) 24 | } 25 | 26 | } 27 | \seealso{ 28 | \code{\link{Stream}}, \code{\link{stream}} 29 | } 30 | \author{ 31 | Simon Garnier, \email{garnier@njit.edu} 32 | } 33 | -------------------------------------------------------------------------------- /man/isVideo.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoClass.R 3 | \name{isVideo} 4 | \alias{isVideo} 5 | \title{Test for a Video Object} 6 | \usage{ 7 | isVideo(object) 8 | } 9 | \arguments{ 10 | \item{object}{Any R object.} 11 | } 12 | \value{ 13 | A logical indicating whether the object is of class 14 | \code{\link{Video}} (TRUE) or not (FALSE). 15 | } 16 | \description{ 17 | Tests whether the object is of class \code{\link{Video}}. 18 | } 19 | \examples{ 20 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 21 | isVideo(balloon) 22 | 23 | } 24 | \seealso{ 25 | \code{\link{Video}}, \code{\link{video}} 26 | } 27 | \author{ 28 | Simon Garnier, \email{garnier@njit.edu} 29 | } 30 | -------------------------------------------------------------------------------- /man/isVideoStack.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoStackClass.R 3 | \name{isVideoStack} 4 | \alias{isVideoStack} 5 | \title{Test for a VideoStack Object} 6 | \usage{ 7 | isVideoStack(object) 8 | } 9 | \arguments{ 10 | \item{object}{Any R object.} 11 | } 12 | \value{ 13 | A logical indicating whether the object is of class 14 | \code{\link{VideoStack}} (TRUE) or not (FALSE). 15 | } 16 | \description{ 17 | Tests whether the object is of class \code{\link{VideoStack}}. 18 | } 19 | \examples{ 20 | path <- system.file("sample_vid/Balloon.mp4", package = "Rvision") 21 | balloonStack <- videoStack(path, path) 22 | isVideoStack(balloonStack) 23 | 24 | } 25 | \seealso{ 26 | \code{\link{VideoStack}}, \code{\link{videoStack}} 27 | } 28 | \author{ 29 | Simon Garnier, \email{garnier@njit.edu} 30 | } 31 | -------------------------------------------------------------------------------- /man/isVideoWriter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoWriterClass.R 3 | \name{isVideoWriter} 4 | \alias{isVideoWriter} 5 | \title{Test for a VideoWriter Object} 6 | \usage{ 7 | isVideoWriter(object) 8 | } 9 | \arguments{ 10 | \item{object}{Any R object.} 11 | } 12 | \value{ 13 | A logical indicating whether the object is of class 14 | \code{\link{VideoWriter}} (TRUE) or not (FALSE). 15 | } 16 | \description{ 17 | Tests whether the object is of class \code{\link{VideoWriter}} 18 | } 19 | \examples{ 20 | \dontrun{ 21 | writer <- videoWriter("test.mp4", "H264", 25, 1080, 1920) 22 | isVideoWriter(writer) 23 | release(writer) 24 | } 25 | 26 | } 27 | \seealso{ 28 | \code{\link{VideoWriter}}, \code{\link{videoWriter}} 29 | } 30 | \author{ 31 | Simon Garnier, \email{garnier@njit.edu} 32 | } 33 | -------------------------------------------------------------------------------- /man/laplacian.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/filters.R 3 | \name{laplacian} 4 | \alias{laplacian} 5 | \title{Calculates the Laplacian of an Image} 6 | \usage{ 7 | laplacian(image, k_size = 5, scale = 1, target = "new", in_place = NULL) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{k_size}{The half-size in pixels of the kernel (default: 5).} 13 | 14 | \item{scale}{The scale factor for the computed Laplacian values (default: 1).} 15 | 16 | \item{target}{The location where the results should be stored. It can take 3 17 | values: 18 | \describe{ 19 | \item{"new":}{a new \code{\link{Image}} object is created and the results 20 | are stored inside (the default).} 21 | \item{"self":}{the results are stored back into \code{image} (faster but 22 | destructive).} 23 | \item{An \code{\link{Image}} object:}{the results are stored in another 24 | existing \code{\link{Image}} object. This is fast and will not replace the 25 | content of \code{image} but will replace that of \code{target}. Note that 26 | if \code{target} does not have the same dimensions, number of channels, and 27 | bit depth as \code{image}, an error may be thrown.} 28 | }} 29 | 30 | \item{in_place}{Deprecated. Use \code{target} instead.} 31 | } 32 | \value{ 33 | If \code{target="new"}, the function returns an \code{\link{Image}} 34 | object. If \code{target="self"}, the function returns nothing and modifies 35 | \code{image} in place. If \code{target} is an \code{\link{Image}} object, 36 | the function returns nothing and modifies that \code{\link{Image}} object in 37 | place. 38 | } 39 | \description{ 40 | \code{laplacian} calculates the Laplacian of the source image by 41 | adding up the second x and y derivatives calculated using the Sobel operator. 42 | } 43 | \examples{ 44 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 45 | balloon_laplacian <- laplacian(balloon, 5) 46 | 47 | } 48 | \seealso{ 49 | \code{\link{Image}}, \code{\link{sobel}} 50 | } 51 | \author{ 52 | Simon Garnier, \email{garnier@njit.edu} 53 | } 54 | -------------------------------------------------------------------------------- /man/log.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/zzz.R 3 | \name{log} 4 | \alias{log} 5 | \title{Logarithm Generic for Image objects} 6 | \usage{ 7 | log(x, target = "new", ...) 8 | } 9 | \arguments{ 10 | \item{x}{A 32- or 64-bit (32F or 64F) \code{\link{Image}} object.} 11 | 12 | \item{target}{The location where the results should be stored when passing a 13 | sum of images to the function. It can take 3 values: 14 | \describe{ 15 | \item{"new":}{a new \code{\link{Image}} object is created and the results 16 | are stored inside (the default).} 17 | \item{"self":}{the results are stored back into \code{x} (faster but 18 | destructive).} 19 | \item{An \code{\link{Image}} object:}{the results are stored in another 20 | existing \code{\link{Image}} object. This is fast but will replace the 21 | content of \code{target}. Note that \code{target} should have the same 22 | dimensions, bitdepth, and number of channels as \code{x}, otherwise an 23 | error will be thrown.} 24 | }} 25 | 26 | \item{...}{Ignored.} 27 | } 28 | \value{ 29 | If \code{target="new"}, the function returns an \code{\link{Image}} 30 | object. If \code{target="self"}, the function returns nothing and modifies 31 | \code{x} in place. If \code{target} is an \code{\link{Image}} object, the 32 | function returns nothing and modifies that \code{\link{Image}} object in 33 | place. 34 | } 35 | \description{ 36 | Overloaded \code{\link[base]{log}} to handle \code{\link{Image}} 37 | objects. 38 | } 39 | \examples{ 40 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 41 | changeBitDepth(balloon, "32F", 1 , "self") 42 | log(balloon) 43 | 44 | } 45 | \seealso{ 46 | \code{\link{exp}}, \code{\link{pow}}, \code{\link{sqrt}} 47 | } 48 | \author{ 49 | Simon Garnier, \email{garnier@njit.edu} 50 | } 51 | -------------------------------------------------------------------------------- /man/matchKeypoints.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/feature.R 3 | \name{matchKeypoints} 4 | \alias{matchKeypoints} 5 | \title{Match Keypoints} 6 | \usage{ 7 | matchKeypoints( 8 | source, 9 | target, 10 | descriptor_matcher = "BruteForce-Hamming", 11 | match_frac = 0.15 12 | ) 13 | } 14 | \arguments{ 15 | \item{source, target}{Single-channel \code{\link{Image}} objects 16 | containing the BRIEF descriptors of the source and target images, as produced 17 | by \code{\link{ORBkeypoints}}.} 18 | 19 | \item{descriptor_matcher}{A character string indicating the type of the 20 | descriptor matcher to use. It can be one of the followings: "BruteForce", 21 | "BruteForce-L1", "BruteForce-Hamming" (the default), "BruteForce-Hamming(2)", 22 | or "FlannBased".} 23 | 24 | \item{match_frac}{The fraction of top matches to keep (default: 0.15).} 25 | } 26 | \value{ 27 | A three-column matrix with the identities of the keypoints matched 28 | between the source and target images, and the distance between them (a lower 29 | distance indicates a better match). 30 | } 31 | \description{ 32 | \code{matchKeypoints} matches keypoints detected in two separate 33 | images. This is useful to find common features for image registration, for 34 | instance. 35 | } 36 | \examples{ 37 | balloon1 <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 38 | balloon2 <- image(system.file("sample_img/balloon2.png", package = "Rvision")) 39 | kp1 <- ORBkeypoints(balloon1, n_features = 40000) 40 | kp2 <- ORBkeypoints(balloon2, n_features = 40000) 41 | matchKeypoints(kp1$descriptors, kp2$descriptors, match_frac = 1) 42 | 43 | } 44 | \seealso{ 45 | \code{\link{ORBkeypoints}} 46 | } 47 | \author{ 48 | Simon Garnier, \email{garnier@njit.edu} 49 | } 50 | -------------------------------------------------------------------------------- /man/mean.Rcpp_Image.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statistics.R 3 | \name{mean.Rcpp_Image} 4 | \alias{mean.Rcpp_Image} 5 | \title{Mean Value of the Pixels in an Image} 6 | \usage{ 7 | \method{mean}{Rcpp_Image}(x, ..., mask = NA) 8 | } 9 | \arguments{ 10 | \item{x}{An \code{\link{Image}} object.} 11 | 12 | \item{...}{Unused at the moment.} 13 | 14 | \item{mask}{A single-channel (GRAY) 8-bit (8U) \code{\link{Image}} object 15 | with the same dimensions as \code{x}. This can be used to mask out pixels 16 | that should not be considered when calculating the mean (pixels set to 0 in 17 | the mask will be ignored during the mean calculation).} 18 | } 19 | \value{ 20 | A numeric value (for single-channel images) or a vector of numeric 21 | values (for multi-channel images). 22 | } 23 | \description{ 24 | Returns the mean of the pixel values of an \code{\link{Image}} 25 | object. If the \code{\link{Image}} object has more than one channel, it 26 | returns the mean for each channel. 27 | } 28 | \examples{ 29 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 30 | mean(balloon) 31 | 32 | } 33 | \seealso{ 34 | \code{\link{Image}} 35 | } 36 | \author{ 37 | Simon Garnier, \email{garnier@njit.edu} 38 | } 39 | -------------------------------------------------------------------------------- /man/mean.list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statistics.R 3 | \name{mean.list} 4 | \alias{mean.list} 5 | \title{Mean of Images in a List} 6 | \usage{ 7 | \method{mean}{list}(x, target = "new", ...) 8 | } 9 | \arguments{ 10 | \item{x}{A list of \code{\link{Image}} objects. All images must have the same 11 | dimensions, number of channels, and bit depth.} 12 | 13 | \item{target}{The location where the results should be stored when passing a 14 | list of images to the function. It can take 3 values: 15 | \describe{ 16 | \item{"new":}{a new \code{\link{Image}} object is created and the results 17 | are stored inside (the default).} 18 | \item{An \code{\link{Image}} object:}{the results are stored in another 19 | existing \code{\link{Image}} object. This is fast but will replace the 20 | content of \code{target}. Note that \code{target} should have the same 21 | dimensions and number of channels as the images in the list, otherwise an 22 | error will be thrown.} 23 | }} 24 | 25 | \item{...}{Further arguments passed to summary methods. Unused if \code{x} is 26 | a list of images.} 27 | } 28 | \value{ 29 | If \code{target="new"}, the function returns an \code{\link{Image}} 30 | object. If \code{target} is an \code{\link{Image}} object, the function 31 | returns nothing and modifies that \code{\link{Image}} object in place. 32 | } 33 | \description{ 34 | Returns the pixelwise mean of \code{\link{Image}} objects stored 35 | in a list. 36 | } 37 | \examples{ 38 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 39 | img_list <- lapply(1:10, function(x) readNext(balloon)) 40 | mean_img <- mean(img_list) 41 | 42 | } 43 | \seealso{ 44 | \code{\link{Image}} 45 | } 46 | \author{ 47 | Simon Garnier, \email{garnier@njit.edu} 48 | } 49 | -------------------------------------------------------------------------------- /man/merge.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{merge} 4 | \alias{merge} 5 | \title{Merge Separate Channels into an Image} 6 | \usage{ 7 | merge(x, target = "new") 8 | } 9 | \arguments{ 10 | \item{x}{A list of single channel (grayscale) \code{\link{Image}} objects.} 11 | 12 | \item{target}{The location where the results should be stored. It can take 2 13 | values: 14 | \describe{ 15 | \item{"new":}{a new \code{\link{Image}} object is created and the results 16 | are stored inside (the default).} 17 | \item{An \code{\link{Image}} object:}{the results are stored in another 18 | existing \code{\link{Image}} object. This is fast but will replace the 19 | content of \code{target}. Note that if \code{target} does not have the 20 | same dimensions as the images in \code{x} and the same number of channels 21 | as the number of images in \code{x}, an error will be thrown.} 22 | }} 23 | } 24 | \value{ 25 | If \code{target="new"}, the function returns an \code{\link{Image}} 26 | object. If \code{target} is an \code{\link{Image}} object, the function 27 | returns nothing and modifies that \code{\link{Image}} object in place. 28 | } 29 | \description{ 30 | \code{merge} returns an image from the combination of grayscale 31 | images corresponding to single channels (green, blue, red, or alpha). 32 | } 33 | \note{ 34 | Color images are usually represented by 3 channels (possibly 4) in the 35 | following order: green (1), blue (2), red (3), and possibly alpha (4). 36 | } 37 | \examples{ 38 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 39 | balloon_chan <- split(balloon) 40 | balloon_merged <- merge(balloon_chan) 41 | 42 | } 43 | \seealso{ 44 | \code{\link{split}}, \code{\link{Image}} 45 | } 46 | \author{ 47 | Simon Garnier, \email{garnier@njit.edu} 48 | } 49 | -------------------------------------------------------------------------------- /man/min.Rcpp_Image.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statistics.R 3 | \name{min.Rcpp_Image} 4 | \alias{min.Rcpp_Image} 5 | \alias{max.Rcpp_Image} 6 | \alias{range.Rcpp_Image} 7 | \title{Maxima and Minima of an Image} 8 | \usage{ 9 | \method{min}{Rcpp_Image}(x, ...) 10 | 11 | \method{max}{Rcpp_Image}(x, ...) 12 | 13 | \method{range}{Rcpp_Image}(x, ...) 14 | } 15 | \arguments{ 16 | \item{x}{An \code{\link{Image}} object.} 17 | 18 | \item{...}{Unused at the moment.} 19 | } 20 | \value{ 21 | \code{min} and \code{max} return a matrix with 1 row and \code{nchan(x)} 22 | columns. \code{range} returns a matrix with 2 rows and \code{nchan(x)} columns. 23 | } 24 | \description{ 25 | Returns the maximum and minimum pixel values of an 26 | \code{\link{Image}} object. If the \code{\link{Image}} object has more than 27 | one channel, it returns the maximum and minimum of each channel. 28 | } 29 | \examples{ 30 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 31 | min(balloon) 32 | max(balloon) 33 | 34 | } 35 | \seealso{ 36 | \code{\link{Image}}, \code{\link{minMaxLoc}}. 37 | } 38 | \author{ 39 | Simon Garnier, \email{garnier@njit.edu} 40 | } 41 | -------------------------------------------------------------------------------- /man/minAreaRect.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shape.R 3 | \name{minAreaRect} 4 | \alias{minAreaRect} 5 | \title{Fit a Rectangle Around a Set of 2D Points} 6 | \usage{ 7 | minAreaRect(x, y) 8 | } 9 | \arguments{ 10 | \item{x}{A vector of x coordinates.} 11 | 12 | \item{y}{A vector of y coordinates of the same lenght as \code{x}.} 13 | } 14 | \value{ 15 | A list containing the height and width (in pixels) of the ellipse, 16 | the angle (in degrees) of its main axis with respect to the x axis, and the 17 | x and y coordinates of its center. 18 | } 19 | \description{ 20 | \code{minAreaRect} calculates the minimum area enclosing 21 | rectangle that fits a set of 2D points. 22 | } 23 | \examples{ 24 | minAreaRect(rnorm(100), rnorm(100)) 25 | 26 | } 27 | \seealso{ 28 | \code{\link{fitEllipse}}, \code{\link{boxPoints}} 29 | } 30 | \author{ 31 | Simon Garnier, \email{garnier@njit.edu} 32 | } 33 | -------------------------------------------------------------------------------- /man/minMaxLoc.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statistics.R 3 | \name{minMaxLoc} 4 | \alias{minMaxLoc} 5 | \title{Coordinates of the Maxima and Minima of an Image} 6 | \usage{ 7 | minMaxLoc(x, mask = NULL) 8 | } 9 | \arguments{ 10 | \item{x}{An \code{\link{Image}} object.} 11 | 12 | \item{mask}{A single-channel (GRAY) 8-bit (8U) \code{\link{Image}} object 13 | with the same dimensions as \code{x}. This can be used to mask out pixels 14 | that should not be considered when calculating the minima and maxima (pixels 15 | set to 0 in the mask will be ignored during the calculation).} 16 | } 17 | \value{ 18 | A matrix (or a list of matrices for multi-channels images). 19 | } 20 | \description{ 21 | \code{minMaxLoc} returns the maximum and minimum pixel values of 22 | an \code{\link{Image}} object, as well as their coordinates in the image. If 23 | the \code{\link{Image}} object has more than one channel, it returns the 24 | values for each channel. 25 | } 26 | \examples{ 27 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 28 | minMaxLoc(balloon) 29 | 30 | } 31 | \seealso{ 32 | \code{\link{Image}}, \code{\link{min.Rcpp_Image}}, 33 | \code{\link{max.Rcpp_Image}}. 34 | } 35 | \author{ 36 | Simon Garnier, \email{garnier@njit.edu} 37 | } 38 | -------------------------------------------------------------------------------- /man/moments.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shape.R 3 | \name{moments} 4 | \alias{moments} 5 | \title{Calculate the Moments of a Shape} 6 | \usage{ 7 | moments(x, binary = FALSE) 8 | } 9 | \arguments{ 10 | \item{x}{Either a Nx2 matrix of the X-Y coordinates of a polygon (e.g., a 11 | contour produced by \code{\link{findContours}}), or a single-channel 12 | \code{\link{Image}} object.} 13 | 14 | \item{binary}{If set to TRUE (default: FALSE), all non-zero image pixels are 15 | treated as 1's. The parameter is used for images only.} 16 | } 17 | \value{ 18 | A data frame with 2 columns: 19 | \describe{ 20 | \item{"moment": }{the name of the moment. See Note below.} 21 | \item{"value": }{the value of the moment.} 22 | } 23 | } 24 | \description{ 25 | \code{moments} calculates all of the moments up to the third 26 | order of a polygon or rasterized shape. 27 | } 28 | \note{ 29 | The spatial moments \eqn{m_{ji}} are computed as: 30 | \deqn{m_{ji}= \sum _{x,y} \left ( \texttt{contour} (x,y) \cdot x^j \cdot y^i \right )} 31 | 32 | The central moments \eqn{\mu_{ji}} are computed as: 33 | \deqn{{\mu_{ji}}= \sum _{x,y} \left ( \texttt{contour} (x,y) \cdot (x - \bar{x} )^j \cdot (y - \bar{y} )^i \right )} 34 | where \eqn{(\bar{x}, \bar{y})} is the mass center: 35 | \deqn{\bar{x} = \frac{m_{10}}{m_{00}} , \; \bar{y} = \frac{m_{01}}{m_{00}}} 36 | 37 | The normalized central moments \eqn{\eta_{ji}} are computed as: 38 | \deqn{\eta_{ji}= \frac{\mu_{ji}}{m_{00}^{(i+j)/2+1}} .} 39 | } 40 | \examples{ 41 | dots <- image(system.file("sample_img/dots.jpg", package = "Rvision")) 42 | dots_gray <- changeColorSpace(dots, "GRAY") 43 | dots_bin <- dots_gray < 200 44 | contours <- findContours(dots_bin) 45 | contour0 <- contours$contours[contours$contours[, 1] == 0, 2:3] 46 | moments(contour0) 47 | 48 | } 49 | \seealso{ 50 | \code{\link{findContours}}, \code{\link{huInvariants}} 51 | } 52 | \author{ 53 | Simon Garnier, \email{garnier@njit.edu} 54 | } 55 | -------------------------------------------------------------------------------- /man/newDisplay.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/display.R 3 | \name{newDisplay} 4 | \alias{newDisplay} 5 | \title{Open New \code{\link{Image}} Display} 6 | \usage{ 7 | newDisplay(window_name = "Display", height = 480, width = 640) 8 | } 9 | \arguments{ 10 | \item{window_name}{A character string representing the name of the display 11 | window (default: "Display").} 12 | 13 | \item{height}{An integer representing the height in pixels of the display 14 | window.} 15 | 16 | \item{width}{An integer representing the width in pixels of the display 17 | window.} 18 | } 19 | \value{ 20 | This function does not return anything. 21 | } 22 | \description{ 23 | \code{newDisplay} creates a window to display \code{\link{Image}} 24 | objects. 25 | } 26 | \examples{ 27 | \dontrun{ 28 | newDisplay() 29 | } 30 | 31 | } 32 | \seealso{ 33 | \code{\link{Image}}, \code{\link{display}}, \code{\link{destroyDisplay}} 34 | } 35 | \author{ 36 | Simon Garnier, \email{garnier@njit.edu} 37 | } 38 | -------------------------------------------------------------------------------- /man/nrow.Rcpp_Image.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{nrow.Rcpp_Image} 4 | \alias{nrow.Rcpp_Image} 5 | \alias{nrow.Image} 6 | \alias{ncol.Rcpp_Image} 7 | \alias{ncol.Image} 8 | \alias{nchan} 9 | \title{The Number of Rows/Columns/Channels of an Image} 10 | \usage{ 11 | nrow.Rcpp_Image(x) 12 | ncol.Rcpp_Image(x) 13 | nchan(x) 14 | } 15 | \arguments{ 16 | \item{x}{An \code{\link{Image}} object.} 17 | } 18 | \value{ 19 | A numeric value. 20 | } 21 | \description{ 22 | nrow, ncol and nchan return the number of rows, columns or 23 | channels present in an \code{\link{Image}} object. 24 | } 25 | \examples{ 26 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 27 | nrow(balloon) 28 | ncol(balloon) 29 | nchan(balloon) 30 | 31 | } 32 | \seealso{ 33 | \code{\link[=dim.Rcpp_Image]{dim}} which returns \emph{all} 34 | dimensions. 35 | } 36 | \author{ 37 | Simon Garnier, \email{garnier@njit.edu} 38 | } 39 | -------------------------------------------------------------------------------- /man/ones.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{ones} 4 | \alias{ones} 5 | \title{Create a One-Filled Image} 6 | \usage{ 7 | ones(nrow, ncol, nchan = 3, bitdepth = "8U", colorspace = "BGR") 8 | } 9 | \arguments{ 10 | \item{nrow}{An integer indicating desired the number of rows for the image.} 11 | 12 | \item{ncol}{An integer indicating desired the number of columns for the image.} 13 | 14 | \item{nchan}{An integer indicating the desired number of channels for the image.} 15 | 16 | \item{bitdepth}{A string indicating the desired bit depth for the image. 17 | Options are "8U" (the default), "8S", "16U", "16S", "32S", "32F", and "64F".} 18 | 19 | \item{colorspace}{A string indicating the desired color space for the image.} 20 | } 21 | \value{ 22 | An \code{\link{Image}} object. 23 | } 24 | \description{ 25 | \code{ones} creates an \code{\link{Image}} object filled with 26 | ones. 27 | } 28 | \examples{ 29 | one <- ones(100, 100) 30 | 31 | } 32 | \seealso{ 33 | \code{\link{Image}}, \code{\link{zeros}} 34 | } 35 | \author{ 36 | Simon Garnier, \email{garnier@njit.edu} 37 | } 38 | -------------------------------------------------------------------------------- /man/pget.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{pget} 4 | \alias{pget} 5 | \title{Return Pixel Value at Specified Locations} 6 | \usage{ 7 | pget(image, x, y) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{x}{A vector of x locations (columns) in the image.} 13 | 14 | \item{y}{A vector of y locations (rows) in the image.} 15 | } 16 | \value{ 17 | A matrix. The number of columns of the matrix depends on the number 18 | of channels in the image. Each row corresponds to a pair of x/y coordinates. 19 | } 20 | \description{ 21 | \code{pget} returns the values of the pixels at the specified x 22 | and y coordinates in the image. 23 | } 24 | \examples{ 25 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 26 | pget(balloon, c(1, 100, 200), c(200, 100, 1)) 27 | 28 | } 29 | \seealso{ 30 | \code{\link{Image}} 31 | } 32 | \author{ 33 | Simon Garnier, \email{garnier@njit.edu} 34 | } 35 | -------------------------------------------------------------------------------- /man/pixelsInContour.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shape.R 3 | \name{pixelsInContour} 4 | \alias{pixelsInContour} 5 | \title{Which Pixels are Inside a Contour} 6 | \usage{ 7 | pixelsInContour(contours, id = NULL) 8 | } 9 | \arguments{ 10 | \item{contours}{A list of two matrices as produced by \code{\link{findContours}}.} 11 | 12 | \item{id}{An optional vector indicating the identity of the specific contours 13 | for which to run the function.} 14 | } 15 | \value{ 16 | A matrix with 3 columns: 17 | \describe{ 18 | \item{"id": }{the contour identity (indicates the set of points belonging 19 | to the same contour).} 20 | \item{"x": }{the x coordinates of the points inside the contour.} 21 | \item{"y": }{the y coordinates of the points inside the contour.} 22 | } 23 | } 24 | \description{ 25 | \code{pixelsInContour} determines the pixels that are inside a 26 | specified contour. 27 | } 28 | \examples{ 29 | dots <- image(system.file("sample_img/dots.jpg", package = "Rvision")) 30 | dots_gray <- changeColorSpace(dots, "GRAY") 31 | dots_bin <- dots_gray < 200 32 | contours <- findContours(dots_bin) 33 | pixelsInContour(contours, id = c(3, 5)) 34 | 35 | } 36 | \seealso{ 37 | \code{\link{findContours}} 38 | } 39 | \author{ 40 | Simon Garnier, \email{garnier@njit.edu} 41 | } 42 | -------------------------------------------------------------------------------- /man/plot.Image.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{plot.Image} 4 | \alias{plot.Image} 5 | \alias{plot.Rcpp_Image} 6 | \title{Plot \pkg{Rvision} Images} 7 | \usage{ 8 | \method{plot}{Rcpp_Image}(x, ...) 9 | } 10 | \arguments{ 11 | \item{x}{An \code{\link{Image}} object.} 12 | 13 | \item{...}{Additional arguments to be passed to \code{\link{rasterImage}}.} 14 | } 15 | \description{ 16 | Plotting method for objects inheriting from class \code{\link{Image}}. 17 | } 18 | \examples{ 19 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 20 | plot(balloon) 21 | 22 | } 23 | \seealso{ 24 | \code{\link{Image}} 25 | } 26 | \author{ 27 | Simon Garnier, \email{garnier@njit.edu} 28 | } 29 | -------------------------------------------------------------------------------- /man/plot.blob.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/blob.R 3 | \name{plot.blob} 4 | \alias{plot.blob} 5 | \title{Plot Blobs} 6 | \usage{ 7 | \method{plot}{blob}(x, col = "red", asp = 1, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{blob} object.} 11 | 12 | \item{col}{The color of the \code{blob} center and box (default: "red").} 13 | 14 | \item{asp}{The y/x aspect ratio of the plotting window (default: 1).} 15 | 16 | \item{...}{Additional arguments to be passed to \code{\link{plot}}.} 17 | } 18 | \description{ 19 | Plotting method for objects inheriting from class \code{blob}. 20 | } 21 | \examples{ 22 | dots <- image(system.file("sample_img/dots.jpg", package = "Rvision")) 23 | blobs <- simpleBlobDetector(invert(dots), min_threshold = 25, max_threshold = 220, 24 | filter_by_area = TRUE, min_area = 200, max_area = Inf, 25 | filter_by_color = FALSE) 26 | plot(dots) 27 | plot(blobs, pch = 20) 28 | 29 | } 30 | \seealso{ 31 | \code{\link{isBlob}}, \code{\link{simpleBlobDetector}} 32 | } 33 | \author{ 34 | Simon Garnier, \email{garnier@njit.edu} 35 | } 36 | -------------------------------------------------------------------------------- /man/plotOF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/opticalFlow.R 3 | \name{plotOF} 4 | \alias{plotOF} 5 | \title{Plot Optical Flow Arrays} 6 | \usage{ 7 | plotOF( 8 | of, 9 | gridsize = c(25, 25), 10 | thresh = 0, 11 | add = TRUE, 12 | arrow.ex = 0.05, 13 | xpd = TRUE, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{of}{An \code{\link{Image}} produced by the \code{\link{farneback}} 19 | function.} 20 | 21 | \item{gridsize}{A 2-element vector indicating the number of optical flow 22 | vectors to plot in each x-y dimension (default: c(25, 25)). Alternatively, a 23 | numeric value that will be used for both dimensions.} 24 | 25 | \item{thresh}{The minimal length of optical flow vectors that should be 26 | plotted (default: 0).} 27 | 28 | \item{add}{A logical indicating whether to plot the vector field over an 29 | existing plot (default: FALSE).} 30 | 31 | \item{arrow.ex}{Controls the length of the arrows. The length is in terms of 32 | the fraction of the shorter axis in the plot. So with a default of .05, 20 33 | arrows of maximum length can line up end to end along the shorter axis.} 34 | 35 | \item{xpd}{If true does not clip arrows to fit inside the plot region, 36 | default is not to clip.} 37 | 38 | \item{...}{Graphics arguments passed to the \code{\link{arrows}} function that 39 | can change the color or arrow sizes. See \code{\link{arrows}} help for details.} 40 | } 41 | \description{ 42 | Plotting method for \code{\link{Image}} objects produced by the 43 | \code{\link{farneback}} function. 44 | } 45 | \examples{ 46 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 47 | balloon1 <- readFrame(balloon, 1) 48 | balloon2 <- readFrame(balloon, 2) 49 | changeColorSpace(balloon1, "GRAY", "self") 50 | changeColorSpace(balloon2, "GRAY", "self") 51 | of <- farneback(balloon1, balloon2) 52 | plot(of) 53 | plotOF(of, length = 0.05) 54 | 55 | } 56 | \seealso{ 57 | \code{\link{farneback}}, \code{\link{arrows}} 58 | } 59 | \author{ 60 | Simon Garnier, \email{garnier@njit.edu} 61 | } 62 | -------------------------------------------------------------------------------- /man/pow.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/arithmetic.R 3 | \name{pow} 4 | \alias{pow} 5 | \title{Power Function} 6 | \usage{ 7 | pow(x, y = 2, target = "new") 8 | } 9 | \arguments{ 10 | \item{x}{A 32- or 64-bit (32F or 64F) \code{\link{Image}} object.} 11 | 12 | \item{y}{A numeric value representing the exponent of power. Note that for 13 | a non-integer power exponent, the absolute values of the \code{\link{Image}} 14 | object are used.} 15 | 16 | \item{target}{The location where the results should be stored when passing a 17 | sum of images to the function. It can take 3 values: 18 | \describe{ 19 | \item{"new":}{a new \code{\link{Image}} object is created and the results 20 | are stored inside (the default).} 21 | \item{"self":}{the results are stored back into \code{x} (faster but 22 | destructive).} 23 | \item{An \code{\link{Image}} object:}{the results are stored in another 24 | existing \code{\link{Image}} object. This is fast but will replace the 25 | content of \code{target}. Note that \code{target} should have the same 26 | dimensions, bitdepth, and number of channels as \code{x}, otherwise an 27 | error will be thrown.} 28 | }} 29 | } 30 | \value{ 31 | If \code{target="new"}, the function returns an \code{\link{Image}} 32 | object. If \code{target="self"}, the function returns nothing and modifies 33 | \code{x} in place. If \code{target} is an \code{\link{Image}} object, the 34 | function returns nothing and modifies that \code{\link{Image}} object in 35 | place. 36 | } 37 | \description{ 38 | \code{pow} raises every element of an \code{\link{Image}} object 39 | to a power. 40 | } 41 | \examples{ 42 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 43 | changeBitDepth(balloon, "32F", 1 , "self") 44 | pow(balloon, 2) 45 | 46 | } 47 | \seealso{ 48 | \code{\link{exp}}, \code{\link{log}}, \code{\link{sqrt}} 49 | } 50 | \author{ 51 | Simon Garnier, \email{garnier@njit.edu} 52 | } 53 | -------------------------------------------------------------------------------- /man/pset.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{pset} 4 | \alias{pset} 5 | \title{Set Pixel Value at Specified Locations} 6 | \usage{ 7 | pset(image, x, y, color) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{x}{A vector of x locations (columns) in the image.} 13 | 14 | \item{y}{A vector of y locations (rows) in the image.} 15 | 16 | \item{color}{A value or vector of any kind of R color specification compatible 17 | with \code{\link{col2bgr}}. It can also be a matrix with the same number of 18 | columns as the number of elements in \code{x} and the same number of rows as 19 | the number of channels in \code{image}.} 20 | } 21 | \value{ 22 | This functions returns nothing and changes the values of the pixels 23 | in \code{image} in place. 24 | } 25 | \description{ 26 | \code{pset} sets the values of the pixels at the specified x 27 | and y coordinates in the image. 28 | } 29 | \examples{ 30 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 31 | pset(balloon, 1:100, 200:101, "red") 32 | 33 | } 34 | \seealso{ 35 | \code{\link{Image}} 36 | } 37 | \author{ 38 | Simon Garnier, \email{garnier@njit.edu} 39 | } 40 | -------------------------------------------------------------------------------- /man/pyrDown.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/filters.R 3 | \name{pyrDown} 4 | \alias{pyrDown} 5 | \title{Pyramid Downsampling} 6 | \usage{ 7 | pyrDown(image, target = "new") 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{target}{The location where the results should be stored. It can take 2 13 | values: 14 | \describe{ 15 | \item{"new":}{a new \code{\link{Image}} object is created and the results 16 | are stored inside (the default).} 17 | \item{An \code{\link{Image}} object:}{the results are stored in another 18 | existing \code{\link{Image}} object. This is fast and will not replace the 19 | content of \code{image} but will replace that of \code{target}. Note that 20 | if \code{target} does not have the same number of channels, and bit depth 21 | as \code{image}, an error may be thrown. The dimensions of \code{target} 22 | must satisfy the following conditions: 23 | \itemize{ 24 | \item{\code{ abs(ncol(target) * 2 - ncol(image)) <= 2 }} 25 | \item{\code{ abs(nrow(target) * 2 - nrow(image)) <= 2 }} 26 | } 27 | } 28 | }} 29 | } 30 | \value{ 31 | If \code{target="new"}, the function returns an \code{\link{Image}} 32 | object. If \code{target} is an \code{\link{Image}} object, the function 33 | returns nothing and modifies that \code{\link{Image}} object in place. 34 | } 35 | \description{ 36 | \code{prDown} blurs an image and then downsamples it. 37 | } 38 | \examples{ 39 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 40 | small_balloon <- pyrDown(balloon) 41 | 42 | } 43 | \seealso{ 44 | \code{\link{pyrUp}} 45 | } 46 | \author{ 47 | Simon Garnier, \email{garnier@njit.edu} 48 | } 49 | -------------------------------------------------------------------------------- /man/pyrUp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/filters.R 3 | \name{pyrUp} 4 | \alias{pyrUp} 5 | \title{Pyramid Upsampling} 6 | \usage{ 7 | pyrUp(image, target = "new") 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{target}{The location where the results should be stored. It can take 2 13 | values: 14 | \describe{ 15 | \item{"new":}{a new \code{\link{Image}} object is created and the results 16 | are stored inside (the default).} 17 | \item{An \code{\link{Image}} object:}{the results are stored in another 18 | existing \code{\link{Image}} object. This is fast and will not replace the 19 | content of \code{image} but will replace that of \code{target}. Note that 20 | if \code{target} does not have the same number of channels, and bit depth 21 | as \code{image}, an error may be thrown. The dimensions of \code{target} 22 | must satisfy the following conditions: 23 | \itemize{ 24 | \item{\code{ abs(ncol(target) - ncol(image) * 2) <= ncol(target) \%\% 2 }} 25 | \item{\code{ abs(nrow(target) - nrow(image) * 2) <= nrow(target) \%\% 2 }} 26 | } 27 | } 28 | }} 29 | } 30 | \value{ 31 | If \code{target="new"}, the function returns an \code{\link{Image}} 32 | object. If \code{target} is an \code{\link{Image}} object, the function 33 | returns nothing and modifies that \code{\link{Image}} object in place. 34 | } 35 | \description{ 36 | \code{prUp} upsamples an image and then blurs it. 37 | } 38 | \examples{ 39 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 40 | big_balloon <- pyrUp(balloon) 41 | 42 | } 43 | \seealso{ 44 | \code{\link{pyrDown}} 45 | } 46 | \author{ 47 | Simon Garnier, \email{garnier@njit.edu} 48 | } 49 | -------------------------------------------------------------------------------- /man/queue_dimensions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/QueueClass.R 3 | \name{nrow.Rcpp_Queue} 4 | \alias{nrow.Rcpp_Queue} 5 | \alias{ncol.Rcpp_Queue} 6 | \alias{length.Rcpp_Queue} 7 | \title{The Number of Rows/Columns and Length of a Queue} 8 | \usage{ 9 | nrow.Rcpp_Queue(x) 10 | 11 | ncol.Rcpp_Queue(x) 12 | 13 | \method{length}{Rcpp_Queue}(x) 14 | } 15 | \arguments{ 16 | \item{x}{A \code{\link{Queue}} object.} 17 | } 18 | \value{ 19 | A numeric value. 20 | } 21 | \description{ 22 | nrow, ncol and nframes return the number of rows, columns or 23 | frames present in a \code{\link{Queue}} object. 24 | } 25 | \examples{ 26 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 27 | buf <- queue(balloon) 28 | nrow(buf) 29 | ncol(buf) 30 | length(buf) 31 | 32 | } 33 | \seealso{ 34 | \code{\link[=dim.Rcpp_Queue]{dim}} which returns \emph{all} 35 | dimensions. 36 | } 37 | \author{ 38 | Simon Garnier, \email{garnier@njit.edu} 39 | } 40 | -------------------------------------------------------------------------------- /man/randn.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{randn} 4 | \alias{randn} 5 | \title{Random Normal Image} 6 | \usage{ 7 | randn(image, mean = 127, sd = 1) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{mean}{A vector indicating the mean value (expectation) of the generated 13 | random numbers. It can have as many elements as the number of channels in 14 | the image. If it has less elements than the number of channels, it is 15 | recycled to match the number of channels. If it has more elements than the 16 | number of channels, the extra elements are ignored without warning (default: 17 | 0).} 18 | 19 | \item{sd}{A vector indicating the standard deviation of the generated 20 | random numbers. It can have as many elements as the number of channels in 21 | the image. If it has less elements than the number of channels, it is 22 | recycled to match the number of channels. If it has more elements than the 23 | number of channels, the extra elements are ignored without warning (default: 24 | 256).} 25 | } 26 | \value{ 27 | This function returns nothing and modifies image in place. 28 | } 29 | \description{ 30 | \code{randn} replaces the content of an \code{\link{Image}} 31 | object with normally-distributed random pixel values. 32 | } 33 | \examples{ 34 | rnd <- zeros(100, 100) 35 | randn(rnd) 36 | 37 | } 38 | \seealso{ 39 | \code{\link{Image}}, \code{\link{randu}} 40 | } 41 | \author{ 42 | Simon Garnier, \email{garnier@njit.edu} 43 | } 44 | -------------------------------------------------------------------------------- /man/randu.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{randu} 4 | \alias{randu} 5 | \title{Random Uniform Image} 6 | \usage{ 7 | randu(image, low = 0, high = 256) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{low}{A vector indicating the inclusive lower boundary of the generated 13 | random numbers. It can have as many elements as the number of channels in 14 | the image. If it has less elements than the number of channels, it is 15 | recycled to match the number of channels. If it has more elements than the 16 | number of channels, the extra elements are ignored without warning (default: 17 | 0).} 18 | 19 | \item{high}{A vector indicating the exclusive upper boundary of the generated 20 | random numbers. It can have as many elements as the number of channels in 21 | the image. If it has less elements than the number of channels, it is 22 | recycled to match the number of channels. If it has more elements than the 23 | number of channels, the extra elements are ignored without warning (default: 24 | 256).} 25 | } 26 | \value{ 27 | This function returns nothing and modifies image in place. 28 | } 29 | \description{ 30 | \code{randu} replaces the content of an \code{\link{Image}} 31 | object with uniformly-distributed random pixel values. 32 | } 33 | \examples{ 34 | rnd <- zeros(100, 100) 35 | randu(rnd) 36 | 37 | } 38 | \seealso{ 39 | \code{\link{Image}}, \code{\link{randn}} 40 | } 41 | \author{ 42 | Simon Garnier, \email{garnier@njit.edu} 43 | } 44 | -------------------------------------------------------------------------------- /man/readFrame.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoClass.R, R/VideoStackClass.R, R/generic.R 3 | \name{readFrame.Rcpp_Video} 4 | \alias{readFrame.Rcpp_Video} 5 | \alias{readFrame.VideoStack} 6 | \alias{readFrame} 7 | \title{Read Specific Video Frame} 8 | \usage{ 9 | \method{readFrame}{Rcpp_Video}(x, pos, target = "new") 10 | 11 | \method{readFrame}{VideoStack}(x, pos, target = "new") 12 | 13 | readFrame(x, pos, target = "new") 14 | } 15 | \arguments{ 16 | \item{x}{A \code{\link{Video}} or \code{\link{VideoStack}} object.} 17 | 18 | \item{pos}{An integer corresponding to the position of the frame to read in 19 | the video or video stack.} 20 | 21 | \item{target}{The location where the results should be stored. It can take 2 22 | values: 23 | \describe{ 24 | \item{"new":}{a new \code{\link{Image}} object is created and the results 25 | are stored inside (the default).} 26 | \item{An \code{\link{Image}} object:}{the results are stored in another 27 | existing \code{\link{Image}} object. This will replace the content of 28 | \code{target}. Note that \code{target} must have the same dimensions as 29 | \code{x}.} 30 | }} 31 | } 32 | \value{ 33 | If \code{target="new"}, the function returns an \code{\link{Image}} 34 | object. If \code{target} is an \code{\link{Image}} object, the function 35 | returns nothing and modifies that \code{\link{Image}} object in place. 36 | } 37 | \description{ 38 | Read a specific frame of a \code{\link{Video}} or 39 | \code{\link{VideoStack}} object and returns it as an \code{\link{Image}} 40 | object. 41 | } 42 | \examples{ 43 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 44 | frame10 <- readFrame(balloon, 10) 45 | 46 | } 47 | \seealso{ 48 | \code{\link{Video}}, \code{\link{VideoStack}}, \code{\link{Image}}, 49 | \code{\link{readNext}} 50 | } 51 | \author{ 52 | Simon Garnier, \email{garnier@njit.edu} 53 | } 54 | -------------------------------------------------------------------------------- /man/readHIS.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{readHIS} 4 | \alias{readHIS} 5 | \title{Read HIS Image from Varex Imaging X-ray Panels} 6 | \usage{ 7 | readHIS(x) 8 | } 9 | \arguments{ 10 | \item{x}{A character string naming the path to a HIS binary image file.} 11 | } 12 | \value{ 13 | A 16U grayscale \code{\link{Image}} object. 14 | } 15 | \description{ 16 | \code{readHIS} reads HIS binary files produced by the X-ray 17 | panels from Varex Imaging and returns \code{\link{Image}} objects that can 18 | be processed by this package. 19 | } 20 | \examples{ 21 | #TODO 22 | 23 | } 24 | \seealso{ 25 | \code{\link{Image}} 26 | } 27 | \author{ 28 | Simon Garnier, \email{garnier@njit.edu} 29 | } 30 | -------------------------------------------------------------------------------- /man/readMulti.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{readMulti} 4 | \alias{readMulti} 5 | \title{Read a Multi-Page Image} 6 | \usage{ 7 | readMulti(x, colorspace = "BGR") 8 | } 9 | \arguments{ 10 | \item{x}{A character string naming the path to a multi-page image file.} 11 | 12 | \item{colorspace}{A string indicating the desired color space for the images.} 13 | } 14 | \value{ 15 | A list of \code{\link{Image}} objects. 16 | } 17 | \description{ 18 | \code{readMulti} reads a multi-page image and returns a list of 19 | \code{\link{Image}} objects, each corresponding to a different page. 20 | } 21 | \examples{ 22 | balloon <- readMulti(system.file("sample_img/multipage.tif", package = "Rvision")) 23 | 24 | } 25 | \seealso{ 26 | \code{\link{Image}} 27 | } 28 | \author{ 29 | Simon Garnier, \email{garnier@njit.edu} 30 | } 31 | -------------------------------------------------------------------------------- /man/release.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/QueueClass.R, R/StreamClass.R, R/VideoClass.R, 3 | % R/VideoStackClass.R, R/VideoWriterClass.R, R/generic.R 4 | \name{release.Rcpp_Queue} 5 | \alias{release.Rcpp_Queue} 6 | \alias{release.Rcpp_Stream} 7 | \alias{release.Rcpp_Video} 8 | \alias{release.VideoStack} 9 | \alias{release.Rcpp_VideoWriter} 10 | \alias{release} 11 | \title{Release Object from Memory} 12 | \usage{ 13 | \method{release}{Rcpp_Queue}(x) 14 | 15 | \method{release}{Rcpp_Stream}(x) 16 | 17 | \method{release}{Rcpp_Video}(x) 18 | 19 | \method{release}{VideoStack}(x) 20 | 21 | \method{release}{Rcpp_VideoWriter}(x) 22 | 23 | release(x) 24 | } 25 | \arguments{ 26 | \item{x}{A \code{\link{Video}}, \code{\link{VideoStack}}, 27 | \code{\link{Stream}}, \code{\link{VideoWriter}}, or \code{\link{Queue}} 28 | object.} 29 | } 30 | \value{ 31 | If successful, the object is cleared from memory 32 | } 33 | \description{ 34 | Close a \code{\link{Video}}, \code{\link{VideoStack}}, 35 | \code{\link{Stream}}, \code{\link{VideoWriter}}, or \code{\link{Queue}} 36 | object. 37 | } 38 | \examples{ 39 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 40 | release(balloon) 41 | 42 | } 43 | \seealso{ 44 | \code{\link{Video}}, \code{\link{VideoStack}}, \code{\link{Stream}}, 45 | \code{\link{VideoWriter}}, \code{\link{Queue}} 46 | } 47 | \author{ 48 | Simon Garnier, \email{garnier@njit.edu} 49 | } 50 | -------------------------------------------------------------------------------- /man/reset.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/QueueClass.R 3 | \name{reset} 4 | \alias{reset} 5 | \title{Reset a Queue} 6 | \usage{ 7 | reset(x) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{\link{Queue}} object.} 11 | } 12 | \value{ 13 | This function returns nothing. 14 | } 15 | \description{ 16 | \code{reset} flush a \code{\link{Queue}} object from all the 17 | frames it contains and starts filling it up again with new frames. 18 | } 19 | \examples{ 20 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 21 | buf <- queue(balloon) 22 | reset(buf) 23 | 24 | } 25 | \seealso{ 26 | \code{\link{Queue}}, \code{\link{queue}} 27 | } 28 | \author{ 29 | Simon Garnier, \email{garnier@njit.edu} 30 | } 31 | -------------------------------------------------------------------------------- /man/rotate.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/transform.R 3 | \name{rotate} 4 | \alias{rotate} 5 | \title{Image Rotation In 90-Degree Increments} 6 | \usage{ 7 | rotate(image, rotation = "CLOCKWISE", target = "new") 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{rotation}{A character string indicating the desired rotation: 13 | \describe{ 14 | \item{"CLOCKWISE" (default):}{rotate by 90 degrees clockwise.} 15 | \item{"COUNTER":}{rotate by 90 degrees counterclockwise.} 16 | \item{"180":}{rotate by 180 degrees.} 17 | }} 18 | 19 | \item{target}{The location where the results should be stored. It can take 3 20 | values: 21 | \describe{ 22 | \item{"new":}{a new \code{\link{Image}} object is created and the results 23 | are stored inside (the default).} 24 | \item{An \code{\link{Image}} object:}{the results are stored in another 25 | existing \code{\link{Image}} object. This is fast and will not replace the 26 | content of \code{image} but will replace that of \code{target}. Note that 27 | \code{target} must have the same bit depth and number of channels as 28 | \code{image}. The dimensions must be the same if \code{rotation="CLOCKWISE"}, 29 | or inverted if \code{rotation="CLOCKWISE"} or \code{rotation="COUNTER"}.} 30 | }} 31 | } 32 | \value{ 33 | If \code{target="new"}, the function returns an \code{\link{Image}} 34 | object. If \code{target} is an \code{\link{Image}} object, the function 35 | returns nothing and modifies that \code{\link{Image}} object in place. 36 | } 37 | \description{ 38 | \code{rotate} rotates an image in multiples of 90 degrees. 39 | } 40 | \examples{ 41 | img <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 42 | img_rotated <- rotate(img) 43 | 44 | } 45 | \seealso{ 46 | \code{\link{rotateScale}} 47 | } 48 | \author{ 49 | Simon Garnier, \email{garnier@njit.edu} 50 | } 51 | -------------------------------------------------------------------------------- /man/rotateScale.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/transform.R 3 | \name{rotateScale} 4 | \alias{rotateScale} 5 | \title{Image Rotation and Scaling} 6 | \usage{ 7 | rotateScale( 8 | image, 9 | center = (dim(image)[2:1] - 1)/2, 10 | angle = 90, 11 | scale = 1, 12 | ... 13 | ) 14 | } 15 | \arguments{ 16 | \item{image}{An \code{\link{Image}} object.} 17 | 18 | \item{center}{A 2-elements vector indicating the location (row, column) of 19 | the center of the rotation in the source image. It defaults to the center of 20 | the image.} 21 | 22 | \item{angle}{A numeric value indicating the rotation angle in degrees 23 | (default: 90).} 24 | 25 | \item{scale}{A numeric value indicating an isotropic scale factor (default: 1).} 26 | 27 | \item{...}{Additional parameters for the \code{\link{warpAffine}} function.} 28 | } 29 | \value{ 30 | An \code{\link{Image}} object. 31 | } 32 | \description{ 33 | \code{rotateScale} rotates (clockwise) and scales an image using 34 | the \code{\link{warpAffine}} function. 35 | } 36 | \examples{ 37 | img <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 38 | img_rotated <- rotateScale(img, c(50, 50), 45, 1) 39 | 40 | } 41 | \seealso{ 42 | \code{\link{warpAffine}} 43 | } 44 | \author{ 45 | Simon Garnier, \email{garnier@njit.edu} 46 | } 47 | -------------------------------------------------------------------------------- /man/selectROI.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/display.R 3 | \name{selectROI} 4 | \alias{selectROI} 5 | \title{Select a Region of Interest in an Image} 6 | \usage{ 7 | selectROI(image, window_name = "Display", scale = 1, return_mask = TRUE) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{window_name}{A character string representing the name of the display 13 | window (default: "Display").} 14 | 15 | \item{scale}{The scaling of the display relative to the image size (default: 1).} 16 | 17 | \item{return_mask}{Should the function return a mask of the ROI. The mask is 18 | an 8-bit single-channel image with the pixels inside the ROI painted white 19 | and the pixels outside the ROI painted black (default: TRUE).} 20 | } 21 | \value{ 22 | If \code{return_mask == FALSE}, a data frame with the following two 23 | columns: 24 | \describe{ 25 | \item{x: }{the x coordinates of the ROI polygon.} 26 | \item{y: }{the y coordinates of the ROI polygon.} 27 | } 28 | If \code{return_mask == TRUE}, a list containing the data frame containing 29 | the coordinates of the ROIand an 8-bit single-channel image corresponding to 30 | the mask of the ROI. 31 | } 32 | \description{ 33 | \code{selectROI} allows the user to select a region of interest 34 | (ROI) in an image. An ROI is a polygonal region selected by clicking on the 35 | locations of the vertices of the polygon. 36 | } 37 | \examples{ 38 | \dontrun{ 39 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 40 | selectROI(balloon) 41 | } 42 | 43 | } 44 | \seealso{ 45 | \code{\link{Image}}, \code{\link{newDisplay}}, \code{\link{display}}, 46 | \code{\link{click}} 47 | } 48 | \author{ 49 | Simon Garnier, \email{garnier@njit.edu} 50 | } 51 | -------------------------------------------------------------------------------- /man/setTo.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/draw.R 3 | \name{setTo} 4 | \alias{setTo} 5 | \title{Set All or Some of an Image to the Specified Value} 6 | \usage{ 7 | setTo(image, mask, color = "red", target = "new", in_place = NULL) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{mask}{An 8U, single-channel \code{\link{Image}} object. The region to 13 | be colored should be non-zero.} 14 | 15 | \item{color}{A value or vector of any kind of R color specification compatible 16 | with \code{\link{col2bgr}} representing the color of each rectangle's outline 17 | (default: "red").} 18 | 19 | \item{target}{The location where the results should be stored. It can take 2 20 | values: 21 | \describe{ 22 | \item{"new":}{a new \code{\link{Image}} object is created and the results 23 | are stored inside (the default).} 24 | \item{"self":}{the results are stored back into \code{image} (faster but 25 | destructive).} 26 | }} 27 | 28 | \item{in_place}{Deprecated. Use \code{target} instead.} 29 | } 30 | \value{ 31 | If \code{target="new"}, the function returns an \code{\link{Image}} 32 | object. If \code{target="self"}, the function returns nothing and modifies 33 | \code{image} in place. 34 | } 35 | \description{ 36 | If a mask is specified, \code{setTo} sets the color of the 37 | parts of an image corresponding to the white parts of the mask to the desired 38 | color. If no mask is specified, the entire image is set to the desired color. 39 | } 40 | \examples{ 41 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 42 | mask <- zeros(nrow(balloon), ncol(balloon), 1) 43 | poly <- data.frame(x = c(290, 290, 440, 440), y = c(170, 325, 325, 170)) 44 | fillPoly(mask, poly, color = "white") 45 | balloon_painted <- setTo(balloon, mask, "green") 46 | 47 | } 48 | \seealso{ 49 | \code{\link{Image}} 50 | } 51 | \author{ 52 | Simon Garnier, \email{garnier@njit.edu} 53 | } 54 | -------------------------------------------------------------------------------- /man/spatialGradient.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/filters.R 3 | \name{spatialGradient} 4 | \alias{spatialGradient} 5 | \title{First Order Derivatives of an Image with the Sobel Operator} 6 | \usage{ 7 | spatialGradient(image, k_size = 5) 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{k_size}{The half-size in pixels of the kernel (default: 5).} 13 | } 14 | \value{ 15 | A list containing two \code{\link{Image}} objects, one of for the 16 | derivative along the x axis and the other for the derivative along the y axis. 17 | } 18 | \description{ 19 | \code{spatialGradient} calculates the first order derivative of 20 | an image in both x and y using a Sobel operator. 21 | } 22 | \examples{ 23 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 24 | balloon_gradient <- spatialGradient(balloon, 5) 25 | 26 | } 27 | \seealso{ 28 | \code{\link{Image}}, \code{\link{sobel}} 29 | } 30 | \author{ 31 | Simon Garnier, \email{garnier@njit.edu} 32 | } 33 | -------------------------------------------------------------------------------- /man/split.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{split} 4 | \alias{split} 5 | \title{Split an Image into Separate Channels} 6 | \usage{ 7 | split(x) 8 | } 9 | \arguments{ 10 | \item{x}{An \code{\link{Image}} object.} 11 | } 12 | \value{ 13 | A list of single channel (grayscale) \code{\link{Image}} objects. 14 | } 15 | \description{ 16 | \code{split} returns a list of grayscale images corresponding to 17 | each of the channels (blue, green, red, or alpha) of an image. 18 | } 19 | \note{ 20 | Color images are usually represented by 3 channels (possibly 4) in the 21 | following order: blue (1), green (2), red (3), and possibly alpha (4). 22 | } 23 | \examples{ 24 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 25 | balloon_chan <- split(balloon) 26 | 27 | } 28 | \seealso{ 29 | \code{\link{merge}}, \code{\link{Image}} 30 | } 31 | \author{ 32 | Simon Garnier, \email{garnier@njit.edu} 33 | } 34 | -------------------------------------------------------------------------------- /man/sqrt.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/zzz.R 3 | \name{sqrt} 4 | \alias{sqrt} 5 | \title{Square Root Generic for Image objects} 6 | \usage{ 7 | sqrt(x, target = "new") 8 | } 9 | \arguments{ 10 | \item{x}{A 32- or 64-bit (32F or 64F) \code{\link{Image}} object.} 11 | 12 | \item{target}{The location where the results should be stored when passing a 13 | sum of images to the function. It can take 3 values: 14 | \describe{ 15 | \item{"new":}{a new \code{\link{Image}} object is created and the results 16 | are stored inside (the default).} 17 | \item{"self":}{the results are stored back into \code{x} (faster but 18 | destructive).} 19 | \item{An \code{\link{Image}} object:}{the results are stored in another 20 | existing \code{\link{Image}} object. This is fast but will replace the 21 | content of \code{target}. Note that \code{target} should have the same 22 | dimensions, bitdepth, and number of channels as \code{x}, otherwise an 23 | error will be thrown.} 24 | }} 25 | } 26 | \value{ 27 | If \code{target="new"}, the function returns an \code{\link{Image}} 28 | object. If \code{target="self"}, the function returns nothing and modifies 29 | \code{x} in place. If \code{target} is an \code{\link{Image}} object, the 30 | function returns nothing and modifies that \code{\link{Image}} object in 31 | place. 32 | } 33 | \description{ 34 | Overloaded \code{\link[base]{sqrt}} to handle \code{\link{Image}} 35 | objects. 36 | } 37 | \examples{ 38 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 39 | changeBitDepth(balloon, "32F", 1 , "self") 40 | sqrt(balloon) 41 | 42 | } 43 | \seealso{ 44 | \code{\link{exp}}, \code{\link{log}}, \code{\link{pow}} 45 | } 46 | \author{ 47 | Simon Garnier, \email{garnier@njit.edu} 48 | } 49 | -------------------------------------------------------------------------------- /man/stream_dimensions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/StreamClass.R 3 | \name{nrow.Rcpp_Stream} 4 | \alias{nrow.Rcpp_Stream} 5 | \alias{ncol.Rcpp_Stream} 6 | \title{The Number of Rows/Columns of a Stream} 7 | \usage{ 8 | nrow.Rcpp_Stream(x) 9 | 10 | ncol.Rcpp_Stream(x) 11 | } 12 | \arguments{ 13 | \item{x}{A \code{\link{Stream}} object.} 14 | } 15 | \value{ 16 | A numeric value. 17 | } 18 | \description{ 19 | \code{nrow} and \code{ncol} return the number of rows and columns 20 | present in a \code{\link{Stream}} object. 21 | } 22 | \examples{ 23 | \dontrun{ 24 | live <- stream(0) 25 | nrow(live) 26 | ncol(live) 27 | release(live) 28 | } 29 | 30 | } 31 | \seealso{ 32 | \code{\link[=dim.Rcpp_Stream]{dim}} which returns \emph{all} 33 | dimensions. 34 | } 35 | \author{ 36 | Simon Garnier, \email{garnier@njit.edu} 37 | } 38 | -------------------------------------------------------------------------------- /man/sub-.Rcpp_Image.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{[.Rcpp_Image} 4 | \alias{[.Rcpp_Image} 5 | \alias{[<-.Rcpp_Image} 6 | \title{Extract or Replace Parts of an Image} 7 | \usage{ 8 | \method{[}{Rcpp_Image}(x, ...) 9 | 10 | \method{[}{Rcpp_Image}(x, i = NULL, j = NULL) <- value 11 | } 12 | \arguments{ 13 | \item{x}{An \code{\link{Image}} object.} 14 | 15 | \item{...}{Other arguments passed to \code{\link{[}} when extracting parts. 16 | In this case, the function treat that image as an R array and will 17 | accept/require the same arguments.} 18 | 19 | \item{i, j}{Indices specifying elements to extract or replace. Indices are 20 | numeric vectors which values are coerced to integer as by 21 | \code{\link{as.integer}} (and hence truncated towards zero) or logical 22 | vectors which are recycled if necessary to match the dimensions of the image.} 23 | 24 | \item{value}{Vector or matrix with the data to replace the pixels. Typically, 25 | this is a matrix with the same number of rows as the number of channels in 26 | \code{image}, similar to that produced by \code{\link{col2rgb}}.} 27 | } 28 | \description{ 29 | Operators acting on \code{\link{Image}} objects to extract or 30 | replace parts. 31 | } 32 | \examples{ 33 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 34 | balloon[1:100, 1:100, ] 35 | balloon[1:100, 1:100] <- col2rgb(c("red", "green", "blue", "yellow")) 36 | 37 | } 38 | \seealso{ 39 | \code{\link{Image}}, \code{\link{col2bgr}} 40 | } 41 | \author{ 42 | Simon Garnier, \email{garnier@njit.edu} 43 | } 44 | -------------------------------------------------------------------------------- /man/sub-.VideoStack.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoStackClass.R 3 | \name{[[.VideoStack} 4 | \alias{[[.VideoStack} 5 | \alias{[[<-.VideoStack} 6 | \alias{[.VideoStack} 7 | \alias{[<-.VideoStack} 8 | \title{Extract or Replace Videos in Video Stacks} 9 | \usage{ 10 | \method{[[}{VideoStack}(x, i) 11 | 12 | \method{[[}{VideoStack}(x, i) <- value 13 | 14 | \method{[}{VideoStack}(x, i) 15 | 16 | \method{[}{VideoStack}(x, i) <- value 17 | } 18 | \arguments{ 19 | \item{x}{An \code{\link{VideoStack}} object.} 20 | 21 | \item{i}{An index specifying the element to extract or replace. Indices are 22 | numeric vectors which values are coerced to integer as by 23 | \code{\link{as.integer}} (and hence truncated towards zero) or logical 24 | vectors which are recycled if necessary to match the dimensions of the stack.} 25 | 26 | \item{value}{A \code{\link{Video}} object or a vector of \code{\link{Video}} 27 | objects to replace the \code{\link{Video}} objects in the stack, or a 28 | \code{NULL} value to remove the \code{\link{Video}} objects in the stack.} 29 | } 30 | \description{ 31 | Operators acting on \code{\link{VideoStack}} objects to extract 32 | or replace the \code{\link{Video}} objects they contain. 33 | } 34 | \examples{ 35 | path <- system.file("sample_vid/Balloon.mp4", package = "Rvision") 36 | vid <- video(path) 37 | balloonStack <- videoStack(path) 38 | balloonStack[[2]] <- vid 39 | 40 | } 41 | \seealso{ 42 | \code{\link{VideoStack}}, \code{\link{Video}} 43 | } 44 | \author{ 45 | Simon Garnier, \email{garnier@njit.edu} 46 | } 47 | -------------------------------------------------------------------------------- /man/subImage.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{subImage} 4 | \alias{subImage} 5 | \title{Extract Subimage} 6 | \usage{ 7 | subImage(image, x, y, width, height, target = "new") 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{x, y}{The coordinates of the bottom-left corner of the subimage within 13 | the original image.} 14 | 15 | \item{width}{The width of the subimage. Ignored if \code{target} is an 16 | \code{\link{Image}} object.} 17 | 18 | \item{height}{The height of the subimage. Ignored if \code{target} is an 19 | \code{\link{Image}} object.} 20 | 21 | \item{target}{The location where the results should be stored. It can take 2 22 | values: 23 | \describe{ 24 | \item{"new":}{a new \code{\link{Image}} object is created and the results 25 | are stored inside (the default).} 26 | \item{An \code{\link{Image}} object:}{the results are stored in another 27 | existing \code{\link{Image}} object. This is fast but will replace the 28 | content of \code{target}. Note that if \code{target} does not have the 29 | same number of channels and bit depth as \code{image}, an error will be 30 | thrown.} 31 | }} 32 | } 33 | \value{ 34 | If \code{target="new"}, the function returns an \code{\link{Image}} 35 | object. If \code{target} is an \code{\link{Image}} object, the function 36 | returns nothing and modifies that \code{\link{Image}} object in place. 37 | } 38 | \description{ 39 | \code{subImage} extracts a portion of an \code{\link{Image}} and 40 | returns it as an \code{\link{Image}} object. 41 | } 42 | \examples{ 43 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 44 | balloon_sub <- subImage(balloon, 290, 170, 150, 150) 45 | 46 | } 47 | \seealso{ 48 | \code{\link{Image}} 49 | } 50 | \author{ 51 | Simon Garnier, \email{garnier@njit.edu} 52 | } 53 | -------------------------------------------------------------------------------- /man/sum.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/zzz.R 3 | \name{sum} 4 | \alias{sum} 5 | \title{Sum Generic for Image objects} 6 | \usage{ 7 | sum(x, ..., target = "new") 8 | } 9 | \arguments{ 10 | \item{x}{An \code{\link{Image}} object or a list of \code{\link{Image}} 11 | objects.} 12 | 13 | \item{...}{Further arguments passed to summary methods. Unused if \code{x} is 14 | an image or a list of images.} 15 | 16 | \item{target}{The location where the results should be stored when passing a 17 | sum of images to the function. It can take 2 values: 18 | \describe{ 19 | \item{"new":}{a new \code{\link{Image}} object is created and the results 20 | are stored inside (the default).} 21 | \item{An \code{\link{Image}} object:}{the results are stored in another 22 | existing \code{\link{Image}} object. This is fast but will replace the 23 | content of \code{target}. Note that \code{target} should have the same 24 | dimensions and number of channels as the images in the list, otherwise an 25 | error will be thrown.} 26 | }} 27 | } 28 | \value{ 29 | If \code{x} is an \code{\link{Image}} object, the function returns a 30 | numeric value (for single-channel images) or a vector of numeric values (for 31 | multi-channel images). 32 | 33 | If \code{x} is a list of \code{\link{Image}} objects and \code{target="new"}, 34 | the function returns an \code{\link{Image}} object. If \code{target} is an 35 | \code{\link{Image}} object, the function returns nothing and modifies that 36 | \code{\link{Image}} object in place. 37 | } 38 | \description{ 39 | Overloaded \code{\link[base]{sum}} to handle \code{\link{Image}} 40 | objects and lists of \code{\link{Image}} objects. 41 | } 42 | \examples{ 43 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 44 | sum(balloon) 45 | 46 | balloon_vid <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 47 | img_list <- lapply(1:10, function(x) readNext(balloon_vid)) 48 | sum(img_list) 49 | 50 | } 51 | \seealso{ 52 | \code{\link{Image}} 53 | } 54 | \author{ 55 | Simon Garnier, \email{garnier@njit.edu} 56 | } 57 | -------------------------------------------------------------------------------- /man/thinning.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ximgproc.R 3 | \name{thinning} 4 | \alias{thinning} 5 | \title{Thinning} 6 | \usage{ 7 | thinning(image, method = "Zhang-Suen", target = "new") 8 | } 9 | \arguments{ 10 | \item{image}{An 8-bit (8U) single-channel, binary \code{\link{Image}} object.} 11 | 12 | \item{method}{A string indicating the binarization method to use. It can be 13 | any of the following: 14 | \itemize{ 15 | \item{"Zhang-Suen (the default)"} 16 | \item{"Guo-Hall"} 17 | }} 18 | 19 | \item{target}{The location where the results should be stored. It can take 3 20 | values: 21 | \describe{ 22 | \item{"new":}{a new \code{\link{Image}} object is created and the results 23 | are stored inside (the default).} 24 | \item{"self":}{the results are stored back into \code{image} (faster but 25 | destructive).} 26 | \item{An \code{\link{Image}} object:}{the results are stored in another 27 | existing \code{\link{Image}} object. This is fast and will not replace the 28 | content of \code{image} but will replace that of \code{target}. Note that 29 | if \code{target} does not have the same dimensions, number of channels, and 30 | bit depth as \code{image}, an error may be thrown.} 31 | }} 32 | } 33 | \value{ 34 | If \code{target="new"}, the function returns an \code{\link{Image}} 35 | object. If \code{target="self"}, the function returns nothing and modifies 36 | \code{image} in place. If \code{target} is an \code{\link{Image}} object, 37 | the function returns nothing and modifies that \code{\link{Image}} object in 38 | place. 39 | } 40 | \description{ 41 | \code{thinning} applies a binary blob thinning operation to 42 | achieve a skeletonization of a binary \code{\link{Image}} object. 43 | } 44 | \examples{ 45 | balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) 46 | balloon_gray <- changeColorSpace(balloon, "GRAY") 47 | balloon_th <- niBlackThreshold(balloon_gray) 48 | skel <- thinning(balloon_th) 49 | 50 | } 51 | \seealso{ 52 | \code{\link{Image}} 53 | } 54 | \author{ 55 | Simon Garnier, \email{garnier@njit.edu} 56 | } 57 | -------------------------------------------------------------------------------- /man/tile.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{tile} 4 | \alias{tile} 5 | \title{Repeat Image} 6 | \usage{ 7 | tile(image, ny = 1, nx = 1, target = "new") 8 | } 9 | \arguments{ 10 | \item{image}{An \code{\link{Image}} object.} 11 | 12 | \item{ny}{A non-zero, positive integer specifying how many times the image is 13 | repeated along the vertical axis.} 14 | 15 | \item{nx}{A non-zero, positive integer specifying how many times the image is 16 | repeated along the horizontal axis.} 17 | 18 | \item{target}{The location where the results should be stored. It can take 2 19 | values: 20 | \describe{ 21 | \item{"new":}{a new \code{\link{Image}} object is created and the results 22 | are stored inside (the default).} 23 | \item{An \code{\link{Image}} object:}{the results are stored in another 24 | existing \code{\link{Image}} object. This is fast and will not replace the 25 | content of \code{image} but will replace that of \code{target}. Note that 26 | if \code{target} does not the appropriate dimensions, number of channels, 27 | or bitdepth, it will be coerced automatically into the appropriate format.} 28 | }} 29 | } 30 | \value{ 31 | If \code{target="new"}, the function returns an \code{\link{Image}} 32 | object. If \code{target} is an \code{\link{Image}} object, the function 33 | returns nothing and modifies that \code{\link{Image}} object in place. 34 | } 35 | \description{ 36 | \code{tile} duplicates an \code{\link{Image}} object one or more 37 | times along each of its two axes. 38 | } 39 | \examples{ 40 | rnd <- zeros(360, 1, 1) 41 | randu(rnd) 42 | rnd_tiled <- tile(rnd, 1, 640) 43 | 44 | } 45 | \seealso{ 46 | \code{\link{Image}}, \code{\link{reduce}} 47 | } 48 | \author{ 49 | Simon Garnier, \email{garnier@njit.edu} 50 | } 51 | -------------------------------------------------------------------------------- /man/timelapse.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/StreamClass.R 3 | \name{timelapse} 4 | \alias{timelapse} 5 | \title{Make Timelapse from \code{Stream} Object} 6 | \usage{ 7 | timelapse(x, outputFolder, interval = 1, duration = Inf, format = "png") 8 | } 9 | \arguments{ 10 | \item{x}{The \code{Stream} object to use.} 11 | 12 | \item{outputFolder}{The path to the folder where the timelapse images will be 13 | saved. If it does not exist, it will be created. Note: the function will 14 | overwrite files present in this folder if they have the same names as the 15 | timelapse images.} 16 | 17 | \item{interval}{The interval in seconds between two successive images 18 | (default: 1).} 19 | 20 | \item{duration}{The duration in seconds of the timelapse. If infinite (the 21 | default), the timelapse will run until the user interrupts the function 22 | manually.} 23 | 24 | \item{format}{A character string corresponding to the format of the images 25 | (default: "png").} 26 | } 27 | \value{ 28 | This function does not return anything. It saves captured images in 29 | \code{outputFolder}. 30 | } 31 | \description{ 32 | Generates a timelapse sequence from a \code{Stream} object with 33 | a given duration and interval between images. 34 | } 35 | \examples{ 36 | \dontrun{ 37 | live <- stream(0) 38 | timelapse(live, "./out") 39 | release(live) 40 | } 41 | 42 | } 43 | \author{ 44 | Simon Garnier, \email{garnier@njit.edu} 45 | } 46 | -------------------------------------------------------------------------------- /man/undistortPoints.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calib3d.R 3 | \name{undistortPoints} 4 | \alias{undistortPoints} 5 | \title{Transform Coordinates to Compensate for Lens Distortion} 6 | \usage{ 7 | undistortPoints( 8 | points, 9 | camera_matrix, 10 | dist_coefs, 11 | new_camera_matrix = camera_matrix 12 | ) 13 | } 14 | \arguments{ 15 | \item{points}{A 2xN matrix of X/Y coordinates.} 16 | 17 | \item{camera_matrix}{A 3x3 camera intrinsic matrix as returned by 18 | \code{\link{calibrateCamera}}.} 19 | 20 | \item{dist_coefs}{A single row matrix with 4, 5, 8, 12 or 14 elements as 21 | returned by \code{\link{calibrateCamera}}.} 22 | 23 | \item{new_camera_matrix}{A 3x3 camera intrinsic matrix as returned by 24 | \code{\link{getOptimalNewCameraMatrix}} if you chose to execute this 25 | optional step (default: \code{camera_matrix}).} 26 | } 27 | \value{ 28 | A 2xN matrix of transformed X/Y coordinates. 29 | } 30 | \description{ 31 | \code{undistortPoints} transforms a set of coordinates 32 | representing points in an image to compensate for radial and tangential lens 33 | distortion. 34 | } 35 | \examples{ 36 | # See the help vignette: 37 | \dontrun{ 38 | vignette("z8_calib", package = "Rvision") 39 | } 40 | 41 | } 42 | \seealso{ 43 | \code{\link{undistort}}, \code{\link{calibrateCamera}}, 44 | \code{\link{getOptimalNewCameraMatrix}} 45 | } 46 | \author{ 47 | Simon Garnier, \email{garnier@njit.edu} 48 | } 49 | -------------------------------------------------------------------------------- /man/video_dimensions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoClass.R, R/generic.R 3 | \name{nrow.Rcpp_Video} 4 | \alias{nrow.Rcpp_Video} 5 | \alias{ncol.Rcpp_Video} 6 | \alias{nframes.Rcpp_Video} 7 | \alias{nframes} 8 | \title{The Number of Rows/Columns/Frames of a Video} 9 | \usage{ 10 | nrow.Rcpp_Video(x) 11 | 12 | ncol.Rcpp_Video(x) 13 | 14 | \method{nframes}{Rcpp_Video}(x) 15 | 16 | nframes(x) 17 | } 18 | \arguments{ 19 | \item{x}{A \code{\link{Video}} object.} 20 | } 21 | \value{ 22 | A numeric value. 23 | } 24 | \description{ 25 | nrow, ncol and nframes return the number of rows, columns or 26 | frames present in a \code{\link{Video}} object. 27 | } 28 | \examples{ 29 | balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision")) 30 | nrow(balloon) 31 | ncol(balloon) 32 | nframes(balloon) 33 | 34 | } 35 | \seealso{ 36 | \code{\link[=dim.Rcpp_Video]{dim}} which returns \emph{all} 37 | dimensions. 38 | } 39 | \author{ 40 | Simon Garnier, \email{garnier@njit.edu} 41 | } 42 | -------------------------------------------------------------------------------- /man/videostack_dimensions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoStackClass.R 3 | \name{nrow.VideoStack} 4 | \alias{nrow.VideoStack} 5 | \alias{ncol.VideoStack} 6 | \alias{nframes.VideoStack} 7 | \title{The Number of Rows/Columns/Frames of a VideoStack} 8 | \usage{ 9 | nrow.VideoStack(x) 10 | 11 | nrow.VideoStack(x) 12 | 13 | \method{nframes}{VideoStack}(x) 14 | } 15 | \arguments{ 16 | \item{x}{A \code{\link{VideoStack}} object.} 17 | } 18 | \value{ 19 | A numeric value. 20 | } 21 | \description{ 22 | nrow, ncol and nframes return the number of rows, columns or 23 | frames present in a \code{\link{VideoStack}} object. 24 | } 25 | \examples{ 26 | path <- system.file("sample_vid/Balloon.mp4", package = "Rvision") 27 | balloonStack <- videoStack(path, path) 28 | nrow(balloonStack) 29 | ncol(balloonStack) 30 | nframes(balloonStack) 31 | 32 | } 33 | \seealso{ 34 | \code{\link[=dim.VideoStack]{dim}} which returns \emph{all} 35 | dimensions. 36 | } 37 | \author{ 38 | Simon Garnier, \email{garnier@njit.edu} 39 | } 40 | -------------------------------------------------------------------------------- /man/videowriter_dimensions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoWriterClass.R 3 | \name{nrow.Rcpp_VideoWriter} 4 | \alias{nrow.Rcpp_VideoWriter} 5 | \alias{ncol.Rcpp_VideoWriter} 6 | \title{The Number of Rows/Columns of a Video Writer} 7 | \usage{ 8 | nrow.Rcpp_VideoWriter(x) 9 | 10 | ncol.Rcpp_VideoWriter(x) 11 | } 12 | \arguments{ 13 | \item{x}{A \code{\link{VideoWriter}} object.} 14 | } 15 | \value{ 16 | A numeric value. 17 | } 18 | \description{ 19 | nrow, ncol return the number of rows or columns present in a 20 | \code{\link{VideoWriter}} object. 21 | } 22 | \examples{ 23 | \dontrun{ 24 | writer <- videoWriter("test.mp4", "H264", 25, 1080, 1920) 25 | nrow(writer) 26 | ncol(writer) 27 | release(writer) 28 | } 29 | 30 | } 31 | \seealso{ 32 | \code{\link[=dim.Rcpp_VideoWriter]{dim}} which returns \emph{all} 33 | dimensions. 34 | } 35 | \author{ 36 | Simon Garnier, \email{garnier@njit.edu} 37 | } 38 | -------------------------------------------------------------------------------- /man/write.Image.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{write.Image} 4 | \alias{write.Image} 5 | \title{Image Output} 6 | \usage{ 7 | write.Image(x, file, overwrite = FALSE) 8 | } 9 | \arguments{ 10 | \item{x}{An \code{\link{Image}} object.} 11 | 12 | \item{file}{A character string naming the path to a file.} 13 | 14 | \item{overwrite}{Should the file be overwritten if it already exists? 15 | (default: FALSE)} 16 | } 17 | \value{ 18 | A message indicating whether writing was successful or not. 19 | } 20 | \description{ 21 | Writes the content of an \code{\link{Image}} object to a file. 22 | } 23 | \note{ 24 | The function will guess the format of the output file using the file 25 | extension provided by the user. 26 | } 27 | \examples{ 28 | \dontrun{ 29 | noise <- image(array(sample(0:255, 100 * 100 * 3, replace = TRUE), dim = c(100, 100, 3))) 30 | write.Image(noise, "noise.png") 31 | } 32 | 33 | } 34 | \seealso{ 35 | \code{\link{Image}}, \code{\link{image}} 36 | } 37 | \author{ 38 | Simon Garnier, \email{garnier@njit.edu} 39 | } 40 | -------------------------------------------------------------------------------- /man/writeFrame.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoWriterClass.R 3 | \name{writeFrame} 4 | \alias{writeFrame} 5 | \title{Write Frame to Output Video} 6 | \usage{ 7 | writeFrame(x, frame) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{\link{VideoWriter}} object.} 11 | 12 | \item{frame}{An \code{\link{Image}} object.} 13 | } 14 | \value{ 15 | This function does not return anything. 16 | } 17 | \description{ 18 | Write an \code{\link{Image}} object to an output video using a 19 | \code{\link{VideoWriter}} object. 20 | } 21 | \examples{ 22 | \dontrun{ 23 | live <- stream(0) 24 | writer <- videoWriter("test.mp4", "H264", 25, 1080, 1920) 25 | for (i in 1:250) { 26 | writeFrame(writer, readNext(live)) 27 | } 28 | release(writer) 29 | release(live) 30 | } 31 | } 32 | \seealso{ 33 | \code{\link{VideoWriter}}, \code{\link{Image}} 34 | } 35 | \author{ 36 | Simon Garnier, \email{garnier@njit.edu} 37 | } 38 | -------------------------------------------------------------------------------- /man/writeMulti.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{writeMulti} 4 | \alias{writeMulti} 5 | \title{Write a Multi-Page Image} 6 | \usage{ 7 | writeMulti(x, img_list, overwrite = FALSE) 8 | } 9 | \arguments{ 10 | \item{x}{A character string naming the path to a multi-page image file.} 11 | 12 | \item{img_list}{A list of \code{\link{Image}} objects.} 13 | 14 | \item{overwrite}{Should the file be overwritten if it already exists? 15 | (default: FALSE)} 16 | } 17 | \value{ 18 | A message indicating whether writing was successful or not. 19 | } 20 | \description{ 21 | \code{writeMulti} writes a list of \code{\link{Image}} objects 22 | to a multi-page image. 23 | } 24 | \examples{ 25 | balloon <- readMulti(system.file("sample_img/multipage.tif", package = "Rvision")) 26 | \dontrun{ 27 | writeMulti("~/Desktop/balloon.tiff", balloon) 28 | } 29 | 30 | 31 | } 32 | \seealso{ 33 | \code{\link{Image}} 34 | } 35 | \author{ 36 | Simon Garnier, \email{garnier@njit.edu} 37 | } 38 | -------------------------------------------------------------------------------- /man/writerOuput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/VideoWriterClass.R 3 | \name{writerOuput} 4 | \alias{writerOuput} 5 | \title{Output File of a Video Writer} 6 | \usage{ 7 | writerOuput(x) 8 | } 9 | \arguments{ 10 | \item{x}{A \code{\link{VideoWriter}} object.} 11 | } 12 | \value{ 13 | A character string corresponding to the address of the output file on 14 | the hard drive. 15 | } 16 | \description{ 17 | Retrieve the output file of a \code{\link{VideoWriter}} object. 18 | } 19 | \examples{ 20 | \dontrun{ 21 | writer <- videoWriter("test.mp4", "H264", 25, 1080, 1920) 22 | writerOuput(writer) 23 | release(writer) 24 | } 25 | 26 | } 27 | \seealso{ 28 | \code{\link{VideoWriter}}, \code{\link{videoWriter}} 29 | } 30 | \author{ 31 | Simon Garnier, \email{garnier@njit.edu} 32 | } 33 | -------------------------------------------------------------------------------- /man/zeros.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ImageClass.R 3 | \name{zeros} 4 | \alias{zeros} 5 | \title{Create a Zero-Filled Image} 6 | \usage{ 7 | zeros(nrow, ncol, nchan = 3, bitdepth = "8U", colorspace = "BGR") 8 | } 9 | \arguments{ 10 | \item{nrow}{An integer indicating the desired number of rows for the image.} 11 | 12 | \item{ncol}{An integer indicating the desired number of columns for the image.} 13 | 14 | \item{nchan}{An integer indicating the desired number of channels for the image.} 15 | 16 | \item{bitdepth}{A string indicating the desired bit depth for the image. 17 | Options are "8U" (the default), "8S", "16U", "16S", "32S", "32F", and "64F".} 18 | 19 | \item{colorspace}{A string indicating the desired color space for the image.} 20 | } 21 | \value{ 22 | An \code{\link{Image}} object. 23 | } 24 | \description{ 25 | \code{zeros} creates an \code{\link{Image}} object filled with 26 | zeros. 27 | } 28 | \examples{ 29 | zero <- zeros(100, 100) 30 | 31 | } 32 | \seealso{ 33 | \code{\link{Image}}, \code{\link{ones}} 34 | } 35 | \author{ 36 | Simon Garnier, \email{garnier@njit.edu} 37 | } 38 | -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/pkgdown/favicon/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/pkgdown/favicon/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/pkgdown/favicon/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/pkgdown/favicon/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/pkgdown/favicon/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/pkgdown/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/pkgdown/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/pkgdown/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swarm-lab/Rvision/8c773ceff876c9b85253a28acc674be3c96dc07e/pkgdown/favicon/favicon.ico -------------------------------------------------------------------------------- /src/Capture.h: -------------------------------------------------------------------------------- 1 | class Capture { 2 | public: 3 | Capture(); 4 | virtual ~Capture(); 5 | bool isOpened(); 6 | virtual void release(); 7 | virtual void readNext(Image& target); 8 | bool set(std::string propId, double value); 9 | double get(std::string propId); 10 | Rcpp::NumericVector dim(); 11 | int nrow(), ncol(); 12 | cv::VideoCapture cap; 13 | 14 | private: 15 | }; 16 | 17 | Capture::Capture() { 18 | 19 | } 20 | 21 | Capture::~Capture() { 22 | this->cap.release(); 23 | } 24 | 25 | bool Capture::isOpened() { 26 | return this->cap.isOpened(); 27 | } 28 | 29 | void Capture::release() { 30 | this->cap.release(); 31 | } 32 | 33 | bool Capture::set(std::string propId, double value) { 34 | return this->cap.set(getCapPropId(propId), value); 35 | } 36 | 37 | double Capture::get(std::string propId) { 38 | return this->cap.get(getCapPropId(propId)); 39 | } 40 | 41 | Rcpp::NumericVector Capture::dim() { 42 | return Rcpp::NumericVector::create(this->cap.get(cv::CAP_PROP_FRAME_HEIGHT), 43 | this->cap.get(cv::CAP_PROP_FRAME_WIDTH)); 44 | } 45 | 46 | int Capture::nrow() { 47 | return this->cap.get(cv::CAP_PROP_FRAME_HEIGHT); 48 | } 49 | 50 | int Capture::ncol() { 51 | return this->cap.get(cv::CAP_PROP_FRAME_WIDTH); 52 | } 53 | 54 | void Capture::readNext(Image& target) { 55 | if (target.GPU) { 56 | if (!this->cap.read(target.uimage)) 57 | Rcpp::stop("No more frames available."); 58 | return; 59 | } 60 | 61 | if (!this->cap.read(target.image)) 62 | Rcpp::stop("No more frames available."); 63 | } 64 | -------------------------------------------------------------------------------- /src/Makevars: -------------------------------------------------------------------------------- 1 | PKG_LIBS = `$(R_HOME)/bin/Rscript -e 'ROpenCVLite::opencvConfig("libs")'` $(SHLIB_OPENMP_CXXFLAGS) 2 | PKG_CPPFLAGS = `$(R_HOME)/bin/Rscript -e 'ROpenCVLite::opencvConfig("cflags")'` 3 | PKG_CXXFLAGS = `$(R_HOME)/bin/Rscript -e 'Rcpp:::CxxFlags()'` $(SHLIB_OPENMP_CXXFLAGS) 4 | -------------------------------------------------------------------------------- /src/Makevars.win: -------------------------------------------------------------------------------- 1 | PKG_LIBS = $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e \ 2 | "ROpenCVLite::opencvConfig('libs', arch = Sys.getenv('R_ARCH'))") $(SHLIB_OPENMP_CXXFLAGS) 3 | PKG_CPPFLAGS = $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e \ 4 | "ROpenCVLite::opencvConfig('cflags', arch = Sys.getenv('R_ARCH'))") 5 | PKG_CXXFLAGS = $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::CxxFlags()") $(SHLIB_OPENMP_CXXFLAGS) 6 | -------------------------------------------------------------------------------- /src/Stream.h: -------------------------------------------------------------------------------- 1 | class Stream : public Capture { 2 | public: 3 | Stream(int index, std::string api); 4 | Stream(std::string stream_string, std::string api); 5 | bool open(int index, std::string api); 6 | bool openStr(std::string stream_string, std::string api); 7 | 8 | private: 9 | }; 10 | 11 | Stream::Stream(int index, std::string api) { 12 | if (!this->cap.open(index, getAPIId(api))) { 13 | Rcpp::stop("Could not open the stream."); 14 | } 15 | } 16 | 17 | Stream::Stream(std::string stream_string, std::string api) { 18 | if (!this->cap.open(stream_string, getAPIId(api))) { 19 | Rcpp::stop("Could not open the stream."); 20 | } 21 | } 22 | 23 | bool Stream::open(int index, std::string api) { 24 | if (!this->cap.open(index, getAPIId(api))) 25 | Rcpp::stop("Could not open the stream."); 26 | 27 | return true; 28 | } 29 | 30 | bool Stream::openStr(std::string stream_string, std::string api) { 31 | if (!this->cap.open(stream_string, getAPIId(api))) 32 | Rcpp::stop("Could not open the stream."); 33 | 34 | return true; 35 | } 36 | -------------------------------------------------------------------------------- /src/geometry.h: -------------------------------------------------------------------------------- 1 | void _resize(Image& image, int height, int width, double fx, double fy, 2 | int interpolation, Image& target) { 3 | if (image.GPU) { 4 | if (target.GPU) 5 | return cv::resize(image.uimage, target.uimage, cv::Size(width, height), fx, fy, interpolation); 6 | 7 | return cv::resize(image.uimage, target.image, cv::Size(width, height), fx, fy, interpolation); 8 | } 9 | 10 | if (target.GPU) 11 | return cv::resize(image.image, target.uimage, cv::Size(width, height), fx, fy, interpolation); 12 | 13 | cv::resize(image.image, target.image, cv::Size(width, height), fx, fy, interpolation); 14 | } 15 | 16 | void _flip(Image& image, int flipCode, Image& target) { 17 | if (image.GPU) { 18 | if (target.GPU) 19 | return cv::flip(image.uimage, target.uimage, flipCode); 20 | 21 | return cv::flip(image.uimage, target.image, flipCode); 22 | } 23 | 24 | if (target.GPU) 25 | return cv::flip(image.image, target.uimage, flipCode); 26 | 27 | cv::flip(image.image, target.image, flipCode); 28 | } -------------------------------------------------------------------------------- /src/morphology.h: -------------------------------------------------------------------------------- 1 | void _morph(Image& image, int operation, int k_shape, int k_height, int k_width, 2 | int iterations, Image& target) { 3 | cv::Mat k = cv::getStructuringElement(k_shape, cv::Size(2 * k_width + 1, 2 * k_height + 1)); 4 | cv::Point p = cv::Point(-1, -1); 5 | 6 | if (image.GPU) { 7 | if (target.GPU) 8 | return cv::morphologyEx(image.uimage, target.uimage, operation, k, p, iterations); 9 | 10 | return cv::morphologyEx(image.uimage, target.image, operation, k, p, iterations); 11 | } 12 | 13 | if (target.GPU) 14 | return cv::morphologyEx(image.image, target.uimage, operation, k, p, iterations); 15 | 16 | cv::morphologyEx(image.image, target.image, operation, k, p, iterations); 17 | } 18 | 19 | void _morphCustom(Image& image, int operation, arma::Mat kernel, 20 | int iterations, Image& target) { 21 | cv::Mat_ k; 22 | arma2cv(kernel, k); 23 | cv::Point p = cv::Point(-1, -1); 24 | 25 | if (image.GPU) { 26 | if (target.GPU) 27 | return cv::morphologyEx(image.uimage, target.uimage, operation, k, p, iterations); 28 | 29 | return cv::morphologyEx(image.uimage, target.image, operation, k, p, iterations); 30 | } 31 | 32 | if (target.GPU) 33 | return cv::morphologyEx(image.image, target.uimage, operation, k, p, iterations); 34 | 35 | cv::morphologyEx(image.image, target.image, operation, k, p, iterations); 36 | } 37 | -------------------------------------------------------------------------------- /src/opencvarma.h: -------------------------------------------------------------------------------- 1 | // Convert an OpenCV matrix to Armadillo matrix. A copy is made. 2 | template 3 | void cv2arma(const cv::Mat_ &src, arma::Mat &dst) { 4 | cv::Mat_ t = src.t(); 5 | dst = arma::Mat(reinterpret_cast(t.data), src.rows, src.cols); 6 | } 7 | 8 | // Convert an OpenCV multi-channel matrix to Armadillo cube. A copy is made. 9 | template 10 | void cv2arma(const cv::Mat_> &src, arma::Cube& dst) { 11 | std::vector> channels; 12 | dst.set_size(src.rows, src.cols, NC); 13 | for (int c = 0; c < NC; ++c) 14 | channels.push_back({src.cols, src.rows, dst.slice(c).memptr()}); 15 | cv::flip(src, src, 0); 16 | cv::split(src.t(), channels); 17 | cv::flip(src, src, 0); 18 | } 19 | 20 | // Convert an Armadillo cube to OpenCV matrix. A copy is made. 21 | template 22 | void arma2cv(const arma::Cube &src, cv::Mat &dst) { 23 | std::vector> channels; 24 | for (size_t c = 0; c < src.n_slices; ++c) { 25 | auto *data = const_cast(src.slice(c).memptr()); 26 | channels.push_back({int(src.n_cols), int(src.n_rows), data}); 27 | cv::transpose(channels[c], channels[c]); 28 | } 29 | cv::merge(channels, dst); 30 | cv::flip(dst, dst, 0); 31 | } 32 | 33 | // Convert an Armadillo matrix to OpenCV matrix. A copy is made (I think). 34 | template 35 | void arma2cv(const arma::Mat &src, cv::Mat_ &dst) { 36 | dst = cv::Mat_{int(src.n_cols), int(src.n_rows), const_cast(src.memptr())}; 37 | cv::transpose(dst, dst); 38 | // cv::flip(dst, dst, 0); 39 | } 40 | -------------------------------------------------------------------------------- /vignettes/z1_install.R: -------------------------------------------------------------------------------- 1 | ## ----message=FALSE, eval=FALSE------------------------------------------------------------------------------------------------------------------- 2 | # if (!require(devtools)) 3 | # install.packages("devtools") 4 | 5 | ## ----message=FALSE, eval=FALSE------------------------------------------------------------------------------------------------------------------- 6 | # devtools::install_github("swarm-lab/Rvision") 7 | 8 | ## ----message=FALSE, eval=FALSE------------------------------------------------------------------------------------------------------------------- 9 | # library(Rvision) 10 | 11 | -------------------------------------------------------------------------------- /vignettes/z1_install.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "1 - Installing Rvision" 3 | output: 4 | rmarkdown::html_vignette: 5 | toc: true 6 | vignette: > 7 | %\VignetteIndexEntry{1 - Installing Rvision} 8 | %\VignetteEngine{knitr::rmarkdown} 9 | %\VignetteEncoding{UTF-8} 10 | --- 11 | 12 | ## 1.1 - Before installing 13 | 14 | ### 1.1.1 - Devtools 15 | 16 | Before installing `Rvision`, you will need to install the latest version of the 17 | [`devtools`](https://CRAN.R-project.org/package=devtools) package. You can 18 | install `devtools` from [`CRAN`](https://cran.r-project.org) as follows: 19 | 20 | ```{r, message=FALSE, eval=FALSE} 21 | if (!require(devtools)) 22 | install.packages("devtools") 23 | ``` 24 | 25 | ### 1.1.2 - ROpenCVLite 26 | 27 | You will also need to install the [`ROpenCVLite`](https://github.com/swarm-lab/ROpenCVLite) 28 | package. Installation instructions for `ROpenCVLite` can be found at 29 | https://swarm-lab.github.io/ROpenCVLite/articles/install.html. 30 | 31 | This step may take some time as it will download, compile and install 32 | [`OpenCV`](https://opencv.org) for you. I suggest you go out for a cup of tea or 33 | coffee while `ROpenCVLite` is being installed (compilation time will depend on 34 | your computer). 35 | 36 | Note that you can skip this step and `Rvision` will attempt to install it in the 37 | next step. However it might fail if your system is missing one of the external 38 | dependencies required by `ROpenCVLite`. 39 | 40 | --- 41 | 42 | ## 1.2 - Installing Rvision 43 | 44 | You can install the latest development version of `Rvision` as follows: 45 | 46 | ```{r, message=FALSE, eval=FALSE} 47 | devtools::install_github("swarm-lab/Rvision") 48 | ``` 49 | 50 | --- 51 | 52 | ## 1.3 - Loading Rvision 53 | 54 | ```{r, message=FALSE, eval=FALSE} 55 | library(Rvision) 56 | ``` 57 | -------------------------------------------------------------------------------- /vignettes/z5_gpu.R: -------------------------------------------------------------------------------- 1 | ## ----eval=FALSE, echo=TRUE----------------------------------------------------------------------------------------------------------------------- 2 | # # Find the path to the balloon1.png image provided with Rvision 3 | # path_to_image <- system.file("sample_img", "balloon1.png", package = "Rvision") 4 | # 5 | # # Load the image in memory 6 | # my_image <- image(filename = path_to_image) 7 | # 8 | # # Copy the image to GPU memory 9 | # my_image$toGPU() 10 | 11 | ## ----eval=FALSE, echo=TRUE----------------------------------------------------------------------------------------------------------------------- 12 | # # Copy the image back to CPU memory 13 | # my_image$fromGPU() 14 | 15 | -------------------------------------------------------------------------------- /vignettes/z6_queue.R: -------------------------------------------------------------------------------- 1 | ## ----eval=FALSE, echo=TRUE----------------------------------------------------------------------------------------------------------------------- 2 | # # Find the path to the Balloon.mp4 video provided with Rvision 3 | # path_to_video <- system.file("sample_vid", "Balloon.mp4", package = "Rvision") 4 | # 5 | # # Open the video file stream 6 | # my_video <- video(filename = path_to_video) 7 | # 8 | # # Create a queue of frames 9 | # my_buf <- queue(my_video, size = 10, delay = 1000, overflow = "pause") 10 | 11 | ## ----eval=FALSE, echo=TRUE----------------------------------------------------------------------------------------------------------------------- 12 | # release(my_buf) 13 | 14 | ## ----eval=FALSE, echo=TRUE----------------------------------------------------------------------------------------------------------------------- 15 | # # Collect the next available frame from the queue and store it in a new 16 | # # Image object 17 | # frame <- readNext(my_buf) 18 | # 19 | # # Collect the next available frame from the queue and store it in an existing 20 | # # Image object 21 | # readNext(my_buf, target = frame) 22 | 23 | ## ----eval=FALSE, echo=TRUE----------------------------------------------------------------------------------------------------------------------- 24 | # # Is the queue empty? 25 | # empty(my_buf) 26 | # 27 | # # Is the queue full? 28 | # full(my_buf) 29 | # 30 | # # What is the current number of frames in the queue? 31 | # length(my_buf) 32 | # 33 | # # What is the maximum number of frames that the queue can hold? 34 | # capacity(my_buf) 35 | # 36 | # # What is the index of the next frame available? (for video queues only) 37 | # frame(my_buf) 38 | # 39 | # # What are the dimensions of the queue? 40 | # dim(my_buf) 41 | # nrow(my_buf) 42 | # ncol(my_buf) 43 | 44 | --------------------------------------------------------------------------------