本文介绍了创建表单应用程序时出现cvCreateTrackbar()问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我编写的主要程序,通过使用剪切算法手动(在运行时)旋转字符倾斜。这是一个控制台应用程序,我不知道如何使用Windows窗体应用程序执行相同的任务。问题出现了,因为控制台应用程序使用cvCreateTrackbar()函数创建了跟踪栏,现在我需要以另一种形式执行此操作。请有人帮帮我吗?
This is my main program that I wrote to rotate character slant manually(at run time) by using shearing algorithm. This is a console application and I don't know how can I do the same task using windows forms application. The problem occurred since the console app create track bar using cvCreateTrackbar() function and now I need to do it in another form. Please can anyone help me?
IplImage* img;
IplImage* rotated_img;
int trackCount = 0;
cvNamedWindow("MyWindow");
cvCreateTrackbar("Angle", "MyWindow", &trackCount, 500, 0);
while(true){
//load the original image
img = cvLoadImage("Original.jpg");
//rotate the image
rotated_img=SlantCorrection(img,trackCount);
//display the rotated image
cvShowImage("MyWindow", rotated_img);
//clean up
cvReleaseImage(&img);
cvReleaseImage(&rotated_img);
//if user press 'ESC' button, program quit the while loop
int c=cvWaitKey(50);
if(c==27) break;
}
int height=rotated_img->height;
int *linecount = new int[height];
int width=rotated_img->width;
int *wordcount = new int[width];
int count=0;
int countPositions=0;
int *pos = new int[height];
Horizontal_projection(rotated_img,width,height,countPositions,pos);
count = Vertical_Projection(width,height);
cvDestroyWindow("MyWindow");
return 0;
谢谢!
Thank You !
推荐答案
这篇关于创建表单应用程序时出现cvCreateTrackbar()问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!