这篇教程C++ CV_READ_SEQ_ELEM函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CV_READ_SEQ_ELEM函数的典型用法代码示例。如果您正苦于以下问题:C++ CV_READ_SEQ_ELEM函数的具体用法?C++ CV_READ_SEQ_ELEM怎么用?C++ CV_READ_SEQ_ELEM使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CV_READ_SEQ_ELEM函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: drawSquaresvoid drawSquares(IplImage* img, CvSeq* squares, PointMatrix &mat){ CvSeqReader reader; IplImage* cpy = cvCloneImage(img); cvStartReadSeq(squares, &reader, 0); for (int i = 0; i < squares->total; i++) { CvPoint pt[4], *rect = pt; int count = 4; CV_READ_SEQ_ELEM(pt[0], reader); CV_READ_SEQ_ELEM(pt[1], reader); CV_READ_SEQ_ELEM(pt[2], reader); CV_READ_SEQ_ELEM(pt[3], reader); cvLine(cpy, pt[0], pt[2], CV_RGB(0, 0, 0), 1); cvLine(cpy, pt[1], pt[3], CV_RGB(255, 255, 0), 1); MyCvPoint myCvPoint( (pt[0].x + pt[2].x) /2, (pt[1].y + pt[2].y)/2, img->width, img->height); mat.AddMem(myCvPoint); cvPolyLine(cpy, &rect, &count, 1, 1, CV_RGB(0, 255, 255), 1, 8, 0); } // cvShowImage("After Modify", cpy); cvReleaseImage(&cpy);}
开发者ID:corvofeng,项目名称:cube,代码行数:27,
示例2: cvStartReadSeqvoid EyeTracker::drawSquares(CvSeq* squares){ CvSeqReader reader; int i; // initialize reader of the sequence cvStartReadSeq(squares, &reader, 0); CvPoint pt[4]; CvPoint* rect; // read 4 sequence elements at a time (all vertices of a square) for(i = 0; i < squares->total; i += 4) { rect = pt; int count = 4; // read 4 vertices CV_READ_SEQ_ELEM(pt[0], reader); CV_READ_SEQ_ELEM(pt[1], reader); CV_READ_SEQ_ELEM(pt[2], reader); CV_READ_SEQ_ELEM(pt[3], reader); cvPolyLine(graySceneImagePts, &rect, &count, 1, 1, CV_RGB(255, 255, 255), 3, CV_AA, 0); } CvFont font; cvInitFont(&font, CV_FONT_HERSHEY_SIMPLEX | CV_FONT_ITALIC, 1.0, 1.0, 0, 1); char s[20]; sprintf(s, "Threshold = %d", squareThreshold); cvPutText(graySceneImagePts, s, cvPoint(30, 30), &font, cvScalar(255, 255, 0));}
开发者ID:burakkoray,项目名称:EyeTracker,代码行数:33,
示例3: CV_FUNCNAMEvoidBlob::copy_edges(const CvSeq* _edges){ CV_FUNCNAME( "Blob::copy_edges" ); __BEGIN__; cvClearSeq(this->edges_); //- copy the given sequence CvSeqReader seq_reader; CvSeqWriter seq_writer; CvPoint current_edge; int i; CV_CALL( cvStartReadSeq( _edges, &seq_reader) ); CV_CALL( cvStartAppendToSeq( this->edges_, &seq_writer ) ); for( i = 0; i < _edges->total; i++) { CV_READ_SEQ_ELEM ( current_edge , seq_reader); CV_WRITE_SEQ_ELEM( current_edge , seq_writer ); } CV_CALL( cvEndWriteSeq( &seq_writer ) ); __END__; __ISL_CHECK_ERROR__;}
开发者ID:srgblnch,项目名称:ISL,代码行数:29,
示例4: cvStartReadSeqdouble BlobGetMaxYatMinX::operator()(Blob &blob){ double result = LONG_MIN; CvSeqReader reader; CvPoint actualPoint; BlobContour::t_PointList externContour; externContour = blob.GetExternalContour()->GetContourPoints(); if( !externContour ) return result; cvStartReadSeq( externContour, &reader); for( int i=0; i< externContour->total; i++) { CV_READ_SEQ_ELEM( actualPoint, reader); if( (actualPoint.x == blob.MinX()) && (actualPoint.y > result) ) { result = actualPoint.y; } } return result;}
开发者ID:DisCODe,项目名称:DCL_CvBlobs,代码行数:26,
示例5: operator virtual void operator()(const cv::BlockedRange& range) const {#ifdef HAVE_TBB tbb::spin_mutex::scoped_lock lock;#endif CvSeqReader reader; int begin = range.begin(); int end = range.end(); int weak_count = end - begin; CvDTree* tree; for (int i=0; i<k; ++i) { float tmp_sum = 0.0f; if ((weak[i]) && (weak_count)) { cvStartReadSeq( weak[i], &reader ); cvSetSeqReaderPos( &reader, begin ); for (int j=0; j<weak_count; ++j) { CV_READ_SEQ_ELEM( tree, reader ); tmp_sum += shrinkage*(float)(tree->predict(sample, missing)->value); } }#ifdef HAVE_TBB lock.acquire(SumMutex); sum[i] += tmp_sum; lock.release();#else sum[i] += tmp_sum;#endif } } // Tree_predictor::operator()
开发者ID:Rocky030,项目名称:opencv,代码行数:34,
示例6: maskFromTemplatestd::vector<CvPoint>maskFromTemplate (const std::vector<cv::linemod::Template>& templates, int num_modalities, cv::Point offset, cv::Size size, cv::Mat& mask, cv::Mat& dst){ templateConvexHull (templates, num_modalities, offset, size, mask); const int OFFSET = 30; cv::dilate (mask, mask, cv::Mat (), cv::Point (-1, -1), OFFSET); CvMemStorage * lp_storage = cvCreateMemStorage (0); CvTreeNodeIterator l_iterator; CvSeqReader l_reader; CvSeq * lp_contour = 0; cv::Mat mask_copy = mask.clone (); IplImage mask_copy_ipl = mask_copy; cvFindContours (&mask_copy_ipl, lp_storage, &lp_contour, sizeof(CvContour), CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE); std::vector<CvPoint> l_pts1; // to use as input to cv_primesensor::filter_plane cvInitTreeNodeIterator (&l_iterator, lp_contour, 1); while ( (lp_contour = (CvSeq *) cvNextTreeNode (&l_iterator)) != 0) { CvPoint l_pt0; cvStartReadSeq (lp_contour, &l_reader, 0); CV_READ_SEQ_ELEM(l_pt0, l_reader); l_pts1.push_back (l_pt0); for (int i = 0; i < lp_contour->total; ++i) { CvPoint l_pt1; CV_READ_SEQ_ELEM(l_pt1, l_reader); /// @todo Really need dst at all? Can just as well do this outside cv::line (dst, l_pt0, l_pt1, CV_RGB(0, 255, 0), 2); l_pt0 = l_pt1; l_pts1.push_back (l_pt0); } } cvReleaseMemStorage (&lp_storage); return l_pts1;}
开发者ID:nqanh,项目名称:moveit_bigman,代码行数:47,
示例7: vectorPunts/**- FUNCTION: FillBlob- FUNCTIONALITY: - Fills the blob with a specified colour- PARAMETERS: - imatge: where to paint - color: colour to paint the blob- RESULT: - modifies input image and returns the seed point used to fill the blob- RESTRICTIONS:- AUTHOR: Ricard Borr C++ CV_RGB函数代码示例 C++ CV_NO_GUI_ERROR函数代码示例
|