Object tracking using Homography - OpenCV 3.4 with python 3 Tutorial 34

  Рет қаралды 36,704

Pysource

Pysource

6 жыл бұрын

We’re going to learn in this tutorial how to track an object using the Feature matching method, and then finding the Homography.
Instructions and source code: pysource.com/2018/06/05/object...
➤ Full Videocourses:
Object Detection: pysource.com/object-detection...
➤ Follow me on:
Instagram: / pysource7
LinkedIn: / pysource
➤ For business inquiries:
pysource.com/contact

Пікірлер: 65
@aldomz219
@aldomz219 6 жыл бұрын
I love your tutorials. I'm taking a computer vision course and doing a project related to traffic sign detection and identification and your videos have been a great help. Keep it up!
@chiarafarnesi6432
@chiarafarnesi6432 5 жыл бұрын
Grazie infinitamente per i tutorial sui SIFT SURF e ORB. Sono stati di grande aiuto per avere una conoscienta base . Spiegazione semplice ma incisiva
@danichigokun
@danichigokun 5 жыл бұрын
SO MUCH THANK YOU!!!! this is what i was looking for, thanks so much :D
@khueha5566
@khueha5566 6 жыл бұрын
Great job man!
@ai4popugai
@ai4popugai 4 жыл бұрын
Appreciate your job, keep going!!
@eliavuzana1126
@eliavuzana1126 5 жыл бұрын
realy appriciate you... your video is very helpful! thx:)
@genp6081
@genp6081 5 жыл бұрын
Hi there, the code snippets you show are great, they are really really useful, thank you for that. Don't hesitate in the future to explain a little bit more what the main lines do, the videos are already long so a few extra minutes don't matter
@JulioCesarPereira
@JulioCesarPereira 3 жыл бұрын
Very nice video. It helped me a lot. Thanks.
@sanchaykasturey5334
@sanchaykasturey5334 3 жыл бұрын
Very easy to understand and good video can you please tell me if there is a way by which we can see what is its accuracy
@NABHANMEMORIES
@NABHANMEMORIES 5 жыл бұрын
thank you very much
@altantoksoz5999
@altantoksoz5999 4 жыл бұрын
greate tutorial
@mohamedihmeida6096
@mohamedihmeida6096 3 жыл бұрын
Thank you for the video. Could you count the outlier matching points after you applied RANSAC?
@juda
@juda 5 жыл бұрын
GOTCHA! L'avevo capito che sei italiano Complimenti per i video.
@souravgames
@souravgames 6 жыл бұрын
awsum
@Ahmedyashar
@Ahmedyashar 2 жыл бұрын
Thank you
@sallyhuang9479
@sallyhuang9479 5 жыл бұрын
thank you very much for your tutorial and it is really helpful. I want to ask whether we can derive the homography between the book and the camera? i mean can we obtain the 3d position of the book?
@Sebasdlh
@Sebasdlh 5 жыл бұрын
I did sort of the same thing but with the ORB algorithm with a book and also using my webcam, and it draw a rectangle that moved waay to fast and was all over the place changing with the matches.... Do you know any way to fix this?
@PrasannaRoutray97
@PrasannaRoutray97 5 жыл бұрын
How good is this method for dynamic object tracking? What is the FPS? is it possible to track small logo?
@thorbenpanusch779
@thorbenpanusch779 4 жыл бұрын
For what did you caculate/deduct the variable matches_mask? As far as I can see, it's not being used. Best regards
@igorandrusyk2307
@igorandrusyk2307 4 жыл бұрын
Hello. How I can get object id for multiple detection? Any idea?
@daryafelfelak1599
@daryafelfelak1599 5 жыл бұрын
thanks a looooooot
@mharllclarenz1449
@mharllclarenz1449 6 ай бұрын
this can be use to detect phone?
@user-hs4rv6sj6t
@user-hs4rv6sj6t 4 жыл бұрын
Hello. I am using the video above.I want to track the object I want. The difference is that there are same objects on the screen, and I want to track them at the same time. I wonder if you have any good ideas. Please help me.
@kranthikumar4674
@kranthikumar4674 4 жыл бұрын
i had an error as no cv2 found...
@SimonKlimekNetwork
@SimonKlimekNetwork 5 жыл бұрын
Great Video! AT the very end of video I receive this: OpenCV(3.4.1) Error: Assertion failed (scn + 1 == m.cols) in perspectiveTransform Can anyone faced this issue? (Also I changed SIFT to SURF due to errors) Cheers
@samaramunoz1829
@samaramunoz1829 4 жыл бұрын
I have the same problem
@vshvit
@vshvit 4 жыл бұрын
try this: if matrix is not None: h, w = img.shape pts = np.float32([[0, 0], [0, h], [w, h], [w, 0]]).reshape(-1, 1, 2) dst = cv2.perspectiveTransform(pts, matrix) homography = cv2.polylines(frame, [np.int32(dst)], True, (255, 0, 0), 3) cv2.imshow("Homography", homography)
@vkck7374
@vkck7374 5 жыл бұрын
Sometime it has a bug when I use some different video in Mp4 format miniflann.cpp:315: error: (-210:Unsupported format or combination of formats) in function 'cv::flann::buildIndex_' So I don't know how to fix it, can you help me ?
@oussamahamed2380
@oussamahamed2380 5 жыл бұрын
because you use opencv3 and sift isn't available for any version of opencv 3.X
@ralphpamintuan5653
@ralphpamintuan5653 4 жыл бұрын
@Pysource can i ask why does when I run this code on Raspberry Pi 3 it says that flabnn.knnMatch format error type = 0
@phanitsok2370
@phanitsok2370 3 жыл бұрын
des2 = des2.astype(np.float32) des1 = des1.astype(np.float32) matches = flann.knnMatch(des1,des2,2) You must convet it to Float32 before matching
@dannydeadlifts
@dannydeadlifts 5 жыл бұрын
Hey man I don't know if you're aware of this, I was trying to code alongside you and right after the cv2.xfeatures2d.SIFT_create() function call the program will throw an error. The error log says "This algorithm is patented and is excluded in this configuration;" and suggests a rebuild of opencv with the flag OPENCV_ENABLE_NONFREE enabled (default is disabled). Just a heads up for anyone watching who's got OpenCV version >3.4.3. I don't know if it's legal to use a recompile as I'm checking this issue out as well. There's been several posts on the OpenCV git and StackOverflow explaining this. Would love to link them but I'm scared if youtube will filter it out as spam lol.
@deepak.rocks.
@deepak.rocks. 4 жыл бұрын
SIFT and SURF are examples of algorithms that OpenCV calls “non-free” modules. These algorithms are patented by their respective creators Sift is no longer available in opencv's inbuilt module You can still use them with opencv version 2.4.X
@sebigamer
@sebigamer 3 жыл бұрын
they took it out because it's patented. You can install the "opencv-contrib-python" module though, and if you want to use SURF you download version 3.4.2.16.
@ze_dron
@ze_dron 5 жыл бұрын
got OpenCV(3.4.1) C:\projects\opencv-python\opencv\modules\core\src\matmul.cpp:2268: error: (-215) scn + 1 == m.cols in function cv::perspectiveTransform with dist line (26 minute) has someone face with such a problem?
@samaramunoz1829
@samaramunoz1829 4 жыл бұрын
same
@phanitsok2370
@phanitsok2370 3 жыл бұрын
des2 = des2.astype(np.float32) des1 = des1.astype(np.float32) matches = flann.knnMatch(des1,des2,2)
@arthurnasrala
@arthurnasrala 3 жыл бұрын
@@phanitsok2370 this lines don`t solve the problem
@phanitsok2370
@phanitsok2370 3 жыл бұрын
@@arthurnasrala you must change des1 and des2 to Float32 and then match it. In this video he give different name and match. Opencv version 4.1.1 didint have a SIFT (Scale-Invariant Feature Transform) to use but u can use ORB replace SIFT.
@pratitnaik7270
@pratitnaik7270 5 жыл бұрын
Can this be used for hand gesture recognition?
@kemagorar
@kemagorar 5 жыл бұрын
Nope. Not reliable enough. Hardly gets any of the repeated gesture. even if the reference was made just with the same camera background setup etc.
@javlontursunov6527
@javlontursunov6527 2 жыл бұрын
Sir please make another video about how to fix xfeatures problem
@sandroormeno
@sandroormeno 9 ай бұрын
use sift = cv.SIFT_create()
@sebasnolascop
@sebasnolascop 3 жыл бұрын
@Pysource, I need help. When I run your code I get an error in this line: matches = flann.knnMatch(desc_image, desc_grayframe, k=2). I added this code: "if desc_grayframe is None: print(desc_grayframe)" and I got None. I don't know how to solver this problem. HELP ME PLEASE!!
@nigelnkomo6710
@nigelnkomo6710 3 жыл бұрын
Did you find the solution?
@aadibkarim8817
@aadibkarim8817 3 жыл бұрын
Hi Sergio. I really want to know how to use this Homography technique. But when I write the Sift code it says that the algorithm has been patented. I also cannot downgrade opencv to previous versions. Do you have anyway of doing object tracking other than this method? I would really appreciate your help and advise.
@pysource-com
@pysource-com 3 жыл бұрын
hi, you can install the lastest version of Opencv 4.5.x with pip install --upgrade opencv-python and it should work again
@aadibkarim8817
@aadibkarim8817 3 жыл бұрын
@@pysource-com Thanks a lot Sergio for your response. I will try again in that case
@utopictech6425
@utopictech6425 5 жыл бұрын
how i use multiple images?
@dannydeadlifts
@dannydeadlifts 5 жыл бұрын
might be useful to implement OOP and instantiate two different images using cv2.selectROI( ). never tried it but please consider giving it a try!
@faheemrehman3355
@faheemrehman3355 4 жыл бұрын
also i got this error kp_image, desc_image = sift.detectAndCompute(img, None) cv2.error: OpenCV(3.4.2) C:\projects\opencv-python\opencv_contrib\modules\xfeatures2d\src\sift.cpp:1121: error: (-5:Bad argument) image is empty or has incorrect depth (!=CV_8U) in function 'cv::xfeatures2d::SIFT_Impl::detectAndCompute' Kindly help
@MyDavidsen
@MyDavidsen 4 жыл бұрын
you need opencv contrib
@faheemrehman3355
@faheemrehman3355 4 жыл бұрын
I always got this error. Kindly help AttributeError: module 'cv2.cv2' has no attribute 'SIFT'
@faheemrehman3355
@faheemrehman3355 4 жыл бұрын
@@wadyn95 Can you please make a tutorial of tracking a specific person in real time. is there any way to make a boundary around one particular person just like the boundary you draw around the book
@tkinter3160
@tkinter3160 5 жыл бұрын
i have error sift = cv2.xfeatures2d.SIFT_create() cv2.error: OpenCV(3.4.3) D:\Build\OpenCV\opencv_contrib-3.4.3\modules\xfeatures2d\src\sift.cpp:1207: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'cv::xfeatures2d::SIFT::create' But i install opencv-python complete
@satyam171
@satyam171 4 жыл бұрын
install opencv-contrib-python version 3.4.2.16 it will work
@Yourself98
@Yourself98 5 жыл бұрын
I'm identifying tomatoes I can use this way, please
@pysource-com
@pysource-com 5 жыл бұрын
Nope, that's not a good approach. this method will only be reliable with identical objects. Regarding tomatoes you need some approach that involves machine learning.
@Yourself98
@Yourself98 5 жыл бұрын
@@pysource-com Do you make videos about machines learning
@igorandrusyk2307
@igorandrusyk2307 4 жыл бұрын
Very slow videostream after treacking .. Any idea how to speed it up?
@pysource-com
@pysource-com 4 жыл бұрын
The feature matching is computationally really expansive. A solution would be to shrink a bit the size of the image and also the video for the detection. But in case you want to show the video of the same size you still can do it, by keeping track of the position of the element in the smaller size and then calculate the proportion to show the rectangle on the bigger size.
@igorandrusyk2307
@igorandrusyk2307 4 жыл бұрын
@@pysource-com thanks for quick answer. What about run computation on GPU??
@pysource-com
@pysource-com 4 жыл бұрын
@@igorandrusyk2307 Python Opencv doesn't have much support for GPUs at the moment. I'm not sure if you'll be able to run this script using the GPU. if you have a nvidia gpu which supports CUDA then you could try compiling Opencv with cuda supporta enabled and see if it works.
@igorandrusyk2307
@igorandrusyk2307 4 жыл бұрын
@@pysource-com thanks
@1234kalki
@1234kalki 3 жыл бұрын
Summer update for OpenCV 4.x : SIFT (Scale-Invariant Feature Transform) algorithm has been moved to the main repository (patent on SIFT is expired)
Fourier Transform - OpenCV 3.4 with python 3 Tutorial 35
17:36
Object Tracking with Opencv and Python
30:03
Pysource
Рет қаралды 601 М.
Каха заблудился в горах
00:57
К-Media
Рет қаралды 4,7 МЛН
ВОДА В СОЛО
00:20
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 29 МЛН
Я обещал подарить ему самокат!
01:00
Vlad Samokatchik
Рет қаралды 3,3 МЛН
Predict trajectory of an Object with Kalman filter
31:30
Pysource
Рет қаралды 56 М.
OpenCV Python Feature Matching Homography
13:12
Kevin Wood
Рет қаралды 1,5 М.
30 - Image registration using homography in openCV
46:42
DigitalSreeni
Рет қаралды 35 М.
Image analysis: homography: planar homography
21:09
Hany Farid, Professor at UC Berkeley
Рет қаралды 1,5 М.
Tracking Objects | OpenCV Python Tutorials for Beginners 2020
18:28
Murtaza's Workshop - Robotics and AI
Рет қаралды 129 М.
Python - Строки и байты str, bytes, bytearray
17:35
Prog Construction
Рет қаралды 3 М.
Hashing Algorithms and Security - Computerphile
8:12
Computerphile
Рет қаралды 1,5 МЛН
The moment we stopped understanding AI [AlexNet]
17:38
Welch Labs
Рет қаралды 797 М.
Каха заблудился в горах
00:57
К-Media
Рет қаралды 4,7 МЛН