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

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

问题描述

我刚刚实现利用OpenCV的角点检测,然后拿到了一角值zero.i使用3488 * 2616分辨率的相机images.it有没有找到高分辨率images.i D'角落里发现任何不正确的方法知道我做了我mistake.Here与我已经把它贴我的code和图像also.please帮助me.i'm很新的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);



}

在code将正常棋盘images.but工作,同时利用该决议它会不会提前works.please帮助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天全站免登陆