这个例子演示了如何使用QPainter的转换和缩放特性来简化绘图. 值得学习的: 定时器事件ID检查: 在定时器事件中检查定时器id是比较好的实践. QPainter抗锯齿: We call QPainter::setRenderHint() with QPainter::Antialiasing to turn on antialiasing. This makes drawing of diagonal lines much smoother. 画笔的平移/缩放: p->translate(…
目标:对原图I进行[80,50]的偏移操作得到图B. 首先读入图像,以matlab自带的pout.tif为例. strel是创建形态学结构元素的. translate函数在原结构上进行[80,50]的偏移. I = imread('cameraman.tif'); se = translate(strel(1),[80,50]); B = imdilate(I,se);…