1.6 Image Rotation
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相关推荐
- add python3.7 to path是什么意思_一起读源码:为什么 loguru 的时间 rotation 不能只精确到天...
摄影:产品经理猪耳朵与鹌鹑蛋做的皮蛋 今天的问题来自未闻 Code 粉丝交流群: " loguru 每天自动生成的日志名字,可以只精确到日吗? " 如下图所示: 这里的每天自动生成 ...
- 对抗网络用于人脸转正--Beyond Face Rotation
Beyond Face Rotation: Global and Local Perception GAN for Photorealistic and Identity Preserving Fro ...
- HUD 1043 Eight 八数码问题 A*算法 1667 The Rotation Game IDA*算法
先是这周是搜索的题,网站:http://acm.hdu.edu.cn/webcontest/contest_show.php?cid=6041 主要内容是BFS,A*,IDA*,还有一道K短路的,.. ...
- 灰度不变性LBP( gray scale invariant) 旋转不变性LBP(rotation invariant)旋转不变等价LBP(rotation uniform invarian )
老外的原文:<Multiresolution gray-scale and rotation invariant texture classification with local binary ...
- Openlayers中使用Image的rotation实现车辆定位导航带转角(判断车辆图片旋转角度)
场景 Openlayers中使用animate实现车辆定位导航效果(以当前车辆为中心移动): https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/det ...
- unity3d 的Quaternion.identity和transform.rotation区别是什么
Quaternion.identity就是指Quaternion(0,0,0,0),就是每旋转前的初始角度,是一个确切的值,而transform.rotation是指本物体的角度,值是不确定的,比如可 ...
- C++实现array right rotation数组右旋转(附完整源码)
C++实现array right rotation数组右旋转算法 C++实现array right rotation数组右旋转算法完整源码(定义,实现,main函数测试) C++实现array rig ...
- C++实现array left rotation数组左旋转(附完整源码)
C++实现array left rotation数组左旋转算法 C++实现array left rotation数组左旋转算法完整源码(实现,main函数测试) C++实现array left rot ...
- 如何修正导入模型的旋转? 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 ...
- 文献记录(part28)--A rotation and scale invariant approach for multi-oriented floor plan image ...
学习笔记,仅供参考,有错必纠 关键词:平面图;检索;旋转;比例;不变 看了一半不是很合口味- A rotation and scale invariant approach for multi-ori ...
最新文章
- 模拟器抓取https方法
- 神经网络与机器学习 笔记—改善反向传播的性能试探法
- 屏幕录制工具(可录制GIF)
- 数据结构源码笔记(C语言):链接队列
- php的cgi的设置,apache中配置php支持模块模式、cgi模式和fastcgi模式
- 怎么查看python是否安装好了pyinstaller_Python PyInstaller安装和使用教程(详解版)...
- 【剑指offer】面试题53 - 1:在排序数组中查找数字 I(java)
- 飞鸽传书2011绿色版简单性
- 编程必备:c/c++的编程经验技巧!
- linux usb免驱麦克风,Android无驱usb音频实现
- NSUserDefaults使用
- python进阶教程之异常处理
- 1 shell备份数据库MYSQL案例
- CSS实现三栏布局(5种)
- Android P2P语音通话实现 【转】http://macleo.iteye.com/blog/1707455
- Learning-MySQL【4】:表的操作管理和 MySQL 的约束控制
- Ignite 安装启动(本地单机)
- 三星8核S5P6818 核心板(ARM Cortex-A53架构)
- App中WebView网页加载优化实战干货
- html中qq号码怎么写,qq号码免费申请6位号的方法