Opencv角点检测高分辨率图像 [英] Opencv corners detection for High resolution images

查看:340
本文介绍了Opencv角点检测高分辨率图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚实现角落检测使用OpenCV,我得到的角值为零。使用3488 * 2616分辨率相机图像。有任何适当的方法来找到角度检测高分辨率图像。知道我在哪里我的错误。我已附加我的代码和图像also.please帮助我非常新的opencv.sorry我的英语。

I've just implemented corner detection using OpenCV and i got the corner value as zero.i use 3488*2616 resolution camera images.it is there any proper way to find the corner detection for high resolution images.i d'not know where i did my mistake.Here with i've attached my code and images also.please help me.i'm very new to opencv.sorry for my English.

int board_w = 6;
int board_h = 6;
const int MAX_CORNERS = 500;

int main()
{

    int board_n = (board_w-1) * (board_h-1);
    CvSize board_sz = cvSize( board_w-1, board_h-1 );


    CvPoint2D32f* corners = new CvPoint2D32f[board_n];
    int cornerCount = 0;

    IplImage *image = cvLoadImage("myimage.jpg");
    IplImage *gray_image = cvCreateImage(cvGetSize(image),8,1);
    cvCvtColor(image, gray_image, CV_BGR2GRAY );
const int N = cvFindChessboardCorners(gray_image,board_sz,&corners[0],&cornerCount,10);


    cvFindCornerSubPix(gray_image,&corners[0],cornerCount,cvSize(3,3),cvSize(-1,-1),cvTermCriteria(CV_TERMCRIT_EPS,0,.01)); 

    printf("\ the count was:%d \n",cornerCount);
    for (int i = 0; i < cornerCount; i++)
    {
cvCircle (image, cvPointFrom32f (corners[i]), 3, CV_RGB (0, 0, 255), 2);

    }

        cvNamedWindow("firstframe");            
        cvShowImage("firstframe",image);
        cvWaitKey(0);
    cvReleaseImage(&image);
    cvReleaseImage(&gray_image);



}

对于正常的棋盘图像。但使用实时相机图像与那个分辨率,它不工作。提前帮助me.thanks。

The code will work for normal chessboard images.but while using real time camera images with that resolution it ll not works.please help me.thanks in advance.

推荐答案

如果您怀疑检测确实由于使用高分辨率图片而失败,您可以随时 cvResize() 您的 IplImage更小的尺寸,并验证您的观察结果。

If you suspect that detection is really failing simply because you are using high resolution images, you can always cvResize() your IplImage to a smaller size and verify your observation.

这篇关于Opencv角点检测高分辨率图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆