c++版本的opencv函数

opencv-c++ 类型说明Point二维点类Point3三维点类Rect矩形类旋转矩形类Range范围类Scalar通道类Size规格类。 阅读详情

C++版本的好处:


1、在于可以尽量避免使用指针这种危险的东西;


2、不用费心去release资源了,因为在其destructor里面,系统会自动帮你搞定。


3、在某些情况下会比C版本运行速度快。


在文件中包含 using namespace cv;


 






1.    Imread(CvLoadImage):loads an image from a file;


2.        imshow(cvShowImage):displays an image in the specifiedwidow;


3.        waitKey(cvWaitKey):waits for a pressed key;


4.        cvtColor(cvCvtColor):converts an image from one colorspace to another;


5.        reduce(cvReduce):reduces a matrix to a vector;


6.        minMaxLoc(cvMinMaxLoc):finds the global minimum andmaximum in a whole array or sub-array;


7.        namedWindow(cvNamedWindow):creates a window;


8.        destroyWindow(cvDestroyWindow):destroys a window;


9.        destroyAllWindows(cvDestroyAllWindows):destroys all of the HighGUIwindows;


10.    imwrite(cvSaveImage):saves an image to a specified file;


11.    resize(cvResize):resizes an image;


12.    pyrDown(cvPyrDown):blurs an image and downsamples it;


13.    pyrUp(cvPyrUp):upsamples an image and then blursit;


14.    threshold(cvThreshold):applies a fixed-level threshold toeach array element;


15.    adaptiveThreshold(cvAdaptiveThreshold):applies an adaptive threshold toan array;


16.    VideoCapthure::open(cvCaptureFromFile):open video file or a capturingdevice for video capturing;


17.    VideoCapture::isOpened:returns true if video capturinghas been initialized already;


18.    VideoCapture::release(cvReleaseCapture):closes video file or capturingdevice;


19.    VideoCapture::grab(cvGrabFrame):grabs the next frame from videofile or capturing device;


20.    VideoCaputre::retrieve(cvRetrieveFrame):decodes and returns the grabbedvideo frame;


21.    VideoCapture::read(cvQueryFrame):grabs,decodes and returns the nextvideo frame;


22.    VideoCapture::get(cvGetCaptureProperty):returns the specified VideoCaptureproperty;


23.    VideoCapture::set(cvSetCaptureProperty):sets a property in theVideoCapture;


24.    VideoWriter::open:initializes or reinitializes videowriter;


25.    VideoWriter::isOpened:returns true if video writer hasbeen successfully initialized;


26.    VideoWriter::write:writes the next video frame;


27.    Mat::row:creates a matrix header for thespecified matrix row;


28.    Mat::col:creates a matrix header for thespecified matrix column;


29.    Mat::rowRange:creates a matrix header for thespecified row span;


30.    Mat::colRange:creates a matrix header for thespecified col span;


31.    Mat::diag:extracts a diagonal from a matrix,or creates a diagonal matrix;


32.    Mat::clone:creates a full copy of the arrayand the underlying data;


33.    Mat::copyTo(cvCopy):copies the matrix to another one;


34.    Mat::convertTo(cvConvertScale):converts an array to anotherdatatype with optional scaling;


35.    Mat::assignTo:provides a functional form ofconvertTo;


36.    Mat::setTo:sets all or some of the arrayelements to the specified value;


37.    Mat::reshape:changes the shape and/or thenumber of channels of a 2D matrix without copying the data;


38.    Mat::t:transposes a matrix;


39.    Mat::inv:inverses a matrix;


40.    Mat::mul:performs an element-wisemultiplication or division of the two matrices;


41.    Mat::cross:computes a cross-product of two3-element vectors;


42.    Mat::dot:computes a dot-product of twovectors;


43.    Mat::zeros:returns a zero array of thespecified size and type;


44.    Mat::ones:returns an array of all 1’s of thespecified size and type;


45.    Mat::eye:returns an identity matrix of thespecified size and type;


46.    Mat::create:allocates new array data if needed;


47.    Mat::addref:increments the reference counter;


48.    Mat::release:decrements the reference counterand deallocates the matrix if needed;


49.    Mat::resize:changes the number of matrix rows;


50.    Mat::reserve:reserves space for the certainnumber of rows;


51.    Mat::push_back:adds elements to the bottom of thematrix;


52.    Mat::pop_back:removes elements from the bottomof the matrix;


53.    Mat::locateROI:locates the matrix header within aparent matrix;


54.    Mat::adjustROI:adjusts a submatrix size andposition within the parent matrix;


55.    Mat::operator:extracts a rectangular submatrix;


56.    Mat::operatorCvMat:creates the CvMat header for thematrix;


57.    Mat::operatorIplImage:creates the IplImage header forthe matrix;


58.    Mat::total:returns the total number fo arrayelements;


59.    Mat::isContinuous:reports whether the matrix iscontinuous or not;


60.    Mat::elemSize:returns the matrix element size inbytes;


61.    Mat::elemSize1:returns the size of each matrixelement channel in bytes;


62.    Mat::type:returns the type of a matrixelement;


63.    Mat::depth:returns the depth of a matrixelement;


64.    Mat::channels:returns the number of matrix channels;


65.    Mat::step1:returns a normalized step;


66.    Mat::size:returns a matrix size;


67.    Mat::empty:returns true if the array has noelemens;


68.    Mat::ptr:returns a pointer to the specifiedmatrix row;


69.    Mat::at:returns a reference to thespecified array element;


70.    Mat::begin:returns the matrix iterator andsets it to the first matrix element;


71.    Mat::end:returns the matrix iterator andsets it to the after-last matrix element;


72.    calcHist(cvCalcHist):calculates a histogram of a set ofarrays;


73.    compareHist(cvCompareHist):compares two histograms;


74.    equalizeHist(cvEqualizeHist):equalizes the histogram of agrayscale image(直方图均衡化);


75.    normalize:normalizes the norm or value rangeof an array;


76.    CascadeClassifier::CascadeClassifier:loads a classifier from a file;


77.    CascadeClassifier::empth:checks whether the classifier hasbeen loaded;


78.    CascadeClassifier::load(cvLoadHaarClassifierCascade):loads a classifier from a file;


79.    CascadeClassifier::read:reads a classifier from aFileStorage node;


80.    CascadeClassifier::delectMultiScale(cvHaarDetectObjects):detects objects of different sizesin the input image(检测图像中的目标);


81.    CascadeClassifier::setImage(cvSetImagesForHaarClassifierCascade):sets an image for detection(隐藏的cascade(hidden cascade)指定图像);


82.    CascadeClassifier::runAt(cvRunHaarClassifierCascade):runs the detector at the specifiedpoint(在给定位置的图像中运行cascade of boosted classifier);


83.    groupRectangles:groups the object candidaterectangles;


84.    split(cvSplit):divides a multi-channel array intoseveral single-channel arrays;


85.    merge(cvMerge):creates one multichannel array outof several single-channel ones;


86.    mixChannels(cvMixChannels):copies specified channels frominput arrays to the specified channels of output arrays;


87.    setMouseCallback(cvSetMouseCallback):sets mouse handler for thespecified window;


88.    bilateralFilter:applies the bilateral filter to animage(双边滤波);


89.    blur(cvSmooth):blurs an image using thenormalized box filter(均值模糊);


90.    medianBlur:blurs an image using the medianfilter(中值模糊);


91.    boxFilter:blurs an image using the boxfilter;


92.    GaussianBlur:blurs an image using a Gaussianfilter(高斯模糊);


93.    getGaussianKernel:returns Gaussian filtercoefficients;


94.    sepFilter2D:applies a separable linear filterto an image;


95.    filter2D(cvFilter2D):convolves an image with the kernel;


96.    norm(cvNorm):calculates an absolute array norm,an absolute difference norm, or a relative defference norm;


97.    flip(cvFlip):filps a 2D array around vertical,horizontal, or both axes;


98.    Algorithm::get:returns the algorithm parameter;


99.    Algorithm::set:set the algorithm parameter;


100. Algorithm::write:stores algorithm parameters in afile storage;


101. Algorithm::read:reads algorithm parameters from afile storage;


102. Algorithm::getList:returns the list of registeredalgorithms;


103. Algorithm::create:creates algorithm instance by name;


104. FaceRecognizer::train:trains a FaceRecognizer with givendata and associated labels;


105. FaceRecognizer::update:updates a FaceRecognizer withgiven data and associated labels;


106. FaceRecognizer::predict:predicts a label and associatedconfidence(e.g. distance) for a given input image;


107. FaceRecognizer::save:saves a FaceRecognizer and itsmodel state;


108. FaceRecognizer::load:loads a FaceRecognizer and itsmodel state;


109. createEigenFaceRecognizer:;


110. createFisherFaceRecognizer:;


111. createBPHFaceRecognizer:;


112. getTextSize(cvGetTextSize):calculates the width and height ofa textstring;


113. putText(cvPutText):draws a text string;


114. getStructuringElement(cvCreateStructingElementEx):returns a structuring element ofthe specified size and shape for morphological operations;


115. morphologyEx(cvMorphologyEx):performs advanced morphologicaltransformations;


116. findContours(cvFindContours):finds contours in a binary image;


117. drawContours(cvDrawContours):draw contours outlines or filledcontours;


118. minAreaRect(cvMinAreaRect2):finds a rotated rectangle of theminimum area enclosing the input 2D point set;


119. floodFill(cvFloodFill):fills a connected component withthe given color;


120. getRectSubPix(cvGetRectSubPix):retrieves a pixel rectangle froman image with sub-pixel accuracy;


121. CvSVM::CvSVM:default and training constructors;


122. CvSVM::train:trains an SVM;


123. CvSVM::train_auto:trains an SVM with optimalparameters;


124. CvSVM::predict:predicts the response for inputsample(s);


125. CvSVM::get_default_grid:generates a grid for SVMparameters;


126. CvSVM::get_params:returns the current SVM parameters;


127. CvSVM::get_support_vector:retrieves a number of supportvectors and the particular vector;


128. CvSVM::get_var_count:returns thenumber of used features(variables count);


129. CvANN_MLP(multi-layerperceptrons)::CvANN_MLP:the constructors;


130. CvANN_MLP::create:constructs MLP with the specifiedtopology;


131. CvANN_MLP::train:trains/updates MLP;


132. CvANN_MLP::predict:predicts responses for inputsamples;


133. CvANN_MLP::get_layer_count:returns the number fo layers inthe MLP;


134. CvANN_MLP::get_layer_size:returns numbers of neurons in eachlayer of the MLP;


135. CvANN_MLP::get_weights:returns neurons weights of theparticular layer;


136. CvKNearest::CvKNearest:default and training constructors;


137. CvKNearest::train:trains the model;


138. CvKNearest::find_nearest:finds the neighbors and predictsresponses for input vectors;


139. CvKNearest::get_max_k:returns the number of maximumneighbors that may be passed to the method CvKNearest::find_nearest();


140. CvKNearest::get_var_count:returns the number of usedfeatures(variables count);


141. CvKNearest::get_sample_count:returns the total number of trainsamples;


142. CvKNearest::is_regression:returns type of the problem(truefor regression and false for classification);


143. HoughLines(cvHoughLines):finds lines in a binary imageusing the standard Hough transform;


144. HoughLinesP:finds line segments in a binaryimage using the probabilistic Hough transform;


145. HoughCircles(cvHoughCircles):finds circles in a grayscale imageusing the Hough transform;


146. line(cvLine):draws a line segment connectingtwo points;


147. fitLine(cvFitLine):fits a line to a 2D or 3D pointset;


148. fitEllipse(cvFitEllipse2):fits an ellipse around a set of 2Dpoints;


149. ellipse(cvEllipse、cvEllipseBox):draws a simple or thick ellipticarc or fills an ellipse sector;


150. boundingRect(cvBoundingRect):calculatesthe up-right bounding rectangle of a point set;


151. rectangle(cvRectangle):draws a simple, thick, or filledup-right rectangle;


152. minEnclosingCircle(cvMinEnclosingCircle):finds acircle of the minimum area enclosing a 2D point set;


153. circle(cvCircle):draw a circle;


154. fillPoly:fills the area bounded by one ormore polygons;


155. approxPolyDP(cvApproxPoly):approximates a polygonal curve(s)with the specified precision;


156. pointPolygonTest(cvPointPolygonTest):performs a point-in-contour test(判断点在多边形中的位置);


157. convexHull(cvConvexHull2):finds the convex hull of a pointset;


158. transpose(cvTranspose):transposes a matrix;


159. invert(cvInvert):finds the inverse orpseudo-inverse of a matrix;


160. getStructuringElement(cvCreateStructuringElementEx):returns a structuring element ofthe specified size and shape for morphological operations;


161. absdiff(cvAbsDiff):calculates the per-elementabsolute difference between two arrays or between an array and a scalar;


162. subtract(cvSub):calculates the per-elementdifference between two arrays or array and a scalar;


163. multiply(cvMul):calculates the per-element scaledproduct fo two arrays;


164. divide(cvDiv):performs per-element division oftwo arrays or a scalar by an array;


165. bitwise_or(cvOr):calculates the per-elementbit-wise disjunction of two arrays or an array and a scalar;


166. bitwise_and(cvAnd):calculates the per-elementbit-wise conjunction of two arrays or an array and a scalar;


167. bitwise_not(cvNot):inverts every bit of an array;


168. bitwise_xor(cvXor):calculates the per-elementbit-wise “exclusive of” operation on two arrays or an array and a scalar;


169. erode(cvErode):erodes an image by using a specificstructuring element;


170. dilate(cvDilate):dilates an image by using aspecific structuring element;


171. min(cvMin):calculates per-element minimum oftwo arrays or an array and a scalar;


172. max(cvMax):calculates per-element maximum oftwo arrays or an array and a scalar;


173. add(cvAdd):calculates the per-element sum oftwo arrays or an array and a scalar;


174. addWeighted(cvAddWeighted):calculates the weighted sum of twoarrays;


175. scaleAdd(cvScaleAdd):calculats the sum of a scaledarray and another array;


176. saturate_cast():template function for accurateconversion from one primitive type to another;


177. sqrt(cvSqrt):calculates a square root of arrayelements;


178. pow(cvPow):raises every array element to apower;


179. abs:calculates an absolute value ofeach matrix element;


180. convertScaleAbs(cvConvertScaleAbs):scales, calculates absolutevalues, and converts the result to 8-bit;


181. cuberoot(cvCbrt):computes the cube root of anargument;


182. exp(cvExp):calculates the exponent of everyarray element;


183. log(cvLog):calculates the natural logarithmof every array element;


184. Canny(cvCanny):finds edges in an image using theCanny algorithm;


185. Sobel(cvSobel):calculates the first, second,third, or mixed image derivatives using an extended Sobel operator;


186. Scharr:Calculates the first x – or y –image derivative using Scharr operator(Scharr 滤波器);


187. Laplacian(cvLaplace):calculates the Laplacian of animage;


188. getDerivKernels:returns filter coefficients forcomputing spatial image derivatives;


189. contourArea(cvContourArea):calculates a contour area;


190. LUT(cvLUT):performs a look-up table transformof an array;


191. calcBackProject(cvCalcBackProject):calculates the back projection ofa histogram(反向投影);


192. arcLength(cvArcLength):calculates a contour perimeter ora curve length;


193. meanShift(cvMeanShift):finds an object on a backprojection image;


194. CamShift(cvCamShift):finds an object center, size, andorientation;


195. TermCriteria:template class definingtermination criteria for iterative algorithms;


196. createTrackbar(cvCreateTrackbar):creates a trackbar and attaches itto the specified window;


197. watershed(cvWatershed):performs a marker-based imagesegmentation using the watershed algorithm;


198. grabCut:runs the GrabCut algorithm;


199. compare(cvCmp):performs the per-elementcomparison of two arrays or an array and scalar value;


200. mean(cvAvg):calculates an average(mean) ofarray elements;


201. meanStdDev(cvAvgSdv):calculates a mean and standarddeviation of array elements;


202. cartToPolar(cvCartToPolar):calculates the magnitude and angleof 2D vectors;


203. moments(cvMoments):calculates all of the moments upto the third order of a polygon or rasterized shape;


204. matchShapes(cvMatchShapes):compares two shapes;


205. cornerHarris(cvCornerHarris):Harris edge detector;


206. goodFeaturesToTrack(cvGoodFeaturesToTrack):determines strong corners on an image;


207. classFeatureDetector:abstract base class for 2D imagefeature detectors;


208. classFastFeatureDetector:wrapping class for featuredetection using the FAST() method;


209. classSURF(SurfFeatureDetector、SurfDescriptorExtractor):extracting Speeded Up Robust Featuresfrom an image;


210. classSIFT(SiftFeatureDetector):extracting keypoints and computingdescriptors using the Scale Invariant Feature Transform(SIFT) algorithm;


211. SURF::operator(cvExtractSURF):detects keypoints and computesSURF descriptors for them;


212. drawKeypoints:draw keypoints;


213. drawMatches:draws the found matches ofkeypoints from two images;


214. classDescriptorMatcher:abstract base class for matchingkeypoint descriptors. It has two groups of match methods,for matchingdescriptors of an image with another image or with an image set;


215. findChessboardCorners(cvFindChessboardCorners):finds the positions of internalcorners of the chessboard;


216. drawChessboardCorners(cvDrawChessboardCorners):renders the detected chessboardcorners;


217. calibrateCamera(cvCalibrateCamera2):finds the camera intrinsic andextrinsic parameters from several view of a calibration pattern;


218. initUndistortRectifyMap(cvInitUndistortMap、cvInitUndistortRectifyMap):computes the undistortion andrectification transformation map;


219. remap(cvRemap):applies a generic geometricaltransformation to an image;


220. calibrationMatrixValues:computes useful cameracharacteristics from the camera matrix;


221. findFundamentalMat(cvFindFundamentalMat):calculates a fundamental matrixfrom the corresponding points in two images;


222. computeCorrespondEpilines(cvComputeCorrespondEpilines):for points in an image of a stereopair, computes the corresponding epilines in the other image;


223. findHomography(cvFindHomography):finds a perspective transformationbetween two planes;


224. warpPerspective(cvWarpPerspective):applies a perspectivetransformation to an image;


225. getPerspectiveTransform(cvGetPerspectiveTransform):calculates a perspective transformfrom four pairs of the corresponding points;


226. cornerSubPix(cvFindCornerSubPix):refines the corner locations;


227. calcOpticalFlowPyrLK(cvCalcOpticalFlowPyrLK):calculates an optical flow for asparse feature set using the iterative Lucas-Kanade method with pyramids;


228. swap:swaps two matrices;


229. accumulateWeighted(cvRunningAvg):updates a running average;


230. classBackgroundSubtractorMOG:gaussian mixture-basedbackground/foreground segmentation algorithm;


231. randu:generates a singleuniformly-distributed(均匀分布) random number or an array ofrandom numbers;


232. randn:fills the array with normallydistributed(正态分布) random numbers;


233. getTickCount:returns the number of ticks;


234. getTickFrequency:returns the number of ticks persecond(使用getTickCount和getTickFrequency两个函数可以计算执行某个算法所用时间);


235. CV_Assert:checks a condition at runtime andthrows exception if it fails;


236. saturate_cast:template function for accurateconversion from one primitive type to another;


237. classRNG:random number generator;


238. RNG::next:returns the next random number;


239. RNG::operatorT:returns the next random number ofthe specified type;


240. RNG::operator():returns the next random number;


241. RNG::uniform:returns the next random numbersampled from the uniform distribution;


242. RNG::gaussian:returns the next random numbersampled from the Gaussian distribution;


243. RNG::fill:fills arrays with random numbers;


244. getOptimalDFTSize(cvGetOptimalDFTSize):returns the optimal DFT size for agiven vector size;


245. copyMakeBorder(cvCopyMakeBorder):forms a border around an image;


246. dft(cvDFT):performs a forward or inverseDiscrete Fourier transform of a 1D or 2D floating-point array;


247. magnitude:calculates the magnitude(幅度) of 2D vectors;


248. classFileStorage:XML/YAML file storage class thanencapsulates all the information necessary for writing or reading data to/froma file;


249. FileStorage::open:open a file;


250. FileStorage::isOpened:checks whether the file is opened;


251. FileStorage::release:closes the file and releases allthe memory buffers;


252. FileStorage::releaseAndGetString:closes the file and releases allthe memory buffers;


253. FileStorage::getFirstTopLevelNode:returns the first element of thetop-level mapping;


254. FileStorage::root:returns the top-level mapping;


255. FileStorage::operator[]:returns the specified element ofthe top-level mapping;


256. FileStorage::operator*:returns the obsolete C FileStorage structure;


257. FileStorage::writeRaw:writes multiple numbers;


258. FileStorage::writeObj:writes the registered C structure(CvMat、CvMatND、CvSeq);


259. FileStorage::getDefaultObjectName:returns the normalized object name for thespecified name of a file;


260. getAffineTransform(cvGetAffineTransform):calculates an affine transformfrom three pairs of the corresponding points;


261. getRotationMatrix2D(cv2DRotationmatrix):calculates an affine matrix of 2Drotation;


262. warpAffine(cvWarpAffine):applies an affine transformationto an image;


263. matchTemplate(cvMatchTemplate):compares a template against overlapped imageregions;

C++版的Transpose转换 C++版的transpose多维数组变换 阅读详情

相关推荐

OpenCV版本问题带来的困扰

最近一直在用一些函数,突然发现有一些函数前面带cv,有的函数没有带,到底这二者有什么区别/ 如cvThreshold 和threshold、cvCvtcolor和cvtcolor、CvFindcontous和findcontous 网上对于这个问题的介绍很少,初步查了一下,觉得是版本问题,前面带cv的函数应该是OpenCV1.x版本的,不带cv应该是2.0之后的函数, C版本: in

程序人生 1606

c++版opencv长文指南

c++版opencv长文指南

weixin_50557558的博客 1万+

【C++】OpenCV:计算机视觉库介绍及C++环境配置

计算机视觉库介绍及C++环境配置

DevFrank的博客 1万+

基于C++的OpenCV常用函数

C++版本的好处: 1、在于可以尽量避免使用指针这种危险的东西; 2、不用费心去release资源了,因为在其destructor里面,系统会自动帮你搞定。 3、在某些情况下会比C版本运行速度快。 在文件中包含 using namespace cv;   1.        imread(cvLoadImage):loads an image from a file; 2.

网络资源是无限的 1万+

C++ opencv车道线识别

先上图再干活 1、 2、 (一)目前国内外广泛使用的车道线检测方法主要分为两大类: (1) 基于道路特征的车道线检测; (2) 基于道路模型的车道线检测。 基于道路特征的车道线检测作为主流检测方法之一,主要是利用车道线与道路环境的物理特征差异进行后续图像的分割与处理,从而突出车道线特征,以实现车道线的检测。该方法复杂度较低,实时性较高,但容易受到道路环境干扰。 基于道路模...

xiao__run的博客 2万+

ONNC Open Neural Network Compiler 开源神经网络编译器 一个 开源、模块化、可重用编译器算法和工具链的库,专门针对深度学习加速器(DLA)部署导入ONNX模型

ONNC是一个集合了开源、模块化、可重用编译器算法和工具链的库,专门针对深度学习加速器(DLA)。ONNC从底层开始构建,旨在将ONNX中间表示(IR)翻译成专有DLA代码。其软件架构设计强调可移植性和可重用性,从而简化了开发新后端的工作。上图展示了ONNC软件栈的顶层框图。软件栈从导入ONNX计算图模型到输出相应的硬件二进制文件,展示了各个功能块。

万有文的博客 1997

OpenCV函数库中C++版本与C版本对比

原文来自于:http://blog.youkuaiyun.com/fengbingchun/article/details/6177530 C++版本的好处: 1、在于可以尽量避免使用指针这种危险的东西; 2、不用费心去release资源了,因为在其destructor里面,系统会自动帮你搞定。 3、在某些情况下会比C版本运行速度快。 在文件中包含 using namespa

飞扬的青春的专栏 4050

Altium Designer铺铜陷阱:为什么你的死铜总是清除不干净?

本文深入探讨Altium Designer中铺铜操作导致死铜无法清除的常见问题,分析死铜形成的五大诱因,并提供高级参数优化和网络连接性验证技巧。通过调整边界计算精度和泪滴算法设置,有效解决死铜残留问题,提升PCB设计质量与制造良率。

weixin_29169505的博客 359

OpenCV的简单使用教程与基本函数(C++版本)

OpenCV的简单使用教程(C++)OpenCV简介OpenCV的使用基础打开、显示和保存图像图像存储变量 Mat类图像元素的存储读入图像文件创建Mat类复制Mat类图像元素的访问OpenCV画图命令行交互界面 OpenCV简介 OpenCV是一个开源发行的跨平台计算机视觉和机器学习软件库,提供了图像处理和计算机视觉方面的很多通用算法。接下来,我简要介绍一些OpenCV基础且常用的函数(C++接口)。 OpenCV的使用基础 在这里,我就不讲OpenCV的配置问题了。在使用OpenCV接口时,记得在代码开头

JavaYoung123的博客 3万+

Costas环参数调优指南:QPSK载波同步中的环路滤波器设计技巧

本文深入解析QPSK载波同步中Costas环的参数调优,特别是环路滤波器的设计技巧。通过分析星座图异常现象,提供从理论计算到MATLAB仿真的实战调优指南,涵盖环路带宽、阻尼系数等关键参数在不同信噪比场景下的选择策略,旨在解决载波同步失锁、性能下降等工程难题。

weixin_29035147的博客 548

同花顺 python量化交易_开启量化第一步!同花顺iFinD数据接口免费版简易操作教程...

来源:雪球App,作者: 同花顺-iFinD,(https://xueqiu.com/6706494343/141951051)金融市场波动频繁,投资往往会夹杂非理性的情绪。而量化交易,旨在以先进的数学模型替代人为的主观判断,利用计算机技术从庞大的历史数据中海选能带来超额收益的多种“大概率”事件以制定策略,辅助投资者进行理性投资。不过计算机分析存在一定的技术门槛,有没有简单易学的量化交易方式,能够...

weixin_35911805的博客 2万+

opencv常用函数(c++版本)

Mat: 在2001年刚刚出现的时候,OpenCV基于 C 语言接口而建。为了在内存(memory)中存放图像,当时采用名为 IplImage 的C语言结构体,时至今日这仍出现在大多数的旧版教程和教学材料。但这种方法必须接受C语言所有的不足,这其中最大的不足要数手动内存管理,其依据是用户要为开辟和销毁内存负责。虽然对于小型的程序来说手动管理内存不是问题,但一旦代码开始变得越来越庞大,你需要越来越

ZL.Xiong 5410

QT入门开发一个时钟

本文讲述了时钟开发的具体过程以及代码。 涉及到一下几个知识点: 1. 定时器使用 2. 本地时间获取 3. resource资源读取 4. 图片绘制 5. 图片按照中心旋转 6. sin或者cos角度计算。

啊渊的专栏 5150

C++版本OpenCv教程(六)namedWindow函数&imshow函数的使用

目录图像窗口函数namedWindow图像显示函数imshow 图像窗口函数namedWindow 在我们之前的程序中并没有见到窗口函数,因为我们在显示图像时如果没有主动定义图像窗口,程序会自动生成一个窗口用于显示图像,然而有时我们需要在显示图像之前对图像窗口进行操作,例如添加滑动条,此时就需要提前创建图像窗口。创建窗口函数的原型。 void cv::namedWindow(const String & winname,int flags = WINDOW_AUTOSIZE) winname:

qq_33287871的博客 8756

OpenCV-Python实战(10)——详解 OpenCV 轮廓检测

在计算机视觉领域,轮廓通常指图像中对象边界的一系列点。因此,轮廓通常描述了对象边界的关键信息,包含了有关对象形状的主要信息,该信息可用于形状分析与对象检测和识别。在本文中,将首次通过简单示例了解轮廓的基本概念,然后通过实际示例来了解如何检测和压缩轮廓,最后利用介绍如何利用图像矩描述检测到的轮廓属性。

盼小辉丶的博客 3万+

微信小程序 - [wxapplib]] backgroundfetch privacy fail {“errno”:101,“errMsg”:“private_getBackgroundFetchDa

微信小程序报错之backgroundfetch privacy fail,微信小程序报错WAServiceMainContext.js:1 [wxapplib]] backgroundfetch privacy fail {“errno“:101,怎么解决?问题出现:调用wx.chooseMessageFile报错(开发者工具中正常)用户隐私协议中未声明小程序使用此功能,安卓真机调试报错:backgroundfetch privacy fail ,怎么解决?微信小程序[wxapplib]] backgrou

🏆 前端领域优质创作者 1万+

C++版本OpenCv教程(五)图像读取函数imread

我们在前面已经见过了图像读取函数imread()的调用方式,这里我们给出函数的原型。 cv::Mat cv::imread(const String & filename,int flags=IMREAD_COLOR) filename:需要读取图像的文件名称,包含图像地址、名称和图像文件扩展名 flags:读取图像形式的标志,如将彩色图像按照灰度图读取,默认参数是按照彩色图像格式读取,可选参数在表2-3给出。 函数用于读取指定的图像并将其返回给一个Mat类变量,如果图像文件不存在、破损或者

qq_33287871的博客 2686

嵌入式硬件中AI硬件设计方法与技巧

嘉立创EDA推出AI助手Kimi插件,为PCB设计提供智能支持。该插件具备四大核心功能:AI问答助手可解答各类电路设计问题;元件查询功能直接展示参数和应用场景;智能分析网表可检测潜在问题;电路图识别能解析图纸结构并提供改进建议。用户需通过扩展插件安装,并配置Kimi API密钥后使用。该工具旨在提升工程师的设计效率,减少查阅资料时间,特别适合项目交接和设计自查场景。

嵌入式技术开发 1873

opencv中c/c++风格函数使用说明

1.  显示窗口大小的改变方法不同。   在c版本中,定义一个窗口时用cvNamedWindow.   比如说cvNamedWindow(“src”,0);后面的参数为0表示窗口大小可以手动改变,否则窗口的大小是自适应图片大小的。   而在c++版本中定义一个窗口用namedWindow.   比如说namedWindow(“src”,1);不管后面第二个参数是多少,都不能

机器智能 1847

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

OpenCV实践之路——TrackBar调整图像的亮度和对比度(OpenCV1和OpenCV2两种版本)

由于最开始接触的就是opencv2.0之后的版本,所以之前在看到Opencv1.0版本的C接口写就的代码时,感觉到诸多的不适应不习惯。今天做出了一个小小的突破,那就是见到opencv1.0的代码,我竟然想到用opencv2的C++版本重新实现一遍。顺便还简单了解了两个版本函数的变化和异同。本文前半部分主要参考下面的文章:HighGUI: Creating Interfaces。主要内容就是创建

星沉阁 3180

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

opencv中c版本和c++版本区别体验

1.  显示窗口大小的改变方法不同。   在c版本中,定义一个窗口时用cvNamedWindow.   比如说cvNamedWindow(“src”,0);后面的参数为0表示窗口大小可以手动改变,否则窗口的大小是自适应图片大小的。   而在c++版本中定义一个窗口用namedWindow.   比如说namedWindow(“src”,1);不管后面第二个参数是多少,都不能

大可的杨先森的博客 5851

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

Python-OpenCV难道比C++_OpenCV快?以调用Canny边缘检测函数为例

如果不调用第三方库,C++比Python快很多是不争的事实,下面的这些博文都以实际例子证明了C++比Python快很多的事实。 python和C++的性能分析(寻找素数) python运行速度和c_Python与C++之间运行速度对比 与Python的速度较量:C++究竟有多快? Python和C语言运行速度对比(累加1亿次)但是调用第三方库的情况可能就有所不同。 博主曾听说,我们在Python中使用的OpenCV,实际上是用C++写好的OpenCV代码进行编译得到的,本质上只是用Python调用C++程序

昊虹AI笔记 3634
上一篇: C语言文件操作之fread与fwrite
下一篇: 搭建可随意更改路径的VS工程-以ASIFT算法为例
zz420521
博客等级 码龄10年 6粉丝 8原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值