两张bmp图像做比较相似度:请教有方法改变bmp图像的角度吗?

解决方案 »

  1.   

    你想要角度变换还是比较图像
    角度变换参考http://blog.csdn.net/kenkao/archive/2008/10/26/3148122.aspx
      

  2.   

    LZ的意思是不是两幅图像中前景目标的位置角度不同?图像配准中好像有解决的方法,可以考虑sift点匹配的方法,个人理解,仅作参考
      

  3.   

    这个可以有:
    public static Bitmap Whirl(Bitmap bmp, PointD org, double angle)
            {
                Bitmap src = new Bitmap(bmp.Width, bmp.Height);
                Graphics g = Graphics.FromImage(src);
                PointD o1 = new PointD();
                o1 = o1.Whirl(org, angle);            GraphicsState gs = g.Save();
                g.TranslateTransform((float)o1.X, (float)o1.Y);
                g.RotateTransform((float)angle);
                g.DrawImage(bmp, 0, 0,bmp.Width,bmp.Height);
                g.Restore(gs);
                GraphHelper.DrawSelPoint(org.Point, g, 7);
                g.Dispose();
                return src;
            }
      

  4.   

    public class PointD
        {
            public PointD() 
            {
                x = 0;
                y = 0;
            }        public PointD(double x, double y)
            {
                this.x = x;
                this.y = y;
            }        double x;        double y;        public double Y
            {
                get { return y; }
                set { y = value; }
            }        public double X
            {
                get { return x; }
                set { x = value; }
            }         public PointD Whirl(PointD origin, double angle)
            {
                double len, agl;
                PointD v = (this - origin);
                len = v.VectorLength;
                if (len == 0)
                    return new PointD(origin.x, origin.y);            agl = v.Angle;
                agl += angle;
                agl %= 360;
                if (agl < 0)
                    agl += 360;
                agl = GraphHelper.ToPI(agl);            return origin + new PointD(len * Math.Cos(agl), len * Math.Sin(agl));
            }
    }