118 - Object detection by template matching

  Рет қаралды 41,531

DigitalSreeni

DigitalSreeni

Күн бұрын

This video explains the process of detecting objects in an image based on a template reference image. This process is not scale invariant, the template image must be of the same scale as the objects of interest.
Code generated in the video can be downloaded from here: github.com/bns...

Пікірлер
@priyankarsinha685
@priyankarsinha685 3 жыл бұрын
OMG, I have been searching about the explanation of all the modes that is used in template matching, and youtube didn't show me this!! thank you kind Sir, you made my day.
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
You're very welcome!
@Adityas-mc2ih
@Adityas-mc2ih 4 жыл бұрын
Hello Sreeni Sir, Absolutely love your tutorials. Please please continue this series. IT'LL BE GREAT IF YOU could also do real time image processing. Just one video where one can do a video analysis of a microscopic video. Please go for it sir. Thanks a lot. Love your work.
@DigitalSreeni
@DigitalSreeni 4 жыл бұрын
Video analysis is similar to image analysis. A video is just a bunch of frames so try loading it and using the same process.
@Djauvel
@Djauvel Жыл бұрын
This approach draws a TON of bounding boxes around each object, as the res image does not have a single point per object within the threshold. Use non_max_suppression from imutils to find only the best matching bounding box before you draw them. Otherwise, great video!
@DigitalSreeni
@DigitalSreeni Жыл бұрын
Good point! Thanks
@aryashah7892
@aryashah7892 7 ай бұрын
Great video! I have a question, what would be an optimal approach when I try to match my target object in an environment with lots of background object and having good amount of perfectly white as well as black in the background as well? I tried thresholding for matching but it cannot just lead to complete extracion of only target object in either value after binary conversion, i.e. many background object in the same pixel intensity exists. Thanks
@prakashmesta2136
@prakashmesta2136 Жыл бұрын
Thanks.. this video is really helping.... what method do we use if the template is not in the same scale as the object in the input image?
@nThanksForAllTheFish
@nThanksForAllTheFish Жыл бұрын
In the F16 example - coul you detect all the planes - ie handle size and rotation variation?
@domagojgotic4421
@domagojgotic4421 Жыл бұрын
Excellent tutorial and a really good explanation.
@MegaLenrique
@MegaLenrique Жыл бұрын
import "cv2" could not be resolved, all the imports show that problem, why?.... muchas gracias por compartir
@DigitalSreeni
@DigitalSreeni Жыл бұрын
Se if any of these solutions will work for you: stackoverflow.com/questions/66387881/import-cv2-could-not-be-resolved
@ajarivas72
@ajarivas72 Жыл бұрын
@@DigitalSreeni Hello Would you be so kind to tell me how to count the number of red rectangles in the bubble example? I am not very familiar with Python object arrays
@sbsyr5555
@sbsyr5555 3 жыл бұрын
Excellent explanation...Thank alot Sir,🙏
@ahmadwiqar8107
@ahmadwiqar8107 3 жыл бұрын
Thank you for such a usefull video. But sir i got just black image ? can kindly guide me
@riddhiraychaudhuri733
@riddhiraychaudhuri733 3 жыл бұрын
Hi Sreeni. Thanks for the great video. Just a query based on this, what is best way to modify this template matching technique to also detect the cases where the object of interest is not present at all?
@alejandrosola5885
@alejandrosola5885 Жыл бұрын
Thank you sir! You helped me with a project of my own! :)
@revitalizedclassics4941
@revitalizedclassics4941 4 жыл бұрын
Hello, thank you for your video! Using the example in the video, could template images, like the 'f16_template.jpg' image, be pasted into the bigger image whenever there is a good match? Thanks
@DigitalSreeni
@DigitalSreeni 4 жыл бұрын
Yes. Just replace the pixel values in original image with the values from template and export the array as an image. Please do remember that by doing this you are not processing images but modifying them and may not be acceptable for scientific research purposes.
@revitalizedclassics4941
@revitalizedclassics4941 4 жыл бұрын
@@DigitalSreeni Thanks for replying: I'm not 100% on the code yet but I'm glad to hear that it could work. Thanks
@gowithgaurav9617
@gowithgaurav9617 Жыл бұрын
Hello Sir. Really nice tutorial. I have a small query regarding template matching. Is it possible to match same images of different magnification? for ex. how to match 200x to 450x image.Your input will be really hepful. TIA
@DigitalSreeni
@DigitalSreeni Жыл бұрын
You need to use a scale-invariant feature detection and matching algorithm, such as SIFT (Scale-Invariant Feature Transform) or SURF (Speeded-Up Robust Features), which are designed to identify and match key points in an image that are invariant to scale changes. This video may help: kzbin.info/www/bejne/mXKbfGuaoZJ4bM0
@gowithgaurav9617
@gowithgaurav9617 Жыл бұрын
@@DigitalSreeni Thank you for response.i will follow up.
@gowithgaurav9617
@gowithgaurav9617 Жыл бұрын
@@DigitalSreeni hello as per your suggestion I watched the video of image registration but unfortunately it's not helping since I have images sort of mesh. It would be really nice if can make a tutorial regarding match images having different magnifications. TIA
@harshitkaushik4584
@harshitkaushik4584 4 жыл бұрын
Sir your videos are amazing. I needed one suggestion , actually i am interested in deep learning applications in medical domain or healthcare , so i have worked with COvid ct scans recently , now i need to move to an advanced stage , what other things i can work on which involve deep learning or machine learning techniques for medical and healthcare applications ?
@DigitalSreeni
@DigitalSreeni 4 жыл бұрын
Deep learning can be applied to almost any problem provided you have the training data. So the exact application depends on your need. For example, you can define a binary classification problem by sorting infected vs uninfected cases in your CT scans.
@worldtechnology5651
@worldtechnology5651 4 жыл бұрын
Thank you sir, can you please do more videos using scikit-image apply surf, hog.. for some cell images segmentation techniques.
@williamusuga4491
@williamusuga4491 4 жыл бұрын
Good night. Good night. It's possible to use the template matching to find objects in a grayscale image?. my original image is in gray scale
@DigitalSreeni
@DigitalSreeni 4 жыл бұрын
Yes, of course.
@sayalisalunkhe9199
@sayalisalunkhe9199 2 жыл бұрын
where do I get the image and template used in this code?
@jacobusstrydom7017
@jacobusstrydom7017 3 жыл бұрын
great video, check out the detecto python library (build on pytorch). Brilliant library to train and do object detection using a Resnet model.
@FanFanlanguageworld1707
@FanFanlanguageworld1707 3 жыл бұрын
Hi, is there a way to combine DL and template matching to do an object detection?
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
I never tried. I usually do not try to look at technology and wonder what I can do with it. I look at a problem and find out what technology addresses it in a very simple way.
@FanFanlanguageworld1707
@FanFanlanguageworld1707 3 жыл бұрын
@@DigitalSreeni Interesting point ;), the reason of this question is to find a localisation algo with 3D image. Only template matching itself seems can't do it
@quadriquadri1655
@quadriquadri1655 2 жыл бұрын
how can i do this in java without use of opencv
@srinivas_9964
@srinivas_9964 3 жыл бұрын
Hii sir, Is it possible to find the template matching using google vision api
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
I am sorry, I am not familiar with the Google vision API.
@nijain4061
@nijain4061 4 жыл бұрын
Can we draw contours using template matching technique ???
@DigitalSreeni
@DigitalSreeni 4 жыл бұрын
Not sure what you mean. We can draw a rectangle around the template image. If you mean drawing shape outline then this is not the process to do that.
@nijain4061
@nijain4061 4 жыл бұрын
@@DigitalSreeni what is that process for getting exact contour ?
@larakayed7352
@larakayed7352 4 жыл бұрын
Hello I have been watching your videos for a while, and would thank you alot for such information you are giving for us. I would ask you for a help, my graduation project is about image processing in the biomedical field, and I would do it on COVID 19, could you please do more videos about this topic, and if you think it is not a good topic, can you please advise me for a topic which can be beneficial for me.. Again I want to thank you alot for all the information you are supplying
@DigitalSreeni
@DigitalSreeni 4 жыл бұрын
I recommend working on real biomedical images such as neuron segmentation or cell segmentation and counting.
@HiTechTopTIPs
@HiTechTopTIPs 4 жыл бұрын
Thanks sir I have my 538 subscribers yet, I want to extend my channel subscribers, I have changed the morning microphone, I am now providing a complete demo of the code along with voice description. Now I need your kind suggestions about how further changes should be made thanks 👍
@AMoktar
@AMoktar Жыл бұрын
awesome thanks
@waniubaid7718
@waniubaid7718 Жыл бұрын
@harmindersinghnijjar
@harmindersinghnijjar 3 жыл бұрын
cv2.TM_SQDIFF = minimum value is the best fit Everything else = maximum value is the best fit
@DigitalSreeni
@DigitalSreeni 3 жыл бұрын
Thanks for the comment. Yes, when you are trying to match using square difference you want to minimize the difference.
@zenpanda-relaxationandmedi8678
@zenpanda-relaxationandmedi8678 Жыл бұрын
make a video doing this on a live game window
119 - Sub-pixel image registration in Python
6:03
DigitalSreeni
Рет қаралды 9 М.
OpenCV Python Tutorial #7 - Template Matching (Object Detection)
22:22
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 12 МЛН
Kluster Duo #настольныеигры #boardgames #игры #games #настолки #настольные_игры
00:47
Image Matching using Cross Correlation (Cyrill Stachniss, 2021)
53:07
Cyrill Stachniss
Рет қаралды 18 М.
Training a Cascade Classifier - OpenCV Object Detection in Games #8
32:29
Learn Code By Gaming
Рет қаралды 154 М.
Template Matching by Correlation | Image Processing I
7:01
First Principles of Computer Vision
Рет қаралды 49 М.
Object Tracking with Opencv and Python
30:03
Pysource
Рет қаралды 615 М.
30 - Image registration using homography in openCV
46:42
DigitalSreeni
Рет қаралды 36 М.
Why Does Diffusion Work Better than Auto-Regression?
20:18
Algorithmic Simplicity
Рет қаралды 340 М.
OpenCV Python Feature Matching
17:37
Kevin Wood | Robotics & AI
Рет қаралды 2,3 М.
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 12 МЛН