Permalink
Browse files

Better homography example

  • Loading branch information...
1 parent b82005f commit 95f5b096c228e825654da428c43b3c7fe8f5e622 @aleator committed Jul 25, 2012
Showing with 11 additions and 13 deletions.
  1. +11 −13 examples/homography.hs
View
@@ -4,17 +4,15 @@ import qualified CV.Matrix as M
import CV.Transforms
main = do
- let source = M.fromList (5,2) [1,1
- ,1,2
- ,2,1
- ,5,5
- ,2,4]
- target = M.fromList (5,2) [1,1
- ,1,2
- ,2,1
- ,5,5
- ,1900,4]
+ let mat = M.fromList (5,2) . concatMap (\(x,y) -> [x,y])
+ source = [(1,1)
+ ,(1,2)
+ ,(2,1)
+ ,(5,5)
+ ,(2,4)]
+ tr = map (\(x,y) -> (x+100,y+100)) source
+ sc = map (\(x,y) -> (x*100,y*100)) source
- print (getHomography' source target Default 0.1)
- print (getHomography' source target Ransac 0.001)
- print (getHomography' source target LMeds 0.001)
+ print (getHomography' (mat source) (mat $ tr ) Ransac 0.1)
+ print (getHomography' (mat source) (mat $ sc ) Ransac 0.1)
+ print (getHomography' (mat source) (mat source) LMeds 0.1)

0 comments on commit 95f5b09

Please sign in to comment.