我使用 OpenCV 2.4.1 制作了一个基本程序来打开 2 个窗口。该程序正在正确编译。当我尝试运行目标文件时,它不会打开窗口。下面给出源代码和编译命令。我哪里错了?
#include <cstdio>
#include "cv.h"
#include "highgui.h"
void changeColor(int pos)
{
cvSet(imgColor, CV_RGB(red, green, blue), NULL);
}
int main()
{
int red, blue, green;
cvNamedWindow("DrawArea", 0); //area for inputting digits
cvNamedWindow("ColorSelector", 0); //area for selecting colour of input
cvCreateTrackbar("Red", "ColorSelector", &red, 255, &changeColor);
cvCreateTrackbar("Green", "ColorSelector", &green, 255, &changeColor);
cvCreateTrackbar("Blue", "ColorSelector", &blue, 255, &changeColor);
cvSetMouseCallback(“Demo”,&on_mouse, 0 );
}
用于编译的命令是:
gcc `pkg-config opencv --cflags` paint.cpp -o paint `pkg-config opencv --libs`
在运行目标文件时,将显示以下输出:
./paint
init done
opengl support available