Giter Club home page Giter Club logo

torch-opencv's People

Contributors

ainur699 avatar alexwal avatar edgarriba avatar hyojinie avatar magonn avatar manuelvolk avatar martynovs avatar ngunsu avatar qas32 avatar shrubb avatar soumith avatar szagoruyko avatar the-glu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

torch-opencv's Issues

superres

It's currently very complicated to tie FrameSource to SuperResolution in Lua. Probably we should change PtrWrapper to point to Ptr<SomeAlgorithm> rather than to SomeAlgorithm.

  • FrameSource
  • SuperResolution
  • trivial getters and setters
  • setOpticalFlow
  • getOpticalFlow
  • collectGarbage
  • nextFrame
  • reset
  • setInput

features2d tests

  • KeyPointsFilter
  • BRISK
  • ORB
  • MSER
  • FAST
  • FastFeatureDetector
  • AGAST
  • AgastFeatureDetector
  • GFTTDetector
  • SimpleBlobDetector
  • KAZE
  • AKAZE
  • DescriptorMatcher
  • BFMatcher
  • FlannBasedMatcher


  • drawKeypoints
  • drawMatches
  • drawMatchesKnn
  • evaluateFeatureDetector
  • computeRecallPrecisionCurve
  • getRecall
  • getNearestPoint


  • BOWKMeansTrainer
  • BOWImgDescriptorExtractor

imgproc tests

Priority testing:

  • undistort (how should it work? please test if it's correct)
  • grabCut (same thing)
  • Subdiv2D:getTriangleList
  • Subdiv2D:getEdgeList
  • Subdiv2D:getVoronoiFacetList

Class-based stuff including algorithms:

  • GeneralizedHough
  • GeneralizedHoughBallard
  • GeneralizedHoughGuil
  • CLAHE
  • LineSegmentDetector
  • Subdiv2D
  • LineIterator

Separate functions (filters, detectors, ...):

  • calcHist (SparseMat overload)
  • calcBackProject (SparseMat overload)
  • compareHist (SparseMat overload)
  • getGaussianKernel
  • getDerivKernels
  • getGaborKernel
  • getStructuringElement
  • medianBlur
  • GaussianBlur
  • bilateralFilter
  • boxFilter
  • sqrBoxFilter
  • blur
  • filter2D
  • sepFilter2D
  • Sobel
  • Scharr
  • Laplacian
  • Canny
  • cornerMinEigenVal
  • cornerHarris
  • cornerEigenValsAndVecs
  • preCornerDetect
  • cornerSubPix
  • goodFeaturesToTrack
  • HoughLines
  • HoughLinesP
  • HoughCircles
  • erode
  • dilate
  • morphologyEx
  • resize
  • warpAffine
  • warpPerspective
  • remap
  • convertMaps
  • getRotationMatrix2D
  • getPerspectiveTransform
  • getAffineTransform
  • invertAffineTransform
  • getRectSubPix
  • logPolar
  • linearPolar
  • integral
  • integral2
  • integral3
  • accumulate
  • accumulateSquare
  • accumulateProduct
  • accumulateWeighted
  • phaseCorrelate
  • createHanningWindow
  • threshold
  • adaptiveThreshold
  • pyrDown
  • pyrUp
  • buildPyramid
  • undistort
  • initUndistortRectifyMap
  • initWideAngleProjMap
  • getDefaultNewCameraMatrix
  • undistortPoints
  • calcHist
  • calcBackProject
  • compareHist
  • equalizeHist
  • EMD
  • watershed
  • pyrMeanShiftFiltering
  • grabCut
  • distanceTransformWithLabels
  • distanceTransform
  • floodFill
  • cvtColor
  • putText
  • demosaicing
  • moments
  • matchTemplate
  • connectedComponents
  • connectedComponentsWithStats
  • HuMoments
  • findContours
  • approxPolyDP
  • arcLength
  • boundingRect
  • contourArea
  • minAreaRect
  • boxPoints
  • minEnclosingCircle
  • minEnclosingTriangle
  • matchShapes
  • convexHull
  • convexityDefects
  • isContourConvex
  • intersectConvexConvex
  • fitEllipse
  • fitLine
  • pointPolygonTest
  • rotatedRectangleIntersection
  • blendLinear
  • applyColorMap
  • line
  • arrowedLine
  • rectangle
  • circle
  • ellipse
  • fillConvexPoly
  • fillPoly
  • polylines
  • drawContours
  • clipLine
  • ellipse2Poly
  • getTextSize

imgproc

Class-based stuff including algorithms:

  • GeneralizedHough
  • GeneralizedHoughBallard
  • GeneralizedHoughGuil
  • CLAHE
  • LineSegmentDetector
  • Subdiv2D
  • LineIterator

Separate functions (filters, detectors, ...):

  • calcHist (SparseMat overload)
  • calcBackProject (SparseMat overload)
  • compareHist (SparseMat overload)
  • getGaussianKernel
  • getDerivKernels
  • getGaborKernel
  • getStructuringElement
  • medianBlur
  • GaussianBlur
  • bilateralFilter
  • boxFilter
  • sqrBoxFilter
  • blur
  • filter2D
  • sepFilter2D
  • Sobel
  • Scharr
  • Laplacian
  • Canny
  • cornerMinEigenVal
  • cornerHarris
  • cornerEigenValsAndVecs
  • preCornerDetect
  • cornerSubPix
  • goodFeaturesToTrack
  • HoughLines
  • HoughLinesP
  • HoughCircles
  • erode
  • dilate
  • morphologyEx
  • resize
  • warpAffine
  • warpPerspective
  • remap
  • convertMaps
  • getRotationMatrix2D
  • getPerspectiveTransform
  • getAffineTransform
  • invertAffineTransform
  • getRectSubPix
  • logPolar
  • linearPolar
  • integral
  • integral2
  • integral3
  • accumulate
  • accumulateSquare
  • accumulateProduct
  • accumulateWeighted
  • phaseCorrelate
  • createHanningWindow
  • threshold
  • adaptiveThreshold
  • pyrDown
  • pyrUp
  • buildPyramid
  • undistort
  • initUndistortRectifyMap
  • initWideAngleProjMap
  • getDefaultNewCameraMatrix
  • undistortPoints
  • calcHist
  • calcBackProject
  • compareHist
  • equalizeHist
  • EMD
  • watershed
  • pyrMeanShiftFiltering
  • grabCut
  • distanceTransformWithLabels
  • distanceTransform
  • floodFill
  • cvtColor
  • putText
  • demosaicing
  • moments
  • matchTemplate
  • connectedComponents
  • connectedComponentsWithStats
  • HuMoments
  • findContours
  • approxPolyDP
  • arcLength
  • boundingRect
  • contourArea
  • minAreaRect
  • boxPoints
  • minEnclosingCircle
  • minEnclosingTriangle
  • matchShapes
  • convexHull
  • convexityDefects
  • isContourConvex
  • intersectConvexConvex
  • fitEllipse
  • fitLine
  • pointPolygonTest
  • rotatedRectangleIntersection
  • blendLinear
  • applyColorMap
  • line
  • arrowedLine
  • rectangle
  • circle
  • ellipse
  • fillConvexPoly
  • fillPoly
  • polylines
  • drawContours
  • clipLine
  • ellipse2Poly
  • getTextSize

videoio

Classes:

  • VideoCapture
  • VideoWriter

optflow

I couldn't find corresponding OpenCV include files (candidates are superres/optical_flow.hpp, videostab/optical_flow.hpp and video/tracking.hpp). Current docs on optflow don't match with these!

OS X installation issue

Scanning dependencies of target optflow
[ 65%] Building CXX object CMakeFiles/optflow.dir/src/optflow.cpp.o
In file included from /Users/eugenioculurciello/Code/Lua/torch-opencv/src/optflow.cpp:1:
In file included from /Users/eugenioculurciello/Code/Lua/torch-opencv/include/optflow.hpp:3:
/Users/eugenioculurciello/Code/Lua/torch-opencv/include/video.hpp:4:10: fatal error: 'opencv2/bgsegm.hpp' file not found

include <opencv2/bgsegm.hpp>

     ^

1 error generated.
make[2]: *** [CMakeFiles/optflow.dir/src/optflow.cpp.o] Error 1
make[1]: *** [CMakeFiles/optflow.dir/all] Error 2
make: *** [all] Error 2

build fails: "SSE4.1 instruction set not enabled"

I tried to build torch-opencv on Ubuntu 14.04.3 LTS:

In file included from /home/koepf/torch/install/include/TH/THVector.h:24:0,
                 from /home/koepf/torch/install/include/TH/TH.h:12,
                 from /home/koepf/code/torch-opencv/include/Common.hpp:5,
                 from /home/koepf/code/torch-opencv/src/Common.cpp:1:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/smmintrin.h:31:3: error: #error "SSE4.1 instruction set not enabled"
 # error "SSE4.1 instruction set not enabled"

Any ideas?

photo

  • inpaint
  • fastNlMeansDenoising
  • fastNlMeansDenoising
  • fastNlMeansDenoisingColored
  • fastNlMeansDenoisingMulti
  • fastNlMeansDenoisingMulti
  • fastNlMeansDenoisingColoredMulti
  • denoise_TVL1
  • decolor
  • seamlessClone
  • colorChange
  • illuminationChange
  • textureFlattening
  • edgePreservingFilter
  • detailEnhance
  • pencilSketch
  • stylization

Tonemap

  • constructor
  • process
  • getGamma
  • setGamma

TonemapDrago

  • constructor
  • getSaturation
  • setSaturation
  • getBias
  • setBias

TonemapDurand

  • constructor
  • getSaturation
  • setSaturation
  • getContrast
  • setContrast
  • getSigmaSpace
  • setSigmaSpace
  • getSigmaColor
  • setSigmaColor

TonemapReinhard

  • constructor
  • getIntensity
  • setIntensity
  • getLightAdaptation
  • setLightAdaptation
  • getColorAdaptation
  • setColorAdaptation

TonemapMantiuk

  • constructor
  • getScale
  • setScale
  • getSaturation
  • setSaturation

AlignExposures

  • process

AlignMTB

  • constructor
  • process
  • calculateShift
  • shiftMat
  • computeBitmaps
  • getMaxBits
  • setMaxBits
  • getExcludeRange
  • setExcludeRange
  • getCut
  • setCut

CalibrateCRF

  • process

CalibrateDebevec

  • constructor
  • getLambda
  • setLambda
  • getSamples
  • setSamples
  • getRandom
  • setRandom

CalibrateRobertson

  • constructor
  • getMaxIter
  • setMaxIter
  • getThreshold
  • setThreshold
  • getRadiance

MergeExposures

  • process

MergeDebevec

  • constructor
  • process

MergeMertens

  • constructor
  • getContrastWeight
  • setContrastWeight
  • getSaturationWeight
  • setSaturationWeight
  • getExposureWeight
  • setExposureWeight

MergeRobertson

  • constructor
  • process

video

BackgroundSubtractor

  • apply
  • getBackgroundImage

BackgroundSubtractorMOG2

  • constructor
  • getHistory
  • setHistory
  • getNMixtures
  • setNMixtures
  • getBackgroundRatio
  • setBackgroundRatio
  • getVarThreshold
  • setVarThreshold
  • getVarThresholdGen
  • setVarThresholdGen
  • getVarInit
  • setVarInit
  • getVarMin
  • setVarMin
  • getVarMax
  • setVarMax
  • getComplexityReductionThreshold
  • setComplexityReductionThreshold
  • getDetectShadows
  • setDetectShadows
  • getShadowValue
  • setShadowValue
  • getShadowThreshold
  • setShadowThreshold

BackgroundSubtractorKNN

  • getHistory
  • setHistory
  • getNSamples
  • setNSamples
  • getDist2Threshold
  • setDist2Threshold
  • getkNNSamples
  • setkNNSamples
  • getDetectShadows
  • setDetectShadows
  • getShadowValue
  • setShadowValue
  • getShadowThreshold
  • setShadowThreshold

demo/videocap.lua issue with cv.cvtcolor

Hello,

I tried to execute the demo/videocap.lua using opencv 3.0 as specified and it's not working properly.

I found the problem to be in line 20:
edges = cv.cvtColor{frame, cv.COLOR_BGR2GRAY}

the problem is that "edges" needs to passed as an argument also:
edges = cv.cvtColor{frame, edges, cv.COLOR_BGR2GRAY}

and now everything works fine.
Just posted the issue, in case anyone else encounters the same problem.

Thank you!

Installation problem: Optflow

I am encountering the following error probably because some functions were moved into opencv_contrib. I am currently using the command:
OpenCV_DIR="/home/karan/opencv" luarocks install cv

How do I include contrib folder?

Error that I got:

/tmp/luarocks_cv-scm-1-490/torch-opencv/src/optflow.cpp: In function โ€˜TensorWrapper calcOpticalFlowSparseToDense(TensorWrapper, TensorWrapper, TensorWrapper, int, int, float, bool, float, float)โ€™:
/tmp/luarocks_cv-scm-1-490/torch-opencv/src/optflow.cpp:54:9: error: โ€˜calcOpticalFlowSparseToDenseโ€™ is not a member of โ€˜optflowโ€™
         optflow::calcOpticalFlowSparseToDense(
         ^
/tmp/luarocks_cv-scm-1-490/torch-opencv/src/optflow.cpp:54:9: note: suggested alternative:
/tmp/luarocks_cv-scm-1-490/torch-opencv/src/optflow.cpp:48:22: note:   โ€˜calcOpticalFlowSparseToDenseโ€™
 struct TensorWrapper calcOpticalFlowSparseToDense(
                      ^
/tmp/luarocks_cv-scm-1-490/torch-opencv/src/optflow.cpp:59:9: error: โ€˜calcOpticalFlowSparseToDenseโ€™ is not a member of โ€˜optflowโ€™
         optflow::calcOpticalFlowSparseToDense(
         ^
/tmp/luarocks_cv-scm-1-490/torch-opencv/src/optflow.cpp:59:9: note: suggested alternative:
/tmp/luarocks_cv-scm-1-490/torch-opencv/src/optflow.cpp:48:22: note:   โ€˜calcOpticalFlowSparseToDenseโ€™
 struct TensorWrapper calcOpticalFlowSparseToDense(
                      ^
/tmp/luarocks_cv-scm-1-490/torch-opencv/src/optflow.cpp: In function โ€˜DenseOpticalFlowPtr createOptFlow_SparseToDense_optflow()โ€™:
/tmp/luarocks_cv-scm-1-490/torch-opencv/src/optflow.cpp:151:32: error: โ€˜createOptFlow_SparseToDenseโ€™ is not a member of โ€˜optflowโ€™
     return rescueObjectFromPtr(optflow::createOptFlow_SparseToDense());
                                ^
CMakeFiles/optflow.dir/build.make:54: recipe for target 'CMakeFiles/optflow.dir/src/optflow.cpp.o' failed
make[2]: *** [CMakeFiles/optflow.dir/src/optflow.cpp.o] Error 1
CMakeFiles/Makefile2:340: recipe for target 'CMakeFiles/optflow.dir/all' failed
make[1]: *** [CMakeFiles/optflow.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2

Error: Build error: Failed building.

BFMatcher problems

I am having problems trying to use BFMatcher. I am doing the following (similar to the flann demo)

matcher = cv.BFMatcher{cv.NORM_L2, False}
print (matcher)
local N_samples, N_features, fieldSize, N_query = 300, 2, 600, 20
local samples = torch.rand(N_samples, N_features):float() * fieldSize
local query = torch.rand(1, N_features):float() * fieldSize
local res = matcher:match{query, samples}

and I am getting

features2d/init.lua:1391: bad argument #1 to 'DescriptorMatcher_match_trainDescriptors' (cannot convert 'struct TensorWrapper' to 'struct PtrWrapper')

I readed init.lua but I don't see what I am doing wrong.

compilation on OS X

I cannot compile on Os X with brew:

$ brew install opencv
Warning: homebrew/science/opencv-2.4.12 already installed

$ make
Scanning dependencies of target Common
[ 3%] Building CXX object CMakeFiles/Common.dir/src/Common.cpp.o
In file included from /Users/eugenioculurciello/Code/Lua/torch-opencv/src/Common.cpp:1:
/Users/eugenioculurciello/Code/Lua/torch-opencv/include/Common.hpp:2:10: fatal error: 'opencv2/core.hpp' file not found

include <opencv2/core.hpp>

     ^

1 error generated.
make[2]: *** [CMakeFiles/Common.dir/src/Common.cpp.o] Error 1
make[1]: *** [CMakeFiles/Common.dir/all] Error 2
make: *** [all] Error 2

I fix that:
on os x, it is: opencv2/cora/core.hpp
then:

$ make
Scanning dependencies of target Common
[ 3%] Building CXX object CMakeFiles/Common.dir/src/Common.cpp.o
In file included from /Users/eugenioculurciello/Code/Lua/torch-opencv/src/Common.cpp:1:
/Users/eugenioculurciello/Code/Lua/torch-opencv/include/Common.hpp:146:30: error: no type named 'Moments' in namespace 'cv'
MomentsWrapper(const cv::Moments & other);
~~~~^
/Users/eugenioculurciello/Code/Lua/torch-opencv/include/Common.hpp:147:25: error: no type named 'Moments' in namespace 'cv'
inline operator cv::Moments() {
~~~~^
/Users/eugenioculurciello/Code/Lua/torch-opencv/src/Common.cpp:154:42: error: no type named 'Moments' in namespace 'cv'
MomentsWrapper::MomentsWrapper(const cv::Moments & other) {
~~~~^
3 errors generated.
make[2]: *** [CMakeFiles/Common.dir/src/Common.cpp.o] Error 1
make[1]: *** [CMakeFiles/Common.dir/all] Error 2
make: *** [all] Error 2

THis I am not sure, is this platform dependent?

imgcodecs

  • imread
  • imreadmulti
  • imdecode
  • imencode

Problems using torch-opencv

Hi.

torch-opencv looks like a good project, but I am having problems using it. I am on Ubuntu Linux 14.04 on x86_64 hardware. I have torch7 and opencv-3.0.0 installed and have been using both for some time. Up to now I have used the C++ interface to opencv, but I would like to interface to it from torch. So I downloaded torch-opencv-master.zip, and built torch-opencv with the commands:

unzip torch-opencv-master.zip
cd torch-opencv-master
mkdir build && cd build
cmake .. -DOpenCV_DIR=/usr/local/opencv-3.0.0/share/OpenCV
make

The configuration phase seemed to go ok, except for the warning about opencv_optflow:

-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Warning at /usr/local/opencv-3.0.0/share/OpenCV/OpenCVConfig.cmake:219 (message):
opencv_optflow is required but was not found
Call Stack (most recent call first):
CMakeLists.txt:17 (FIND_PACKAGE)

-- Found Torch7 in /home/david/torch/install
-- Configuring done
-- Generating done
-- Build files have been written to: /home/david/torch/torch-opencv-master/build

The build appeared to succeed, but now I can't figure out how to tell luajit where to find torch-opencv, in other words how to get "require 'cv'" to work. I imagine that once you create a rockspec I will be able to just run "luarocks install", but meanwhile I'm not sure what symlinks I need to make and/or paths to set to connect torch's luajit to torch-opencv.

I appreciate any help you can provide.

Thanks,

-- Dave Slate

ml

OMG, I shouldn't have mentioned all these functions here

  • ParamGrid

TrainData

  • ctor
  • loadFromCSV
  • getSubVector
  • getLayout
  • getNTrainSamples
  • getNTestSamples
  • getNSamples
  • getNVars
  • getNAllVars
  • getSample
  • getSamples
  • getMissing
  • getTrainSamples
  • getTrainResponses
  • getTrainNormCatResponses
  • getTestResponses
  • getTestNormCatResponses
  • getResponses
  • getNormCatResponses
  • getSampleWeights
  • getTrainSampleWeights
  • getTestSampleWeights
  • getVarIdx
  • getVarType
  • getResponseType
  • getTrainSampleIdx
  • getTestSampleIdx
  • getValues
  • getNormCatValues
  • getDefaultSubstValues
  • getCatCount
  • getClassLabels
  • getCatOfs
  • getCatMap
  • setTrainTestSplit
  • setTrainTestSplitRatio
  • shuffleTrainTest

StatModel

  • getVarCount
  • empty
  • isTrained
  • isClassifier
  • train
  • train
  • calcError
  • predict

NormalBayesClassifier

  • ctor
  • predictProb

KNearest

  • ctor
  • getDefaultK
  • setDefaultK
  • getIsClassifier
  • setIsClassifier
  • getEmax
  • setEmax
  • getAlgorithmType
  • setAlgorithmType
  • findNearest

SVM

Kernel

  • getType
  • calc


  • ctor
  • getType
  • setType
  • getGamma
  • setGamma
  • getCoef0
  • setCoef0
  • getDegree
  • setDegree
  • getC
  • setC
  • getNu
  • setNu
  • getP
  • setP
  • setClassWeights
  • getClassWeights
  • setTermCriteria
  • getTermCriteria
  • getKernelType
  • setKernel
  • setCustomKernel
  • trainAuto
  • getSupportVectors
  • getDecisionFunction
  • getDefaultGrid

EM

  • ctor
  • getClustersNumber
  • setClustersNumber
  • getCovarianceMatrixType
  • setCovarianceMatrixType
  • getTermCriteria
  • setTermCriteria
  • getWeights
  • getMeans
  • getCovs
  • predict2
  • trainEM
  • trainE
  • trainM

DTrees

  • Node
  • Split
  • getMaxCategories
  • setMaxCategories
  • getMaxDepth
  • setMaxDepth
  • getMinSampleCount
  • setMinSampleCount
  • getCVFolds
  • setCVFolds
  • getUseSurrogates
  • setUseSurrogates
  • getUse1SERule
  • setUse1SERule
  • getTruncatePrunedTree
  • setTruncatePrunedTree
  • getRegressionAccuracy
  • setRegressionAccuracy
  • getPriors
  • setPriors
  • getRoots
  • getNodes
  • getSplits
  • getSubsets

RTrees

  • ctor
  • getCalculateVarImportance
  • setCalculateVarImportance
  • getActiveVarCount
  • setActiveVarCount
  • getTermCriteria
  • setTermCriteria
  • getVarImportance

Boost

  • ctor
  • getBoostType
  • setBoostType
  • getWeakCount
  • setWeakCount
  • getWeightTrimRate
  • setWeightTrimRate

ANN_MLP

  • ctor
  • setTrainMethod
  • getTrainMethod
  • setActivationFunction
  • setLayerSizes
  • getLayerSizes
  • getTermCriteria
  • setTermCriteria
  • getBackpropWeightScale
  • setBackpropWeightScale
  • getBackpropMomentumScale
  • setBackpropMomentumScale
  • getRpropDW0
  • setRpropDW0
  • getRpropDWPlus
  • setRpropDWPlus
  • getRpropDWMinus
  • setRpropDWMinus
  • getRpropDWMin
  • setRpropDWMin
  • getRpropDWMax
  • setRpropDWMax
  • getWeights

LogisticRegression

  • ctor
  • getLearningRate
  • setLearningRate
  • getIterations
  • setIterations
  • getRegularization
  • setRegularization
  • getTrainMethod
  • setTrainMethod
  • getMiniBatchSize
  • setMiniBatchSize
  • getTermCriteria
  • setTermCriteria
  • predict
  • get_learnt_thetas
  • randMVNormal
  • randGaussMixture
  • createConcentricSpheresTestSet

Problem loading a few libraries; torch 7 older than 21 Oct 2015

After a successful build in Ubuntu 64 14.04.2, some libraries can be loaded e.g. highgui, but some cannot e.g. imgproc and videoio:

local cv = require 'cv'
require 'cv.imgproc' -- image processing

produces:

/home/omid/torch/install/share/lua/5.1/trepl/init.lua:363: /home/omid/torch/install/share/lua/5.1/trepl/init.lua:363: /home/omid/torch/install/share/lua/5.1/torch/init.lua:65: bad argument #2 to 'newmetatable' (parent class name or nil expected)
stack traceback:
    [C]: in function 'error'
    /home/omid/torch/install/share/lua/5.1/trepl/init.lua:363: in function 'require'
    [string "require 'cv.imgproc' -- image processing"]:1: in main chunk
    [C]: in function 'xpcall'
    /home/omid/torch/install/share/lua/5.1/trepl/init.lua:648: in function 'repl'
    ...omid/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:185: in main chunk
    [C]: at 0x00406670  

Segfault: denoising demo

demo/denoising.lua

shrubb@samsung:~/Projects/opencv.torch$ th demo/denoising.lua ~/Pictures/2015-09-09/DSC_2191_o.jpg ~/Pictures/2015-09-09/DSC_2191_o.jpg 
*** Error in `/home/shrubb/Programs/Torch/install/bin/luajit': malloc(): memory corruption: 0x0000000001d1f4d0 ***
Aborted (core dumped)

photo tests

  • inpaint
  • fastNlMeansDenoising
  • fastNlMeansDenoising
  • fastNlMeansDenoisingColored
  • fastNlMeansDenoisingMulti
  • fastNlMeansDenoisingMulti
  • fastNlMeansDenoisingColoredMulti
  • denoise_TVL1
  • decolor
  • seamlessClone
  • colorChange
  • illuminationChange
  • textureFlattening
  • edgePreservingFilter
  • detailEnhance
  • pencilSketch
  • stylization

Classes:

  • TonemapDrago
  • TonemapDurand
  • TonemapReinhard
  • TonemapMantiuk
  • AlignMTB
  • CalibrateDebevec
  • CalibrateRobertson
  • MergeDebevec
  • MergeMertens
  • MergeRobertson

Decide the form of creating tests

What we do need at the time being is a good code coverage by unit tests. How should we organize these tests? What will be the script to run? etc.

VideoCapture{filename}

Hi,
I've tried to run this functionality with web cam and it runs well. But I could not run it with any video file.
I tried this:

th> cap = cv.VideoCapture{filename='/home/user/MH.avi'}

th> cap:isOpened()
false

How to run torch-opencv outside of torch-opencv-master

Hi.

I have one more question related to my closed issue "Problems using torch-opencv #46". It looks like I can now run cv from the torch-opencv-master directory. However, I still have not figured out how to successfully access cv from other directories. No matter how I try to set paths, torch still has trouble finding the right ".lua" and/or ".so" files. Can you tell me exactly what I need to do so torch-opencv works when th is launched in a different directory?

Thanks.

Modify function interface style

Currently, we use this style:

function cv.GaussianBlur(t)
    local src =        assert(t.src)
    local dst =        t.dst
    local ksize =      cv.Size(assert(t.ksize))
    -- ....

You may notice that it's not very pleasant to call all the functions this way, as you'll have to either memorize all the argument names or to consult OpenCV docs right along:

cv.GaussianBlur{
    src = image, 
    dst = image, 
    ksize = {7,7}, 
    sigmaX = 1.5,
    sigmaY = 1.5
}

cv.Canny{
    image = image,
    edges = edges,
    threshold1 = 0,
    threshold2 = 30,
    apertureSize = 3
}
cv.demosaicing{_src=edges _dst=edges, code=2}
cv.imshow{winname="an image", image=edges}
cv.waitKey{delay=30}

That's why it may be a good idea to support positional arguments as well:

function cv.GaussianBlur(t)
    local src =        assert(t[1] or t.src)
    local dst =        t[2] or t.dst
    local ksize =      cv.Size(assert(t[3] or t.ksize))
    local sigmaX =     assert(t[4] or t.sigmaX)
    local sigmaY =     t[5] or t.sigmaY or 0
    local borderType = t[6] or t.borderType or cv.BORDER_DEFAULT

    -- ...
end

I suggest that we should use this style from now on. I'll write a script to modify all the previous code.

features2d

  • KeyPointsFilter
  • Feature2D
  • BRISK
  • ORB
  • MSER
  • FAST
  • FastFeatureDetector
  • AGAST
  • AgastFeatureDetector
  • GFTTDetector
  • SimpleBlobDetector
  • KAZE
  • AKAZE
  • DescriptorMatcher
  • BFMatcher
  • FlannBasedMatcher


  • drawKeypoints
  • drawMatches
  • drawMatchesKnn
  • evaluateFeatureDetector
  • computeRecallPrecisionCurve
  • getRecall
  • getNearestPoint


  • BOWTrainer
  • BOWKMeansTrainer
  • BOWImgDescriptorExtractor

Tensor-Mat conversion

I know this great project is in its alpha/beta stage, but I decided to try it nevertheless:). Maybe I just expect too much from Tensor-Mat conversion, but it seems to me that it assumes contiguous Tensors and different dimension ordering than it is common in Torch (WHC instead of CHW).

Specifically, I want to call cv.resize(). I tried lots of variants (leading to segfaults, weird results or failed asserts in _OutputArray::create()) but this is the only thing which works for me:

local img = torch.FloatTensor(4, 128, 128)
img = cv.resize{src=img:transpose(1, 3):contiguous(), dsize={256, 256}}
img = img:transpose(1, 3):contiguous()

Can the transposition be maybe hidden inside TensorWrapper? Can't really OpenCV work with non-contiguous tensors? I'm I doing something really wrong?

objdetect for face detection

I know that it was not in the original proposal, but I realized that we could do some cool demos with it. Is it difficult to wrap?

ml tests

TrainData
StatModel
NormalBayesClassifier
KNearest
SVM
EM
DTrees
RTrees
Boost
ANN_MLP
LogisticRegression

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.