Given an image represented by an NxN matrix, where each pixel in the image is
4 bytes, write a method to rotate the image by 90 degrees. Can you do this in
place?

将matrix切成4份即可

 1     public static void imageRotation(int[][] matrix, int n) {
 2         for (int i = 0; i < n / 2; i++) {
 3             for (int j = i; j < n - 1 - i; j++) {
 4                 int tmp = matrix[i][j];
 5                 matrix[i][j] = matrix[n - 1 - j][i];
 6                 matrix[n - 1 - j][i] = matrix[n - 1 - i][n - 1 - j];
 7                 matrix[n - 1 - i][n - 1 - j] = matrix[j][n - 1 - i];
 8                 matrix[j][n - 1 - i] = tmp;
 9             }
10         }
11     }

转载于:https://www.cnblogs.com/superbo/p/4112640.html

1.6 Image Rotation相关推荐

  1. add python3.7 to path是什么意思_一起读源码:为什么 loguru 的时间 rotation 不能只精确到天...

    摄影:产品经理猪耳朵与鹌鹑蛋做的皮蛋 今天的问题来自未闻 Code 粉丝交流群: " loguru 每天自动生成的日志名字,可以只精确到日吗? " 如下图所示: 这里的每天自动生成 ...

  2. 对抗网络用于人脸转正--Beyond Face Rotation

    Beyond Face Rotation: Global and Local Perception GAN for Photorealistic and Identity Preserving Fro ...

  3. HUD 1043 Eight 八数码问题 A*算法 1667 The Rotation Game IDA*算法

    先是这周是搜索的题,网站:http://acm.hdu.edu.cn/webcontest/contest_show.php?cid=6041 主要内容是BFS,A*,IDA*,还有一道K短路的,.. ...

  4. 灰度不变性LBP( gray scale invariant) 旋转不变性LBP(rotation invariant)旋转不变等价LBP(rotation uniform invarian )

    老外的原文:<Multiresolution gray-scale and rotation invariant texture classification with local binary ...

  5. Openlayers中使用Image的rotation实现车辆定位导航带转角(判断车辆图片旋转角度)

    场景 Openlayers中使用animate实现车辆定位导航效果(以当前车辆为中心移动): https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/det ...

  6. unity3d 的Quaternion.identity和transform.rotation区别是什么

    Quaternion.identity就是指Quaternion(0,0,0,0),就是每旋转前的初始角度,是一个确切的值,而transform.rotation是指本物体的角度,值是不确定的,比如可 ...

  7. C++实现array right rotation数组右旋转(附完整源码)

    C++实现array right rotation数组右旋转算法 C++实现array right rotation数组右旋转算法完整源码(定义,实现,main函数测试) C++实现array rig ...

  8. C++实现array left rotation数组左旋转(附完整源码)

    C++实现array left rotation数组左旋转算法 C++实现array left rotation数组左旋转算法完整源码(实现,main函数测试) C++实现array left rot ...

  9. 如何修正导入模型的旋转? How do I fix the rotation of an imported model?

    原地址:http://game.ceeger.com/Manual/HOWTO-FixZAxisIsUp.html Some 3D art packages export their models s ...

  10. 文献记录(part28)--A rotation and scale invariant approach for multi-oriented floor plan image ...

    学习笔记,仅供参考,有错必纠 关键词:平面图;检索;旋转;比例;不变 看了一半不是很合口味- A rotation and scale invariant approach for multi-ori ...

最新文章

  1. 模拟器抓取https方法
  2. 神经网络与机器学习 笔记—改善反向传播的性能试探法
  3. 屏幕录制工具(可录制GIF)
  4. 数据结构源码笔记(C语言):链接队列
  5. php的cgi的设置,apache中配置php支持模块模式、cgi模式和fastcgi模式
  6. 怎么查看python是否安装好了pyinstaller_Python PyInstaller安装和使用教程(详解版)...
  7. 【剑指offer】面试题53 - 1:在排序数组中查找数字 I(java)
  8. 飞鸽传书2011绿色版简单性
  9. 编程必备:c/c++的编程经验技巧!
  10. linux usb免驱麦克风,Android无驱usb音频实现
  11. NSUserDefaults使用
  12. python进阶教程之异常处理
  13. 1 shell备份数据库MYSQL案例
  14. CSS实现三栏布局(5种)
  15. Android P2P语音通话实现 【转】http://macleo.iteye.com/blog/1707455
  16. Learning-MySQL【4】:表的操作管理和 MySQL 的约束控制
  17. Ignite 安装启动(本地单机)
  18. 三星8核S5P6818 核心板(ARM Cortex-A53架构)
  19. App中WebView网页加载优化实战干货
  20. html中qq号码怎么写,qq号码免费申请6位号的方法

热门文章

  1. 需求工程规格说明、需求验证、需求管理
  2. 转:教人找电影的攻略
  3. 指定decode_responses=True,连接redis存的数据是字符串格式
  4. 机器人——人类的终极进化
  5. 实体与实体之间的联系
  6. win10备份(win10备份的系统怎么还原)
  7. 有没有发现不会写简历,感觉什么都不会?其实写简历也是一种艺术。
  8. IceWarp邮件监控功能
  9. 嵌入式Linux之正点原子Linux开发板入手
  10. AI 成野生动物保护神:没有图像识别算法,考拉可能灭绝!