这是一个利用OpenCV读取一张图片然后用Qt生成窗口display出来。做的主要是IplImage到QImage的转换。大部分参考了这个人的博客(http://leohart.net/site/comments/convert_opencv_iplimage_to_qt_qimage/)
基本用法就是:
1)声明这个类,传入图片路径到构造函数中;
2)用getQImage函数获得QImage,然后就可以用到Qt的东西中。...An introduction to the LDA method
Introduction to the method of PCA
- Introduction to the method SVD
- How to make a colorful picture black and white?
- The code of Bresenham Line Drawing (1)
- Bresenham Line Drawing is rather tricky compared to DDA one. The basic idea is, when we move along x-axis, 1 pixel each time, it seems that we do not have much choice about our y coordinate. Because we want to draw a continuous line, so that a yi+1 can be either yi or y i +1, and what we need to do is to make a choice: yi or y i +1. The choice is still based on m, the slope: we will see whether the calculated y = mx+b is close to y i or y i +1. But this time we will not calculate directly: it costs too much. Instead, we will apply the technique of induction.
- DDA is an algorithm for drawing lines. The idea is, due to the limitation of discrete pixels (which make it impossible to draw real continuous lines), we have to put a number of neighboring pixels to “make up” a line. The DDA does it in this way: say we “scan” the canvas along the x-axis, moving one pixel a time, and by the line equation we can calculate the corresponding y coordinate for each x-pixel and then we have the y coordinate rounded and put the pixel accordingly. One thing that needs concern is that if the slope of the line is greater than 1 or smaller than -1 we will have a series of discrete pixels (the dots cannot be connected if for each x-coordinate we only have one pixel). To solve this problem we can check the slope and move along x-axis or y-axis accordingly.
共1页 1







