本文整理汇总了C++中image::ipl方法的典型用法代码示例。如果您正苦于以下问题:C++ image::ipl方法的具体用法?C++ image::ipl怎么用?C++ image::ipl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类image
的用法示例。
在下文中一共展示了image::ipl方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: imshow_impl
void imshow_impl(
const image<T1, D1>& im1, const char* title1,
const image<T2, D2>& im2, const char* title2,
const image<T3, D3>& im3, const char* title3,
const image<T4, D4>& im4, const char* title4,
const image<T5, D5>& im5, const char* title5)
{
IplImage* ipl1;
IplImage* ipl2;
IplImage* ipl3;
IplImage* ipl4;
IplImage* ipl5;
ipl1 = im1.ipl();
cvNamedWindow(title1, 1);
cvShowImage(title1, ipl1);
if(title2) {
ipl2 = im2.ipl();
cvNamedWindow(title2, 2);
cvShowImage(title2, ipl2);
}
if(title3) {
ipl3 = im3.ipl();
cvNamedWindow(title3, 3);
cvShowImage(title3, ipl3);
}
if(title4) {
ipl4 = im4.ipl();
cvNamedWindow(title4, 4);
cvShowImage(title4, ipl4);
}
if(title5) {
ipl5 = im5.ipl();
cvNamedWindow(title5, 5);
cvShowImage(title5, ipl5);
}
cvWaitKey(0); // very important, contains event processing loop inside
cvDestroyWindow(title1);
if(title2) cvDestroyWindow(title2);
if(title3) cvDestroyWindow(title3);
if(title4) cvDestroyWindow(title4);
if(title5) cvDestroyWindow(title5);
cvReleaseImage(&ipl1);
if(title2) cvReleaseImage(&ipl2);
if(title3) cvReleaseImage(&ipl3);
if(title4) cvReleaseImage(&ipl4);
if(title5) cvReleaseImage(&ipl5);
}
示例2: show
void show(const image<T>& img, const char* title)
{
IplImage* ipl1 = img.ipl();
cvNamedWindow(title, 1);
cvShowImage(title, ipl1);
cvWaitKey(0); // very important, contains event processing loop inside
cvDestroyWindow(title);
cvReleaseImage(&ipl1);
}
示例3: cvCreateImage
typename image<T, D>::create_new median_blur(const image<T, D>& a, int neighbourhood)
{
IplImage* src = a.ipl();
IplImage* dst = cvCreateImage(cvGetSize(src),
image_details::ipl_depth<T>(), int(a.channels()));
cvSmooth(src, dst, CV_MEDIAN, neighbourhood);
typename image<T, D>::create_new r(dst);
cvReleaseImage(&src);
cvReleaseImage(&dst);
return r;
}
示例4: laplace
typename image<T, D>::create_new laplace(const image<T, D>& a,
int aperture_size)
{
IplImage* src = a.ipl();
IplImage* dst = cvCreateImage(cvGetSize(src),
image_details::ipl_depth<T>(), int(a.channels()));
cvLaplace(src, dst, aperture_size);
typename image<T, D>::create_new r(dst);
cvReleaseImage(&src);
cvReleaseImage(&dst);
return r;
}
示例5: edges
typename image<T, D>::create_new edges(const image<T, D>& a,
double threshold1, double threshold2, int aperture_size)
{
IplImage* src = a.ipl();
IplImage* dst = cvCreateImage(cvGetSize(src),
image_details::ipl_depth<T>(), 1);
cvCanny(src, dst, threshold1, threshold2, aperture_size);
typename image<T, D>::create_new r(dst);
cvReleaseImage(&src);
cvReleaseImage(&dst);
return r;
}
示例6: sobel
typename image<T, D>::create_new sobel(const image<T, D>& a,
int y_order, int x_order, int aperture_size)
{
IplImage* src = a.ipl();
IplImage* dst = cvCreateImage(cvGetSize(src),
image_details::ipl_depth<T>(), (int)a.channels());
cvSobel(src, dst, x_order, y_order, aperture_size);
typename image<T, D>::create_new r(dst);
cvReleaseImage(&src);
cvReleaseImage(&dst);
return r;
}
示例7: resample
typename image<T, D>::create_new resample(const image<T, D>& a, size_t rows, size_t cols,
interpolation interp)
{
IplImage* src = a.ipl();
IplImage* dst = cvCreateImage(
image_details::cv_size(cols, rows),
image_details::ipl_depth<T>(), int(a.channels()));
cvResize(src, dst, image_details::interpolation_map[interp]);
typename image<T, D>::create_new r(dst);
cvReleaseImage(&src);
cvReleaseImage(&dst);
return r;
}
示例8: rotate
typename image<T, D>::create_new rotate(const image<T, D>& a, double angle,
const float_point<2>& center, double scale, interpolation interp,
warp_method warp_m, color<T, D::Ch> fill_color)
{
IplImage* src = a.ipl();
IplImage* dst = cvCreateImage(cvGetSize(src),
image_details::ipl_depth<T>(), int(a.channels()));
CvPoint2D32f cvcenter;
cvcenter.x = center.x;
cvcenter.y = center.y;
CvMat* map_matrix = cvCreateMat(2, 3, image_details::cv_type<double>());
cv2DRotationMatrix(cvcenter, angle, scale, map_matrix );
cvWarpAffine(src, dst, map_matrix,
image_details::interpolation_map[interp]+
image_details::warp_map[warp_m] ,
image_details::to_cvscalar(fill_color));
typename image<T, D>::create_new r(dst);
cvReleaseMat(&map_matrix);
cvReleaseImage(&src);
cvReleaseImage(&dst);
return r;
}