您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 质量控制/管理 > 视觉里程计原理(二)特征匹配与追踪(LK光流法)
MachinePerceptionandInteractionGroup(MPIG)@mpig.com.cnFeaturematching陈伟杰MPIGSeminar0046MachinePerceptionandInteractionGroup(MPIG)[R|t]DrawingpathThemainstepsofVisualOdometryimagesparametersMachinePerceptionandInteractionGroup(MPIG)(MPIG)(FastLibraryforApproximateNearestNeighbors)MachinePerceptionandInteractionGroup(MPIG)::vectorDMatchmatches;matcher.match(descriptors1,descriptors2,matches);Matimg_matches;drawMatches(img1,keypoints1,img2,keypoints2,matches,img_matches);//--Drawmatchesimshow(Matches,img_matches);//--ShowdetectedmatchescodeMachinePerceptionandInteractionGroup(MPIG)(MPIG)=0;doublemin_dist=100;for(inti=0;idescriptors1.rows;i++){doubledist=matches[i].distance;if(distmin_dist)min_dist=dist;if(distmax_dist)max_dist=dist;}//--Drawonlygoodmatches(i.e.whosedistanceislessthan2*min_dist)std::vectorDMatchgood_matches;for(inti=0;idescriptors1.rows;i++){if(matches[i].distance2*min_dist){good_matches.push_back(matches[i]);}}//--DrawonlygoodmatchesMatimg_matches;drawMatches(img1,keypoints1,img2,keypoints2,good_matches,img_matches,Scalar::all(-1),Scalar::all(-1),vectorchar(),DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS);//--Showdetectedmatchesimshow(GoodMatches,img_matches);MachinePerceptionandInteractionGroup(MPIG)(MPIG)’sopticalflow?MachinePerceptionandInteractionGroup(MPIG)•Brightnessconstancy•Temporalpersistenceorsmallmovements•SpatialcoherencethreeassumptionsLucas-Kanade(LKorKLT)[1][1]B.D.Lucas,T.Kanade,AnIterativeImageRegistrationTechniquewithanApplicationtoStereoVision.MachinePerceptionandInteractionGroup(MPIG)𝐼𝑥,𝑦,𝑡=𝐼𝑥+𝑑𝑥,𝑦+𝑑𝑦,𝑡+𝑑𝑡𝐼𝑥,𝑦,𝑡=𝐼𝑓(𝑥,𝑦),𝑡+𝑑𝑡MachinePerceptionandInteractionGroup(MPIG)𝐼𝑥+𝑑𝑥,𝑦+𝑑𝑦,𝑡+𝑑𝑡=𝐼𝑥,𝑦,𝑡+𝜕𝐼𝜕𝑥𝑑𝑥+𝜕𝐼𝜕𝑦𝑑𝑦+𝜕𝐼𝜕𝑡𝑑𝑡+𝘀𝐼𝑥,𝑦,𝑡=𝐼𝑥+𝑑𝑥,𝑦+𝑑𝑦,𝑡+𝑑𝑡𝐼𝑥=𝜕𝐼𝜕𝑥,𝐼𝑦=𝜕𝐼𝜕𝑦,𝐼𝑡=𝜕𝐼𝜕𝑡𝑢=𝑑𝑥𝑑𝑡,𝑣=𝑑𝑦𝑑𝑡𝑑𝑡→0𝐼𝑥𝑢+𝐼𝑦𝑣+𝐼𝑡=0𝐼𝑥𝐼𝑦𝑢𝑣=−𝐼𝑡2ndassumptionMachinePerceptionandInteractionGroup(MPIG)𝐼𝑥𝐼𝑦𝑢𝑣=−𝐼𝑡𝐼𝑥1𝐼𝑦1……𝐼𝑥𝑛𝐼𝑦𝑛𝑢𝑣=−𝐼𝑡1…𝐼𝑡𝑛3rdassumption𝐴𝑢=𝑏MachinePerceptionandInteractionGroup(MPIG)𝑢𝑥,𝑢𝑦𝐈𝐉𝑣𝑥′,𝑣𝑦′𝐝=𝑑𝑥𝑑𝑦𝑇grayvalueuisI(x,y)uv𝐯=𝐮+𝐝=𝑢𝑥+𝑑𝑥𝑢𝑦+𝑑𝑦TThegoalistofindvonJ,whereI(u)andJ(v)aresimilarThewayistocomputed𝑢𝑥,𝑢𝑦MachinePerceptionandInteractionGroup(MPIG)𝘀(𝐝)𝘀𝑑=𝘀𝑑𝑥,𝑑𝑦=𝐼𝑥,𝑦−𝐽𝑥+𝑑𝑥,𝑦+𝑑𝑦2𝑢𝑦+𝑤𝑦𝑦=𝑢𝑦−𝑤𝑦𝑢𝑥+𝑤𝑥𝑥=𝑢𝑥−𝑤𝑥𝐈𝐉𝑤𝑥𝑤𝑦−2Windowsize(2𝑤𝑥+1)×(2𝑤𝑦+1)MachinePerceptionandInteractionGroup(MPIG)𝐈0=𝐈originalimage𝐈L−1𝐈Lm𝐮(𝐮0)𝐮L−1𝐈L𝐮L𝐿≥1𝐿𝑚≥2𝐈𝐿=𝐈𝐿−12Windowsize2𝑤𝑥+1×2𝑤𝑦+1isconstantforallpyramidMachinePerceptionandInteractionGroup(MPIG)𝐈0=𝐈𝐈L−1𝐈Lm𝐮(𝐮0)𝐮L−1𝐈L𝐮LAgivenpointuin𝐈,finditscorrespondinglocation𝐯=𝐮+𝐝𝐮𝐿=𝐮2𝐿𝑑𝐿𝑚𝑑𝐿𝑑𝐿−1𝑑Initialguess𝑔𝐿𝑚=00𝑇𝑔𝐿𝑔𝐿−1=2𝑔𝐿+𝑑𝐿𝑔𝐿−1MachinePerceptionandInteractionGroup(MPIG)𝐈Lm𝑑𝐿𝑚𝑔𝐿𝑚−1𝑑𝐿𝑚−1𝐈Lm−𝟏𝑔𝐿isusedtopre-translatetheimagepatchin2ndimage𝐉𝘀𝐿𝑑𝐿=𝘀𝐿𝑑𝑥𝐿,𝑑𝑦𝐿=𝐼𝐿𝑥,𝑦−𝐽𝐿𝑥+𝑔𝑥𝐿+𝑑𝑥𝐿,𝑦+𝑔𝑦𝐿+𝑑𝑦𝐿2𝑢𝑦𝐿+𝑤𝑦𝑦=𝑢𝑦𝐿−𝑤𝑦𝑢𝑥𝐿+𝑤𝑥𝑥=𝑢𝑥𝐿−𝑤𝑥matchingerrorfunction:𝑑=2𝐿𝑑𝐿𝐿𝑚𝐿=0𝑑=12𝑔𝐿𝑚−2=2𝑑𝐿𝑚+𝑑𝐿𝑚−1MachinePerceptionandInteractionGroup(MPIG)𝑑𝐿thatminimizesthematchingfunction𝘀𝐿DefinenewimagesAandB𝐴(𝑥,𝑦)=𝐼𝐿(𝑥,𝑦)𝐵(𝑥,𝑦)=𝐽𝐿(𝑥+𝑔𝑥𝐿,𝑦+𝑔𝑦𝐿)𝘀𝐿𝑑𝐿=𝘀𝐿𝑑𝑥𝐿,𝑑𝑦𝐿=𝐴𝑥,𝑦−𝐵𝑥+𝑑𝑥𝐿,𝑦+𝑑𝑦𝐿2𝑢𝑦𝐿+𝑤𝑦𝑦=𝑢𝑦𝐿−𝑤𝑦𝑢𝑥𝐿+𝑤𝑥𝑥=𝑢𝑥𝐿−𝑤𝑥Wewriteasfollowforconvenience𝘀𝑑=𝘀𝑑𝑥,𝑑𝑦=𝐴𝑥,𝑦−𝐵𝑥+𝑑𝑥,𝑦+𝑑𝑦2𝑢𝑦+𝑤𝑦𝑦=𝑢𝑦−𝑤𝑦𝑢𝑥+𝑤𝑥𝑥=𝑢𝑥−𝑤𝑥MachinePerceptionandInteractionGroup(MPIG)𝑑𝘀𝑑=𝘀𝑑𝑥,𝑑𝑦=𝐴𝑥,𝑦−𝐵𝑥+𝑑𝑥,𝑦+𝑑𝑦2𝑢𝑦+𝑤𝑦𝑦=𝑢𝑦−𝑤𝑦𝑢𝑥+𝑤𝑥𝑥=𝑢𝑥−𝑤𝑥𝜕𝘀(𝑑)𝜕𝑑𝑑−𝑑𝑜𝑝𝑡=00𝜕𝘀(𝑑)𝜕𝑑=−2𝐴𝑥,𝑦−𝐵𝑥+𝑑𝑥,𝑦+𝑑𝑦∙𝜕𝐵𝜕𝑥𝜕𝐵𝜕𝑦𝑢𝑦+𝑤𝑦𝑦=𝑢𝑦−𝑤𝑦𝑢𝑥+𝑤𝑥𝑥=𝑢𝑥−𝑤𝑥𝐵𝑥+𝑑𝑥,𝑦+𝑑𝑦=𝐵𝑥,𝑦+𝜕𝐵𝜕𝑥𝜕𝐵𝜕𝑦𝑑1storderTaylorex
本文标题:视觉里程计原理(二)特征匹配与追踪(LK光流法)
链接地址:https://www.777doc.com/doc-4459022 .html