Ask Your Question

how to align vector and raster images?

asked 2012-08-23 09:09:31 -0500

mrgloom gravatar image

updated 2012-11-29 05:37:51 -0500


I know about chamfer matching but it isn't working good.

I think I need something like this or some non rigid object registration algorithm.

I also tried to represent raster and vector data as points and then apply ICP algorithm to them but this lib seems can provide only shift and rotate invariance. I will try this lib but it seems it very complicated, maybe there is simpler approach.

some example picture shapes that I need to align.(I have already convert raster and vector to points) some real life example using gmmreg lib (I'm still not sure I'm using it right)



seems I'm not using lib right,even if points are aligned it works wrong.


For example if we use homography matrix and assume perspective transform we have 8 parameters. I tried to use KCReg it use some specific metric for point clouds, but it give me unsatisfactory results because my distortion can be only roughly expressed by perspective transform and I need some more non-rigid alignment. So the task consist of some function E(p)(metric)+minimizer+bounds for minimizer. I also tried gmmerg. I seems it uses some Broyden Fletcher Goldfarb Shannon minimization from VNL, but I managed to achive good results only for simple tasks.

for example affine

barrel-barrel backwards-barrel rigid rigid scale rotate shift

but it fails on real problem, maybe I don't set constraints/bounds or initial guess well. rigid shift ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2012-08-26 05:34:27 -0500

Michael Burdinov gravatar image

updated 2012-08-30 06:26:41 -0500

  1. That fact that you are performing registration between vector and raster image does not mean that should be ellastic. Your application is what determines type of transformation (for example shift, rigid, similarity, affine, perspective, ellastic, and so on), not the way it is stored.

  2. You are trying to morph image. But morphing polygins is by many orders of magnitude easier than morphing raster image. So you better keep the raster image constant, and morph vector image.

  3. There literaly thousands of different approaches to find registration between image and polygons. Can you please be more specific about what you are trying to achive? It will be good to see examples of your input, output and prior information.


Ok, images indeed make problem clearer :).

  1. First i would try to simplify the problem. You can measure barrel distortion coefficients a-priory on some qrid that you will prepare. Then you will be able rectify your images, so that they will have only perspective distortion.

  2. I see that you can extract points that belong to object and not to its surrounding, you can use moments to align those sets of points. (Was that your approach for initial guess?).

  3. I would recommend you ICP, but you already know it. If the one you got does not fit your application, search for anther one. There many ways to implement it. In worst case you can implement one yourself.

edit flag offensive delete link more


I can change only scale of vector image, but the raster image is distorted(perspective transform+barrel distortion) and it must be aligned to vector image.Also raster(represented with contours) and vector image can differ in 30% of the presence and absence of elements.I also tried ICP algorithm(check my update) but it seems I need not rigid ICP algorithm.I'll post images soon.Maybe you can tell me some words how this problem called in literature so I can google it?

mrgloom gravatar imagemrgloom ( 2012-08-27 04:38:26 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2012-08-23 09:09:31 -0500

Seen: 1,387 times

Last updated: Nov 29 '12