乐平网站,什么是网络营销的核心竞争力,怎么注册公司域名邮箱,中国建设银行的网站.1.基本原理 图像的转置就是将图像的横坐标和纵坐标交换位置#xff0c;和矩阵的转置是一样的#xff0c;公式见下#xff1a; 2.代码实现#xff08;代码是我以前自学图像处理时写的#xff0c;代码很粗糙没做任何优化#xff0c;但很好理解#xff09;
/*图像的转置函…1.基本原理 图像的转置就是将图像的横坐标和纵坐标交换位置和矩阵的转置是一样的公式见下 2.代码实现代码是我以前自学图像处理时写的代码很粗糙没做任何优化但很好理解
/*图像的转置函数*/
QImage* MainWindow::Transpose(QImage* image)
{QImage* newImage new QImage(image-width(), image-height(),QImage::Format_ARGB32);unsigned char* copyPixel NULL;unsigned char* objPixel NULL;unsigned int tempJ 0;for( int j 0; j image-height(); j){tempJ j * image-width() * 4;for( int i 0; i image-width(); i){copyPixel image-bits() tempJ i * 4;objPixel newImage-bits() i * image-height() * 4 j * 4;memcpy(objPixel, copyPixel, 4);}}return newImage;
}
3.参考资料 数字图像处理——技术详解与Visual C实践左飞等著写代码与写博客的时间相差两年至于还参考其他的资料不我已经忘记了如若需要我可以补上去