Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 !
Posted

1 solution

If by windows forms you mean .net, have a look at this:
Creating First Emgu CV Project[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900