Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. // The original image
  2. Image<Bgr, float> image = new Image<Bgr, float>(@"C:image.jpg");
  3.  
  4. // Get the image width and height
  5. int imageWidth = image.Width;
  6.  
  7. int imageHeight = image.Height;
  8.  
  9. // The ArcCos operated image
  10. Image<Bgr, float> imageAcos = new Image<Bgr, float>(imageWidth, imageHeight);
  11.  
  12. // Start operating the image
  13. for (int y = 0; y < imageHeight; y++)
  14. {
  15. for(int x = 0; x < imageWidth; x++)
  16. {
  17. // The Blue frame
  18. imageAcos.Data[x, y, 0] = (float) Math.Acos((double) image.Data[x, y, 0]);
  19.  
  20. // The Green frame
  21. imageAcos.Data[x, y, 1] = (float) Math.Acos((double) image.Data[x, y, 1]);
  22.  
  23. // The Red frame
  24. imageAcos.Data[x, y, 2] = (float) Math.Acos((double) image.Data[x, y, 2]);
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement