Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The original image
- Image<Bgr, float> image = new Image<Bgr, float>(@"C:image.jpg");
- // Get the image width and height
- int imageWidth = image.Width;
- int imageHeight = image.Height;
- // The ArcCos operated image
- Image<Bgr, float> imageAcos = new Image<Bgr, float>(imageWidth, imageHeight);
- // Start operating the image
- for (int y = 0; y < imageHeight; y++)
- {
- for(int x = 0; x < imageWidth; x++)
- {
- // The Blue frame
- imageAcos.Data[x, y, 0] = (float) Math.Acos((double) image.Data[x, y, 0]);
- // The Green frame
- imageAcos.Data[x, y, 1] = (float) Math.Acos((double) image.Data[x, y, 1]);
- // The Red frame
- imageAcos.Data[x, y, 2] = (float) Math.Acos((double) image.Data[x, y, 2]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement