Guest User

Untitled

a guest
Feb 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #include"file.h"
  2. #include"stdio.h"
  3. main()
  4. {
  5. FILE *fp;<br>
  6. char ch;<br>
  7. fp=fopen("D:\setups\tcc\Bluehills.bmp","rb+");
  8.  
  9. if(fp == NULL)
  10. {
  11. printf("Error in opening the image");
  12. fclose(fp);
  13. exit(0);
  14. }
  15.  
  16. printf("Successfully opened the image file");
  17.  
  18. while((ch = fgetc(fp))!=EOF)
  19. {
  20. printf("%c",ch);
  21. }
  22.  
  23. printf("nWriting to o/p completed");
  24. }
  25.  
  26. IplImage* img = 0;
  27. IplImage* out = 0;
  28.  
  29. if( argc < 2 ) {
  30. printf( "Usage: Accepts one image as argumentn" );
  31. exit( EXIT_SUCCESS );
  32. }
  33.  
  34. img = cvLoadImage( argv[1] );
  35.  
  36. if( !img ) {
  37. printf( "Error loading image file %sn", argv[1]);
  38. exit( EXIT_SUCCESS );
  39. }
  40.  
  41. out = cvCreateImage( cvGetSize(img), IPL_DEPTH_8U, 3 );
  42.  
  43.  
  44. cvSmooth( img, out, CV_GAUSSIAN, 3, 3 );
  45.  
  46. cvReleaseImage( &img );
  47. cvReleaseImage( &out );
  48. cvDestroyWindow( "Example1" );
  49. cvDestroyWindow( "Output" );
  50. return EXIT_SUCCESS;
Add Comment
Please, Sign In to add comment