本文整理汇总了C++中cvMoveWindow函数的典型用法代码示例。如果您正苦于以下问题:C++ cvMoveWindow函数的具体用法?C++ cvMoveWindow怎么用?C++ cvMoveWindow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cvMoveWindow函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Update_Gui_Windows
void Update_Gui_Windows()
{
static int first = 1;
cvShowImage(eye_window, eye_image);
cvShowImage(original_eye_window, original_eye_image);
cvReleaseImage(&original_eye_image);
cvShowImage(scene_window, scene_image);
cvShowImage(ellipse_window, ellipse_image);
cvResizeWindow(eye_window,RESOLUTION_WIDTH,RESOLUTION_HEIGHT);
cvResizeWindow(original_eye_window,RESOLUTION_WIDTH,RESOLUTION_HEIGHT);
cvResizeWindow(scene_window,RESOLUTION_WIDTH,RESOLUTION_HEIGHT);
cvResizeWindow(ellipse_window,RESOLUTION_WIDTH,RESOLUTION_HEIGHT);
// only OpenCV 0.9.6 has the function of cvMoveWindow(), now we are using version 0.9.5
if (first) {
cvMoveWindow(eye_window, RESOLUTION_WIDTH, 0);
cvMoveWindow(scene_window, 2*RESOLUTION_WIDTH, 0);
cvMoveWindow(ellipse_window, RESOLUTION_WIDTH, RESOLUTION_HEIGHT);
first = 0;
}
cvSetTrackbarPos("Edge Threshold", control_window, pupil_edge_thres);
}
开发者ID:downbeat,项目名称:senseye,代码行数:23,代码来源:cvEyeTracker.c
示例2: cvMoveWindow
/*!
Set the window position in the screen.
\param winx, winy : Position of the upper-left window's border in the screen.
\exception vpDisplayException::notInitializedError : If the video
device is not initialized.
*/
void vpDisplayOpenCV::setWindowPosition(int winx, int winy)
{
if (displayHasBeenInitialized) {
this->windowXPosition = winx;
this->windowYPosition = winy;
cvMoveWindow( this->title, winx, winy );
}
else
{
vpERROR_TRACE("OpenCV not initialized " ) ;
throw(vpDisplayException(vpDisplayException::notInitializedError,
"OpenCV not initialized")) ;
}
}
开发者ID:GVallicrosa,项目名称:Armed-turtlebot,代码行数:22,代码来源:vpDisplayOpenCV.cpp
示例3: main
int main(int argc, char *argv[])
{
IplImage* img = 0;
IplImage* img2 = 0;
int height,width,step,channels;
uchar *data;
int i,j,k;
if(argc<2){
printf("Usage: main <image-file-name>\n\7");
exit(0);}
// load an image
img=cvLoadImage(argv[1]);
if(!img){
printf("Could not load image file: %s\n",argv[1]);
exit(0);
}
// get the image data
height = img->height;
width = img->width;
step = img->widthStep;
channels = img->nChannels;
data = (uchar *)img->imageData;
printf("Processing a %dx%d image with %d channels and widthStep=%d\n",height,width,channels,step);
cvNamedWindow("mainWin", CV_WINDOW_AUTOSIZE); // create a window
cvMoveWindow("mainWin", 100, 100);//offset from the upper-left corner of the screen
// invert the image
for(i=0;i<height;i++) for(j=0;j<width;j++) for(k=0;k<channels;k++)
data[i*step+j*channels+k]=255-data[i*step+j*channels+k];
cvShowImage("mainWin1", img ); // show the image
cvWaitKey(0); // wait for a key
cvCircle(img, cvPoint(100,100), 20, cvScalar(0,255,0), 1);//draw a circle at (100,100) with a r=20. green lines of width 1
cvShowImage("mainWin2", img ); // show the image
cvWaitKey(0); // wait for a key
img2=cvCreateImage(cvSize(img->width,img->height),IPL_DEPTH_32F,3);//allocates memory for image 2
cvLaplace( img, img2, 3); //computes Laplacian of img and puts the result on img2.
cvShowImage("mainWin3", img2 );// show the image
cvWaitKey(0); // wait for a key
// release the images
cvReleaseImage(&img );
cvReleaseImage(&img2 );
return 0;
}
开发者ID:andreucm,项目名称:sketches,代码行数:50,代码来源:helloWorldOpenCv.cpp
示例4: main
int main(int argc, char **argv)
{
#define NEWIMG(s) cvLoadImage(s, CV_LOAD_IMAGE_COLOR)
// 19 - 22 are 'similar'
IplImage *mask = make_mask("bunny.png");
IplImage *a = NEWIMG("frames/bbb20.png");
IplImage *b = cvCreateImage(cvGetSize(a), a->depth, a->nChannels);
cvCopy(a, b, NULL);
#undef NEWIMG
IplImage *out = fill(a, b, mask);
cvShowImage("a", a);
cvShowImage("mask", mask);
cvShowImage("out", out);
cvMoveWindow("a", 0, 0);
cvMoveWindow("mask", 480, 0);
cvMoveWindow("out", 0, 400);
cvWaitKey(0);
cvReleaseImage(&a);
cvReleaseImage(&b);
cvReleaseImage(&mask);
return 0;
}
开发者ID:j0sh,项目名称:thesis,代码行数:23,代码来源:fill.c
示例5: mvWindow
mvWindow:: mvWindow (const char name[]) :
bin_showImage ("mvWindow - showImage"), _window_number(-1)
{ // this has to be the h file
assert (strlen(name) < WINDOW_NAME_LEN);
sprintf (_name, "%s", name);
cvNamedWindow (_name, CV_WINDOW_AUTOSIZE);
unsigned i = 0;
while (i < NUM_SUPPORTED_WINDOWS && WINDOWS_ARRAY[i] == true)
i++; // find next free slot
if (i >= NUM_SUPPORTED_WINDOWS) return; // return if no slot
WINDOWS_ARRAY[i] = true; // mark slot as used
_window_number = i;
switch (_window_number) {
case 0: cvMoveWindow (_name, 400,10); break;
case 1: cvMoveWindow (_name, 810,10); break;
case 2: cvMoveWindow (_name, 400,360); break;
case 3: cvMoveWindow (_name, 810,360); break;
}
}
开发者ID:JasonLiu0728,项目名称:MDA-Software,代码行数:23,代码来源:mgui.cpp
示例6: main
int main(int argc, char* argv[])
{
//Load an image to transform !!
IplImage* img = cvLoadImage( "images/lena.jpg" );
// Define two window for showing input image and processed output of an Image.
cvNamedWindow( "example_input" );
cvNamedWindow( "example_output" );
cvNamedWindow( "example_output2");
cvMoveWindow("example_input", 10, 100); // to move the window to position 100 100.
cvMoveWindow("example_output", 600, 100); // to move the window to position 100 100.
cvMoveWindow("example_output2", 1200, 100); // to move the window to position 100 100.
// Show the original image
cvShowImage("example_input", img);
// Create an image for the output
IplImage* out = cvCreateImage( cvGetSize(img), IPL_DEPTH_8U, 3 );
IplImage* out2 = cvCreateImage( cvGetSize(img), IPL_DEPTH_8U, 3 );
// Perform a Gaussian blur ( Convolving with 11 X 11 Gaussian).
cvSmooth( img, out, CV_GAUSSIAN, 11, 11 );
cvSmooth( img, out2, CV_GAUSSIAN, 21, 21 );
// Show the processed image
cvShowImage("example_output", out);
cvShowImage("example_output2", out2);
cvWaitKey(0);
cvReleaseImage( &img );
cvReleaseImage( &out );
cvReleaseImage( &out2 );
cvDestroyWindow( "example_input" );
cvDestroyWindow( "example_output" );
cvDestroyWindow( "example_output2" );
return 0;
}
开发者ID:GunnarHorve,项目名称:painter,代码行数:37,代码来源:gaussian.cpp
示例7: perspectiveTransform
void perspectiveTransform() {
processImage = windowImage;
setVariables(); //设置四个预设的点
setPoints(); //选取图片上的点
cvDestroyWindow("monitor");
windowImage = cvCreateImage(cvSize(squareWindowSize,squareWindowSize), IPL_DEPTH_8U, 3);
cvGetPerspectiveTransform(originalPoints, transPoints, transmat); //计算transmat的值
cvWarpPerspective(processImage , windowImage , transmat); //这一句利用transmat进行变换
cvNamedWindow("control");
cvMoveWindow("control", middlewindowX, middlewindowY);
cvShowImage("control", windowImage);
cvWaitKey();
cvDestroyWindow("control");
}
开发者ID:ApolloBian,项目名称:-IIB-prototype,代码行数:16,代码来源:perspectiveTransform.cpp
示例8: cvNamedWindow
void AdaptiveHistogramCamshift::ShowControlsGUI()
{
cvNamedWindow(m_controlsGUIWndName.c_str(), 1);
cvNamedWindow("Trackbars", 1);
if (!m_showControlsGUI)
{
cvMoveWindow(m_controlsGUIWndName.c_str(), m_frameSize.width + 10, 0);
cvCreateTrackbar(ControlNames[ControlName_VMin], "Trackbars", &m_vMin, 256, 0);
cvCreateTrackbar(ControlNames[ControlName_VMax], "Trackbars", &m_vMax, 256, 0);
cvCreateTrackbar(ControlNames[ControlName_SMin], "Trackbars", &m_sMin, 256, 0);
cvCreateTrackbar(ControlNames[ControlName_SBox], "Trackbars", &m_sBox, 64, 0);
cvCreateTrackbar(ControlNames[ControlName_AgingFactor], "Trackbars", &m_ageRatio, 100, 0);
cvSetMouseCallback(m_controlsGUIWndName.c_str(), &AdaptiveHistogramCamshift::OnMouse, &m_id);
}
m_showControlsGUI = true;
}
开发者ID:blr246,项目名称:adaptive-histogram-camshift,代码行数:16,代码来源:adaptive_histogram_camshift.cpp
示例9: opencvProcess
bool _stdcall opencvProcess(LPWSTR csInputPath, LPWSTR csOutputPath)
{
char inputPath[SIZE] = "";
WideCharToMultiByte(950, 0, csInputPath, -1, inputPath, SIZE, NULL, NULL);//wchar_t * to char
char outputPath[SIZE] = "";
WideCharToMultiByte(950, 0, csOutputPath, -1, outputPath, SIZE, NULL, NULL);//wchar_t * to char *
//load image
img = cvLoadImage(inputPath, -1);
if(!img)
return false;
else
{
CvSize size = cvGetSize(img);
int xScreen = GetSystemMetrics(SM_CXSCREEN);
int yScreen = GetSystemMetrics(SM_CYSCREEN);
while(size.width + 100 > xScreen || size.height + 100 > yScreen)
{
size.width /= 1.4;
size.height /= 1.4;
}//end while
size.height += 90;
cvNamedWindow(windowName, 0);
cvResizeWindow(windowName, size.width, size.height);
cvMoveWindow(windowName, (xScreen-size.width)/2, (yScreen-size.height)/2 );
int initValueW = W;
int initValueH = H;
cvCreateTrackbar("寬", windowName, &initValueW, img->width / 10, onTrackbarW);
cvCreateTrackbar("高", windowName, &initValueH, img->height / 10, onTrackbarH);
work();
cvShowImage(windowName, dst);
cvWaitKey();
cvSaveImage(outputPath, dst);
cvDestroyAllWindows();
cvReleaseImage(&img);
cvReleaseImage(&dst);
return true;
}//end else
return false;
}//end opencvProcess
开发者ID:QbsuranAlang,项目名称:InstaFilter,代码行数:46,代码来源:Mosaics+All.cpp
示例10: main
int main(int argc, char **argv)
{
int num_cal_images = 32;
int num_images = 100;
init_rng();
cvNamedWindow("shapegen", CV_WINDOW_AUTOSIZE);
cvMoveWindow("shapegen", 10, 10);
if (generate_cal_image(project_dir, num_cal_images)) {
draw_loop(project_dir, num_cal_images, num_images);
//draw_loop(NULL, num_cal_images, 20);
}
return 0;
}
开发者ID:scottellis,项目名称:shapegen,代码行数:17,代码来源:main.c
示例11: main
int main(int argc, char** argv) {
IplImage* image = cvLoadImage(argv[1], 0);
cvNamedWindow("Ex4_in", CV_WINDOW_AUTOSIZE);
cvNamedWindow("Ex4_out", CV_WINDOW_AUTOSIZE);
cvShowImage("Ex4_in", image);
IplImage* out = doPyrDown(image, IPL_GAUSSIAN_5x5);
IplImage* out1 = doPyrDown(out, IPL_GAUSSIAN_5x5);
IplImage* out2 = doCanny(out1, 10, 100, 3);
cvShowImage("Ex4_out", out2);
cvMoveWindow("Ex4_out", 0, 0);
cvReleaseImage(&out);
cvReleaseImage(&out2);
cvWaitKey(0);
cvDestroyWindow("Ex4_in");
cvDestroyWindow("Ex4_out");
return 0;
}
开发者ID:wangjunyan,项目名称:c_and_cplusplus,代码行数:17,代码来源:scale_test.c
示例12: main
int main(int argc, char *argv[])
{
IplImage* img = 0;
int height,width,step,channels;
uchar *data;
int i,j,k;
if(argc<2){
printf("Uso: NomeDoExecutavel <NomeDaImagen.formato>\n\7");
exit(0);
}
// load an image
img=cvLoadImage(argv[1]);
if(!img){
printf("Não foi possível carregar a imagem: %s\n",argv[1]);
exit(0);
}
// get the image data
height = img->height;
width = img->width;
step = img->widthStep;
channels = img->nChannels;
data = (uchar *)img->imageData;
printf("Processando uma imagem %dx%d com %d canais \n",height,width,channels);
// Criar uma janela
cvNamedWindow("Imagem de Saida", CV_WINDOW_AUTOSIZE);
cvMoveWindow("Imagem de Saida", 100, 100);
// Inverte a imagem
for(i=0;i<height;i++) for(j=0;j<width;j++) for(k=0;k<channels;k++)
data[i*step+j*channels+k]=255-data[i*step+j*channels+k]; //Num entendi muito bem direito
// Mostrar a Imagem
cvShowImage("Imagem de Saida", img );
// wait for a key
cvWaitKey(0);
// release the image
cvReleaseImage(&img );
return 0;
}
开发者ID:AttylaLino,项目名称:MoscaBranca,代码行数:45,代码来源:Codigo.cpp
示例13: main
int main(int argc, char *argv[])
{
IplImage* img = 0;
int height,width,step,channels;
uchar *data;
int i,j,k;
if(argc<2){
printf("Usage: main <image-file-name>\n\7");
exit(0);
}
// load an image
img=cvLoadImage(argv[1]);
if(!img){
printf("Could not load image file: %s\n",argv[1]);
exit(0);
}
// get the image data
height = img->height;
width = img->width;
step = img->widthStep;
channels = img->nChannels;
data = (uchar *)img->imageData;
printf("Processing a %dx%d image with %d channels\n",height,width,channels);
// create a window
cvNamedWindow("mainWin", CV_WINDOW_AUTOSIZE);
cvMoveWindow("mainWin", 100, 100);
// invert the image
for(i=0;i<height;i++) for(j=0;j<width;j++) for(k=0;k<channels;k++)
data[i*step+j*channels+k]=255-data[i*step+j*channels+k];
// show the image
cvShowImage("mainWin", img );
// wait for a key
cvWaitKey(0);
// release the image
cvReleaseImage(&img );
return 0;
}
开发者ID:fern17,项目名称:Kinect-Test,代码行数:45,代码来源:main.cpp
示例14: cvCreateImage
/*! \fn void ViewGM(char *nm, int w=320, int h=240)
* \brief this function display the 2D gaussian mixture on an image
*/
void GaussianMixture::ViewGM(char *nm, int w, int h)
{
if(this->dim != 2) cout << "|ERROR|--> GaussianMixture (ViewGM) \t:\t dim not match to display on 2D image" << endl;
IplImage *dsp = cvCreateImage(cvSize(w,h),IPL_DEPTH_8U,3);
double v[2];
for(int i=0;i<h;i++)
for(int j=0;j<w;j++)
{
v[0] = j;
v[1] = i;
double prob = this->Eval(v);
cvSet2D(dsp,i,j,SCalcTeint((int)(prob/glist[0]->coeff*255)));
}
cvNamedWindow(nm,0);
cvMoveWindow(nm,0,0);
cvShowImage(nm,dsp);
cvWaitKey(5);
}
开发者ID:elie-moussy,项目名称:LibPF,代码行数:21,代码来源:GaussianMixture.cpp
示例15: namedWindow
// Initialize window and variables
void Painting::drawInit(Painting* p)
{
paint = p; // Save pointer to class object
// Create a window
namedWindow(WindowName);
cvSetMouseCallback(WindowName, mouse, NULL);
cvMoveWindow(WindowName, 50, 50);
IplImage* image = cvCreateImage(cvSize(500,500),IPL_DEPTH_8U,3);
cvZero( image );
cvRectangleR(image,cvRect(0,0,500,500),cvScalar(255,255,255), -1);
cvResizeWindow(WindowName, 500, 500);
mImage = image;
mSelect = 0;
mLeftButton = cvRect(10, 10, 100, 100);
mRightButton = cvRect(490, 10, 100, 100);
}
开发者ID:fatma-meawad,项目名称:food-recognition-project,代码行数:20,代码来源:painting.cpp
示例16: compute_and_display_image_corners
void compute_and_display_image_corners(char * imageName, CvSize * imageSize, CvSize chessboardSize, CvPoint2D32f * cornersArrayToFillIn)
{
IplImage * img = 0;
int cornersCount = 0;
int patternWasFound = 0;
int i;
img = cvLoadImage(imageName, 1);
*imageSize = cvGetSize(img); // useful only for calibration function
//initialisation of the given array
for(i=0;i<chessboardSize.height*chessboardSize.width;i++){ cornersArrayToFillIn[i].x= 0; cornersArrayToFillIn[i].y= 0; }
printf("OK1\n");
// core algorithm
patternWasFound = cvFindChessboardCorners(img, chessboardSize, cornersArrayToFillIn, &cornersCount, 0);
printf("OK2\n");
// display_array_values(cornersArrayToFillIn,chessboardSize.height*chessboardSize.width);
improve_precision(img, cornersArrayToFillIn, cornersCount);
// display_array_values(cornersArrayToFillIn,chessboardSize.height*chessboardSize.width);
// visual only part
cvDrawChessboardCorners(img, chessboardSize, cornersArrayToFillIn, cornersCount, patternWasFound);
cvNamedWindow(imageName, CV_WINDOW_AUTOSIZE);
cvMoveWindow(imageName, 100, 100);
cvShowImage(imageName, img );
cvWaitKey(200);
cvDestroyWindow(imageName);
// end
cvReleaseImage(&img );
}
开发者ID:moumen19,项目名称:robotiquecartemere,代码行数:39,代码来源:cameraCalibration.c
示例17: main
int main() {
IplImage* lena = cvLoadImage("lena.tif", 0);
Image img_sift = CreateImage(lena->height, lena->width);
for(int r = 0; r < lena->height; ++r)
{
for(int c = 0; c < lena->width; ++c)
{
CvScalar s = cvGet2D(lena,c,r);
img_sift->pixels[r*img_sift->stride+c] =
(s.val[0] + s.val[1] + s.val[2]) / (3.*255);
}
}
Keypoint keypts = GetKeypoints(img_sift);
Keypoint key = keypts;
while(key)
{
cvRectangle(lena,
cvPoint(key->row-1 ,key->col-1),
cvPoint(key->row+1 ,key->col+1),
cvScalar(255,0,0), 1);
key = key->next;
}
FreeKeypoints(keypts);
DestroyAllResources();
cvNamedWindow("lena", 1);
cvMoveWindow("lena", 800, 200);
cvShowImage("lena", lena);
cvWaitKey(0);
cvDestroyAllWindows();
cvReleaseImage(&lena);
}
开发者ID:dedan,项目名称:obj_att,代码行数:39,代码来源:sift_test.cpp
示例18: cvNamedWindow
int Display::showPreview(IplImage *pImage1, IplImage *pImage2)
{
if (Config::_FeatureDisplay) {
// create window if necessary
if (! _displayingPreview) {
cvNamedWindow("Preview", CV_WINDOW_NORMAL);
cvResizeWindow("Preview", NBPIXELS_WIDTH, NBPIXELS_HEIGHT*2);
cvMoveWindow("Preview", FEAT_POSX, FEAT_POSY); // offset from the UL corner of the screen
_displayingPreview = true;
}
// display image
if (pImage1 != NULL) {
memcpy(_pImgFeatures->imageData, pImage1->imageData, pImage1->imageSize);
if (pImage2 != NULL) {
// assume both have same size !
memcpy(_pImgFeatures->imageData+(pImage1->imageSize), pImage2->imageData, pImage2->imageSize);
}
}
cvShowImage("Preview", _pImgFeatures);
return cvWaitKey(CV_WAITKEY_TIMEOUT);
}
return -1;
}
开发者ID:animecomico,项目名称:kth-rgbd,代码行数:23,代码来源:Display.cpp
示例19: strcpy
/*
* Description: Constructor.
* It creates a new window to display the new frame.
* Parameters: int windowNumber - the window number in the camera's streaming list
* Return Value: None.
*/
VideoFeed::VideoFeed(int windowNumber, IplImage* Current_Frame,
const char* windowName) {
cout << "Video Feed Constructor" << "\n";
//char chWindownumber[2] = {windowNumber + '0', '\0'}; // convert int to char
//strcpy(m_windowName, "Debug "); // window name setup
//strcat(m_windowName, chWindownumber); // Concatenate window number to its name
strcpy(m_windowName, windowName); // window name setup
cvNamedWindow(m_windowName, CV_WINDOW_AUTOSIZE); // create the new window
m_printPixel = false;
cvSetMouseCallback(m_windowName, Mouse_Pos_Print_Pixel,
(void*) Current_Frame);
m_Frame = Current_Frame;
int windowX = 10 + 324 * (windowNumber % 3);
int windowY = 20 + 280 * (windowNumber / 3);
cvMoveWindow(m_windowName, windowX, windowY);
}
开发者ID:BIURoboCup,项目名称:RoboCup2016,代码行数:29,代码来源:VideoFeed.cpp
示例20: readVideo
int readVideo(char *fileName)
{
printf("%s\n", fileName);
CvCapture *video_capture = cvCreateFileCapture(fileName);
IplImage *img;
cvNamedWindow("win_1", CV_WINDOW_AUTOSIZE);
cvMoveWindow("win_1", 100, 100);
int flag = 1;
while (flag != 27) {
img = cvQueryFrame(video_capture);
if (img) {
cvShowImage("win_1", img);
flag = cvWaitKey(30);
}
}
cvReleaseCapture(&video_capture);
cvDestroyWindow("win_1");
return 0;
}
开发者ID:atupal,项目名称:opencv_learn,代码行数:23,代码来源:video.cpp
注:本文中的cvMoveWindow函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论