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;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)