ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
LK	
 ?	
 ?matching
                            SURF	
 ?matching
                             Kalman	
 ?Filter



OpenCV? ??? ??
   ??? ?? ??


           Daesik	
 ?Jang
      dsjang@kunsan.ac.kr



                                               1
1.	
 ?LK	
 ????	
 ????	
 ???


        ? goodFeaturesToTrack	
 ?:	
 ????	
 ???
        ? calcOpBcalFlowPyrLK	
 ?:	
 ?LK	
 ??????	
 ?????	
 ????	
 ?feature-?©\
          prev	
 ??????	
 ?image_next??	
 ???	
 ?features_next?	
 ???
                                                                                         //	
 ?Tracker	
 ?is	
 ?initialised	
 ?and	
 ?initial	
 ?features	
 ?are	
 ?stored	
 ?in	
 ?features_next
                                                                                         //	
 ?Now	
 ?iterate	
 ?through	
 ?rest	
 ?of	
 ?images
//	
 ?Obtain	
 ?first	
 ?image	
 ?and	
 ?set	
 ?up	
 ?two	
 ?feature	
 ?vectors          for(;;)
cv::Mat	
 ?image_prev,	
 ?image_next;                                                    {
std::vector<cv::Point>	
 ?features_prev,	
 ?features_next;                               	
 ?	
 ?	
 ?	
 ?image_prev	
 ?=	
 ?image_next.clone();
                                                                                         	
 ?	
 ?	
 ?	
 ?feature_prev	
 ?=	
 ?features_next;
image_next	
 ?=	
 ?getImage();                                                           	
 ?	
 ?	
 ?	
 ?image_next	
 ?=	
 ?getImage();	
 ?	
 ?//	
 ?Get	
 ?next	
 ?image

//	
 ?Obtain	
 ?initial	
 ?set	
 ?of	
 ?features                                         	
 ?	
 ?	
 ?	
 ?//	
 ?Find	
 ?position	
 ?of	
 ?feature	
 ?in	
 ?new	
 ?image
cv::goodFeaturesToTrack(image_next,	
 ?//	
 ?the	
 ?image	
 ?                            	
 ?	
 ?	
 ?	
 ?cv::calcOpticalFlowPyrLK(
	
 ?	
 ?features_next,	
 ?	
 ?	
 ?//	
 ?the	
 ?output	
 ?detected	
 ?features            	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?image_prev,	
 ?image_next,	
 ?//	
 ?2	
 ?consecutive	
 ?images
	
 ?	
 ?max_count,	
 ?	
 ?//	
 ?the	
 ?maximum	
 ?number	
 ?of	
 ?features	
 ?           	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?feature_prev,	
 ?//	
 ?input	
 ?point	
 ?positions	
 ?in	
 ?first	
 ?im
	
 ?	
 ?qlevel,	
 ?	
 ?	
 ?	
 ?	
 ?//	
 ?quality	
 ?level                                	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?features_next,	
 ?//	
 ?output	
 ?point	
 ?positions	
 ?in	
 ?the	
 ?2nd
	
 ?	
 ?minDist	
 ?	
 ?	
 ?	
 ?	
 ?//	
 ?min	
 ?distance	
 ?between	
 ?two	
 ?features   	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?status,	
 ?	
 ?	
 ?	
 ?//	
 ?tracking	
 ?success
);                                                                                       	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?err	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?//	
 ?tracking	
 ?error
                                                                                         	
 ?	
 ?	
 ?	
 ?);

                                                                                         	
 ?	
 ?	
 ?	
 ?if	
 ?(	
 ?stopTracking()	
 ?)	
 ?break;
                                                                                         }




                                                                                                                                                                                            2
2.	
 ?SURF	
 ????	
 ????	
 ???

? SurfFeatureDetector	
 ?????	
 ?detect()	
 ?????	
 ????	
 ?SURF	
 ?
  ??	
 ???
  ¨C ???	
 ????	
 ?keypoints	
 ????	
 ????

               // vector of keypoints
                  std::vector<cv::KeyPoint> keypoints;
                  // Construct the SURF feature detector object
                  cv::SurfFeatureDetector surf(
                     2500.); // threshold
                  // Detect the SURF features
                  surf.detect(image,keypoints);

        // Draw the keypoints with scale and orientation information
           cv::drawKeypoints(image, // original image
             keypoints, // vector of keypoints

           featureImage, // the resulting image
           cv::Scalar(255,255,255),
           cv::DrawMatchesFlags::DRAW_RICH_KEYPOINTS); //?ag           3
2.	
 ?SURF	
 ????	
 ????	
 ???




                                 4
2.	
 ?SURF	
 ????	
 ????	
 ???

? SurfDescriptorExtractor	
 ?????	
 ?????	
 ?keypoint???	
 ?
  ????	
 ?????	
 ?descriptor?	
 ???

             // Construction of the SURF descriptor extractor
                 cv::SurfDescriptorExtractor surfDesc;
                 // Extraction of the SURF descriptors
                 cv::Mat descriptors1;
                 surfDesc.compute(image1,keypoints1,descriptors1);




                                                                     5
2.	
 ?SURF	
 ????	
 ????	
 ???


? BruteForceMatcher	
 ?????	
 ?????	
 ?descriptor?	
 ????	
 ???	
 ?
  ???	
 ?matches?	
 ?????.




              // Construction of the matcher
              cv::BruteForceMatcher<cv::L2<?oat>> matcher;
              // Match the two image descriptors
              std::vector<cv::DMatch> matches;
              matcher.match(descriptors1,descriptors2, matches);




                                                                      6
2.	
 ?SURF	
 ????	
 ????	
 ???



? keypoint??	
 ?matching	
 ?	
 ????	
 ????	
 ?????	
 ?????	
 ?
  ???.

             cv::Mat imageMatches;
             cv::drawMatches(
              image1,keypoints1, // 1st image and its keypoints
              image2,keypoints2, // 2nd image and its keypoints
              matches,        // the matches
              imageMatches,       // the image produced
              cv::Scalar(255,255,255)); // color of the lines




                                                                  7
2.	
 ?SURF	
 ????	
 ????	
 ???


? SURF	
 ?????	
 ???	
 ???




                                 8
3.	
 ?OpenCV?	
 ?Kalman	
 ?Filter?	
 ????	
 ???


? KalmanFilter	
 ????	
 ????	
 ???

      KalmanFilter	
 ?KF(4,	
 ?2,	
 ?0);
      KF.transiBonMatrix	
 ?=	
 ?*(Mat_<?oat>(4,	
 ?4)	
 ?<<	
 ?1,0,1,0,	
 ?	
 ?	
 ?0,1,0,1,	
 ?	
 ?0,0,1,0,	
 ?	
 ?0,0,0,1);
      Mat_<?oat>	
 ?measurement(2,1);	
 ?measurement.setTo(Scalar(0));
      	
 ?
      //	
 ?init...
      KF.statePre.at<?oat>(0)	
 ?=	
 ?mouse_info.x;
      KF.statePre.at<?oat>(1)	
 ?=	
 ?mouse_info.y;
      KF.statePre.at<?oat>(2)	
 ?=	
 ?0;
      KF.statePre.at<?oat>(3)	
 ?=	
 ?0;
      setIdenBty(KF.measurementMatrix);
      setIdenBty(KF.processNoiseCov,	
 ?Scalar::all(1e-?©\4));
      setIdenBty(KF.measurementNoiseCov,	
 ?Scalar::all(1e-?©\1));
      setIdenBty(KF.errorCovPost,	
 ?Scalar::all(.1));


                                                                                                                                9
3.	
 ?OpenCV?	
 ?Kalman	
 ?Filter?	
 ????	
 ???


? KF	
 ????	
 ????	
 ????	
 ???
  //	
 ?First	
 ?predict,	
 ?to	
 ?update	
 ?the	
 ?internal	
 ?statePre	
 ?variable
  Mat	
 ?prediction	
 ?=	
 ?KF.predict();
  Point	
 ?
  predictPt(prediction.at<float>(0),prediction.at<float>(1));
  	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?
  //	
 ?Get	
 ?mouse	
 ?point
  measurement(0)	
 ?=	
 ?mouse_info.x;
  measurement(1)	
 ?=	
 ?mouse_info.y;
  	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?	
 ?
  Point	
 ?measPt(measurement(0),measurement(1));
  	
 ?
  //	
 ?The	
 ?"correct"	
 ?phase	
 ?that	
 ?is	
 ?going	
 ?to	
 ?use	
 ?the	
 ?predicted	
 ?value	
 ?
  and	
 ?our	
 ?measurement
  Mat	
 ?estimated	
 ?=	
 ?KF.correct(measurement);
  Point	
 ?statePt(estimated.at<float>(0),estimated.at<float>(1));

                                                                                                         10
Ad

Recommended

Objective-C Runtime overview
Objective-C Runtime overview
Fantageek
?
openFrameworks 007 - utils
openFrameworks 007 - utils
roxlu
?
Open Babel 2.3 Quick Reference
Open Babel 2.3 Quick Reference
baoilleach
?
Design patterns
Design patterns
Ba Tran
?
Mvc express presentation
Mvc express presentation
Raimundas Banevi?ius
?
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013
Raimundas Banevi?ius
?
??????? ????
??????? ????
?? ?
?
?? ???? ??? ??? ??
?? ???? ??? ??? ??
?? ?
?
Python ??: ??? ??? ??? ??
Python ??: ??? ??? ??? ??
? ?
?
OpenCV ?? OpenCL ?? ???
OpenCV ?? OpenCL ?? ???
Seunghwa Song
?
20150306 ????? IPython?????????_???
20150306 ????? IPython?????????_???
Tae Young Lee
?
Jupyter notebok tensorboard ????_20160706
Jupyter notebok tensorboard ????_20160706
Yong Joon Moon
?
Jupyter notebook ????
Jupyter notebook ????
Yong Joon Moon
?
2016317 ?????_???_??????_Jupyter?????????_???
2016317 ?????_???_??????_Jupyter?????????_???
Tae Young Lee
?
????? ?? ????
????? ?? ????
Yong Joon Moon
?
Panoramic Imaging using SIFT and SURF
Panoramic Imaging using SIFT and SURF
Eric Jansen
?
VideoMR - A Map and Reduce Framework for Real-time Video Processing
VideoMR - A Map and Reduce Framework for Real-time Video Processing
Matthias Trapp
?
[232]TensorRT? ??? ??? Inference ???
[232]TensorRT? ??? ??? Inference ???
NAVER D2
?
[232] TensorRT? ??? ??? Inference ???
[232] TensorRT? ??? ??? Inference ???
NAVER D2
?
More Maintainable, Testable Applications with Dependency Injection in Spring
More Maintainable, Testable Applications with Dependency Injection in Spring
VMware Tanzu
?
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools
Mark Billinghurst
?
Open Cv 2005 Q4 Tutorial
Open Cv 2005 Q4 Tutorial
antiw
?
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Chris Adamson
?
Object-Oriented JavaScript
Object-Oriented JavaScript
kvangork
?
Object-Oriented Javascript
Object-Oriented Javascript
kvangork
?
PVS-Studio Meets Octave
PVS-Studio Meets Octave
PVS-Studio
?
EE660_Report_YaxinLiu_8448347171
EE660_Report_YaxinLiu_8448347171
Yaxin Liu
?
?ReactiveCocoa §Ú MVVM? ¡ª §¯§Ú§Ü§à§Ý§Ñ§Û §¬§Ñ§ã§î§ñ§ß§à§Ó, SoftWear
?ReactiveCocoa §Ú MVVM? ¡ª §¯§Ú§Ü§à§Ý§Ñ§Û §¬§Ñ§ã§î§ñ§ß§à§Ó, SoftWear
e-Legion
?
20110220 computer vision_eruhimov_lecture02
20110220 computer vision_eruhimov_lecture02
Computer Science Club
?
OpenCV Introduction
OpenCV Introduction
Zachary Blair
?

More Related Content

Viewers also liked (7)

Python ??: ??? ??? ??? ??
Python ??: ??? ??? ??? ??
? ?
?
OpenCV ?? OpenCL ?? ???
OpenCV ?? OpenCL ?? ???
Seunghwa Song
?
20150306 ????? IPython?????????_???
20150306 ????? IPython?????????_???
Tae Young Lee
?
Jupyter notebok tensorboard ????_20160706
Jupyter notebok tensorboard ????_20160706
Yong Joon Moon
?
Jupyter notebook ????
Jupyter notebook ????
Yong Joon Moon
?
2016317 ?????_???_??????_Jupyter?????????_???
2016317 ?????_???_??????_Jupyter?????????_???
Tae Young Lee
?
????? ?? ????
????? ?? ????
Yong Joon Moon
?
Python ??: ??? ??? ??? ??
Python ??: ??? ??? ??? ??
? ?
?
OpenCV ?? OpenCL ?? ???
OpenCV ?? OpenCL ?? ???
Seunghwa Song
?
20150306 ????? IPython?????????_???
20150306 ????? IPython?????????_???
Tae Young Lee
?
Jupyter notebok tensorboard ????_20160706
Jupyter notebok tensorboard ????_20160706
Yong Joon Moon
?
2016317 ?????_???_??????_Jupyter?????????_???
2016317 ?????_???_??????_Jupyter?????????_???
Tae Young Lee
?

Similar to Open cv??? ????????? tracking (20)

Panoramic Imaging using SIFT and SURF
Panoramic Imaging using SIFT and SURF
Eric Jansen
?
VideoMR - A Map and Reduce Framework for Real-time Video Processing
VideoMR - A Map and Reduce Framework for Real-time Video Processing
Matthias Trapp
?
[232]TensorRT? ??? ??? Inference ???
[232]TensorRT? ??? ??? Inference ???
NAVER D2
?
[232] TensorRT? ??? ??? Inference ???
[232] TensorRT? ??? ??? Inference ???
NAVER D2
?
More Maintainable, Testable Applications with Dependency Injection in Spring
More Maintainable, Testable Applications with Dependency Injection in Spring
VMware Tanzu
?
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools
Mark Billinghurst
?
Open Cv 2005 Q4 Tutorial
Open Cv 2005 Q4 Tutorial
antiw
?
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Chris Adamson
?
Object-Oriented JavaScript
Object-Oriented JavaScript
kvangork
?
Object-Oriented Javascript
Object-Oriented Javascript
kvangork
?
PVS-Studio Meets Octave
PVS-Studio Meets Octave
PVS-Studio
?
EE660_Report_YaxinLiu_8448347171
EE660_Report_YaxinLiu_8448347171
Yaxin Liu
?
?ReactiveCocoa §Ú MVVM? ¡ª §¯§Ú§Ü§à§Ý§Ñ§Û §¬§Ñ§ã§î§ñ§ß§à§Ó, SoftWear
?ReactiveCocoa §Ú MVVM? ¡ª §¯§Ú§Ü§à§Ý§Ñ§Û §¬§Ñ§ã§î§ñ§ß§à§Ó, SoftWear
e-Legion
?
20110220 computer vision_eruhimov_lecture02
20110220 computer vision_eruhimov_lecture02
Computer Science Club
?
OpenCV Introduction
OpenCV Introduction
Zachary Blair
?
Android Camera Architecture
Android Camera Architecture
Picker Weng
?
Rotoscope inthebrowserppt billy
Rotoscope inthebrowserppt billy
nimbleltd
?
Javascript tdd byandreapaciolla
Javascript tdd byandreapaciolla
Andrea Paciolla
?
°¿±è±ð²Ô°ä³Õ¤Î»ù´¡
°¿±è±ð²Ô°ä³Õ¤Î»ù´¡
îIÒ» ºÍȪÌï
?
How to create a camera2
How to create a camera2
Booch Lin
?
Panoramic Imaging using SIFT and SURF
Panoramic Imaging using SIFT and SURF
Eric Jansen
?
VideoMR - A Map and Reduce Framework for Real-time Video Processing
VideoMR - A Map and Reduce Framework for Real-time Video Processing
Matthias Trapp
?
[232]TensorRT? ??? ??? Inference ???
[232]TensorRT? ??? ??? Inference ???
NAVER D2
?
[232] TensorRT? ??? ??? Inference ???
[232] TensorRT? ??? ??? Inference ???
NAVER D2
?
More Maintainable, Testable Applications with Dependency Injection in Spring
More Maintainable, Testable Applications with Dependency Injection in Spring
VMware Tanzu
?
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools
Mark Billinghurst
?
Open Cv 2005 Q4 Tutorial
Open Cv 2005 Q4 Tutorial
antiw
?
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Chris Adamson
?
Object-Oriented JavaScript
Object-Oriented JavaScript
kvangork
?
Object-Oriented Javascript
Object-Oriented Javascript
kvangork
?
PVS-Studio Meets Octave
PVS-Studio Meets Octave
PVS-Studio
?
EE660_Report_YaxinLiu_8448347171
EE660_Report_YaxinLiu_8448347171
Yaxin Liu
?
?ReactiveCocoa §Ú MVVM? ¡ª §¯§Ú§Ü§à§Ý§Ñ§Û §¬§Ñ§ã§î§ñ§ß§à§Ó, SoftWear
?ReactiveCocoa §Ú MVVM? ¡ª §¯§Ú§Ü§à§Ý§Ñ§Û §¬§Ñ§ã§î§ñ§ß§à§Ó, SoftWear
e-Legion
?
20110220 computer vision_eruhimov_lecture02
20110220 computer vision_eruhimov_lecture02
Computer Science Club
?
Android Camera Architecture
Android Camera Architecture
Picker Weng
?
Rotoscope inthebrowserppt billy
Rotoscope inthebrowserppt billy
nimbleltd
?
Javascript tdd byandreapaciolla
Javascript tdd byandreapaciolla
Andrea Paciolla
?
How to create a camera2
How to create a camera2
Booch Lin
?
Ad

Recently uploaded (20)

FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
?
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
?
The Future of Technology: 2025-2125 by Saikat Basu.pdf
The Future of Technology: 2025-2125 by Saikat Basu.pdf
Saikat Basu
?
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
?
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
?
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Safe Software
?
Wenn alles versagt - IBM Tape sch¨¹tzt, was z?hlt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape sch¨¹tzt, was z?hlt! Und besonders mit dem neust...
Josef Weingand
?
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
?
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
?
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
?
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
?
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
?
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
?
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
?
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
?
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
?
Improving Data Integrity: Synchronization between EAM and ArcGIS Utility Netw...
Improving Data Integrity: Synchronization between EAM and ArcGIS Utility Netw...
Safe Software
?
Turning the Page ¨C How AI is Exponentially Increasing Speed, Accuracy, and Ef...
Turning the Page ¨C How AI is Exponentially Increasing Speed, Accuracy, and Ef...
Impelsys Inc.
?
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
?
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
?
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
?
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
?
The Future of Technology: 2025-2125 by Saikat Basu.pdf
The Future of Technology: 2025-2125 by Saikat Basu.pdf
Saikat Basu
?
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
?
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Safe Software
?
Wenn alles versagt - IBM Tape sch¨¹tzt, was z?hlt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape sch¨¹tzt, was z?hlt! Und besonders mit dem neust...
Josef Weingand
?
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
?
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
?
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
?
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
?
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
?
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
?
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
?
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
?
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
?
Improving Data Integrity: Synchronization between EAM and ArcGIS Utility Netw...
Improving Data Integrity: Synchronization between EAM and ArcGIS Utility Netw...
Safe Software
?
Turning the Page ¨C How AI is Exponentially Increasing Speed, Accuracy, and Ef...
Turning the Page ¨C How AI is Exponentially Increasing Speed, Accuracy, and Ef...
Impelsys Inc.
?
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
?
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
?
Ad

Open cv??? ????????? tracking

  • 1. LK ? ?matching SURF ?matching Kalman ?Filter OpenCV? ??? ?? ??? ?? ?? Daesik ?Jang dsjang@kunsan.ac.kr 1
  • 2. 1. ?LK ???? ???? ??? ? goodFeaturesToTrack ?: ???? ??? ? calcOpBcalFlowPyrLK ?: ?LK ?????? ????? ???? ?feature-?©\ prev ?????? ?image_next?? ??? ?features_next? ??? // ?Tracker ?is ?initialised ?and ?initial ?features ?are ?stored ?in ?features_next // ?Now ?iterate ?through ?rest ?of ?images // ?Obtain ?first ?image ?and ?set ?up ?two ?feature ?vectors for(;;) cv::Mat ?image_prev, ?image_next; { std::vector<cv::Point> ?features_prev, ?features_next; ? ? ? ?image_prev ?= ?image_next.clone(); ? ? ? ?feature_prev ?= ?features_next; image_next ?= ?getImage(); ? ? ? ?image_next ?= ?getImage(); ? ?// ?Get ?next ?image // ?Obtain ?initial ?set ?of ?features ? ? ? ?// ?Find ?position ?of ?feature ?in ?new ?image cv::goodFeaturesToTrack(image_next, ?// ?the ?image ? ? ? ? ?cv::calcOpticalFlowPyrLK( ? ?features_next, ? ? ?// ?the ?output ?detected ?features ? ? ? ? ? ?image_prev, ?image_next, ?// ?2 ?consecutive ?images ? ?max_count, ? ?// ?the ?maximum ?number ?of ?features ? ? ? ? ? ? ?feature_prev, ?// ?input ?point ?positions ?in ?first ?im ? ?qlevel, ? ? ? ? ?// ?quality ?level ? ? ? ? ? ?features_next, ?// ?output ?point ?positions ?in ?the ?2nd ? ?minDist ? ? ? ? ?// ?min ?distance ?between ?two ?features ? ? ? ? ? ?status, ? ? ? ?// ?tracking ?success ); ? ? ? ? ? ?err ? ? ? ? ? ?// ?tracking ?error ? ? ? ?); ? ? ? ?if ?( ?stopTracking() ?) ?break; } 2
  • 3. 2. ?SURF ???? ???? ??? ? SurfFeatureDetector ????? ?detect() ????? ???? ?SURF ? ?? ??? ¨C ??? ???? ?keypoints ???? ???? // vector of keypoints std::vector<cv::KeyPoint> keypoints; // Construct the SURF feature detector object cv::SurfFeatureDetector surf( 2500.); // threshold // Detect the SURF features surf.detect(image,keypoints); // Draw the keypoints with scale and orientation information cv::drawKeypoints(image, // original image keypoints, // vector of keypoints featureImage, // the resulting image cv::Scalar(255,255,255), cv::DrawMatchesFlags::DRAW_RICH_KEYPOINTS); //?ag 3
  • 4. 2. ?SURF ???? ???? ??? 4
  • 5. 2. ?SURF ???? ???? ??? ? SurfDescriptorExtractor ????? ????? ?keypoint??? ? ???? ????? ?descriptor? ??? // Construction of the SURF descriptor extractor cv::SurfDescriptorExtractor surfDesc; // Extraction of the SURF descriptors cv::Mat descriptors1; surfDesc.compute(image1,keypoints1,descriptors1); 5
  • 6. 2. ?SURF ???? ???? ??? ? BruteForceMatcher ????? ????? ?descriptor? ???? ??? ? ??? ?matches? ?????. // Construction of the matcher cv::BruteForceMatcher<cv::L2<?oat>> matcher; // Match the two image descriptors std::vector<cv::DMatch> matches; matcher.match(descriptors1,descriptors2, matches); 6
  • 7. 2. ?SURF ???? ???? ??? ? keypoint?? ?matching ? ???? ???? ????? ????? ? ???. cv::Mat imageMatches; cv::drawMatches( image1,keypoints1, // 1st image and its keypoints image2,keypoints2, // 2nd image and its keypoints matches, // the matches imageMatches, // the image produced cv::Scalar(255,255,255)); // color of the lines 7
  • 8. 2. ?SURF ???? ???? ??? ? SURF ????? ??? ??? 8
  • 9. 3. ?OpenCV? ?Kalman ?Filter? ???? ??? ? KalmanFilter ???? ???? ??? KalmanFilter ?KF(4, ?2, ?0); KF.transiBonMatrix ?= ?*(Mat_<?oat>(4, ?4) ?<< ?1,0,1,0, ? ? ?0,1,0,1, ? ?0,0,1,0, ? ?0,0,0,1); Mat_<?oat> ?measurement(2,1); ?measurement.setTo(Scalar(0)); ? // ?init... KF.statePre.at<?oat>(0) ?= ?mouse_info.x; KF.statePre.at<?oat>(1) ?= ?mouse_info.y; KF.statePre.at<?oat>(2) ?= ?0; KF.statePre.at<?oat>(3) ?= ?0; setIdenBty(KF.measurementMatrix); setIdenBty(KF.processNoiseCov, ?Scalar::all(1e-?©\4)); setIdenBty(KF.measurementNoiseCov, ?Scalar::all(1e-?©\1)); setIdenBty(KF.errorCovPost, ?Scalar::all(.1)); 9
  • 10. 3. ?OpenCV? ?Kalman ?Filter? ???? ??? ? KF ???? ???? ???? ??? // ?First ?predict, ?to ?update ?the ?internal ?statePre ?variable Mat ?prediction ?= ?KF.predict(); Point ? predictPt(prediction.at<float>(0),prediction.at<float>(1)); ? ? ? ? ? ? ? ? ? ? ? ? ? // ?Get ?mouse ?point measurement(0) ?= ?mouse_info.x; measurement(1) ?= ?mouse_info.y; ? ? ? ? ? ? ? ? ? ? ? ? ? Point ?measPt(measurement(0),measurement(1)); ? // ?The ?"correct" ?phase ?that ?is ?going ?to ?use ?the ?predicted ?value ? and ?our ?measurement Mat ?estimated ?= ?KF.correct(measurement); Point ?statePt(estimated.at<float>(0),estimated.at<float>(1)); 10