我想根据颜色在图像中找到坐标。坐标规定为白色的地方。
我要问的是如何在不使内存过载(有效内存)和实时运行的情况下进行检查。
请提供示例代码或可以使用的功能。
谢谢。 (使用getColor我认为对于实时系统来说太重了)
我想在全向图像中获得球门柱的坐标。 我使用径向搜索线方法(从中心扫描到轮廓,然后旋转到360度)
这是我的主要功能:
int main(int argc, char** argv)
{
const char* name = "Source";
img_src = imread("my_photo-2.jpg");
cvtColor(img_src, img_hsv, CV_BGR2HSV);
int i = 0, j = 0;
while(i<360) //degree
{
j = 0;
while(j<380) //range from center to outline[enter image description here][1]
{
int x = 640 + (j * cos(i*PI / 180));
int y = 360 + (j * sin(i*PI / 180));
colorHSV[i][j] = img_hsv.at<int>(y, x);
j++;
}
i++;
}
cvNamedWindow(name0);
imshow(name0, img_src);
while (1) {
if (cvWaitKey(15) == 27)
break;
}
cvDestroyAllWindows;
return 0;
}
这是我的图片:
链接:https://drive.google.com/drive/folders/10wsnK56dccp0czSL5jMQnxflxSUQeQBP?usp=sharing