{"id":1363,"date":"2021-12-14T21:02:18","date_gmt":"2021-12-14T21:02:18","guid":{"rendered":"https:\/\/salarydistribution.com\/machine-learning\/2021\/12\/14\/object-tracking-in-video-with-opencv-and-deep-learning\/"},"modified":"2021-12-14T21:02:18","modified_gmt":"2021-12-14T21:02:18","slug":"object-tracking-in-video-with-opencv-and-deep-learning","status":"publish","type":"post","link":"https:\/\/salarydistribution.com\/machine-learning\/2021\/12\/14\/object-tracking-in-video-with-opencv-and-deep-learning\/","title":{"rendered":"Object tracking in video with OpenCV and Deep Learning"},"content":{"rendered":"<div id=\"\">\n            <!-- begin main body content --><\/p>\n<p><strong>This code pattern is part of the <a href=\"\/series\/learning-path-powerai-vision\">Getting started with IBM Maximo Visual Inspection<\/a> learning path<\/strong>.<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>Whether you are counting cars on a road or products on a conveyor belt, there are many use cases for computer vision with video. With video as input, you can use automatic labeling to create a better classifier with less manual effort. This code pattern shows you how to create and use a classifier to identify objects in motion and then track and count the objects as they enter designated regions of interest.<\/p>\n<h2 id=\"description\">Description<\/h2>\n<p>Whether it is car traffic, people traffic, or products on a conveyer belt, there are many applications for keeping track of potential customers, actual customers, products, or other assets. With video cameras everywhere, a business can get useful information from them with some computer vision. Applying this technology to videos is much more practical than older methods (for example, using special hardware or a person counting vehicle traffic).<\/p>\n<p>This code pattern explains how to create a video car counter using the IBM Maximo Visual Inspection Video Data Platform, OpenCV, and a Jupyter Notebook. You\u2019ll use a little manual labeling and a lot of automatic labeling to train an object classifier to recognize cars on a highway. You\u2019ll load another car video into a Jupyter Notebook where you\u2019ll process the individual frames and annotate the video.<\/p>\n<p>You\u2019ll use the deployed model for inference to detect cars on a sample of the frames at a regular interval, and you\u2019ll use OpenCV to track the cars from frame to frame in between inference. In addition to counting the cars as they are detected, you\u2019ll also count them as they cross a \u201cfinish line\u201d for each lane and show cars per second.<\/p>\n<p>When you\u2019ve completed this code pattern, you will understand how to:<\/p>\n<ul>\n<li>Use automatic labeling to create an object detection classifier from a video<\/li>\n<li>Process frames of a video using a Jupyter Notebook, OpenCV, and IBM Maximo Visual Inspection<\/li>\n<li>Detect objects in video frames with IBM Maximo Visual Inspection<\/li>\n<li>Track objects from frame to frame with OpenCV<\/li>\n<li>Count objects in motion as they enter a region of interest<\/li>\n<li>Annotate a video with bounding boxes, labels, and statistics<\/li>\n<\/ul>\n<h2 id=\"flow\">Flow<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/developer.ibm.com\/developer\/default\/patterns\/detect-track-and-count-cars-in-a-video\/images\/architecture-cars1.png\" alt=\"object detection\"><\/p>\n<ol>\n<li>Upload a video using the IBM Maximo Visual Inspection web UI.<\/li>\n<li>Use automatic labeling and train a model.<\/li>\n<li>Deploy the model to create an IBM Maximo Visual Inspection inference API.<\/li>\n<li>Use a Jupyter Notebook to detect, track, and count cars in a video.<\/li>\n<\/ol>\n<h2 id=\"instructions\">Instructions<\/h2>\n<p>Find the detailed steps for this pattern in the <a href=\"https:\/\/github.com\/IBM\/powerai-counting-cars\/blob\/master\/README.md\">README<\/a>. The steps will show you how to:<\/p>\n<ol>\n<li>Create a data set in Video Data Platform.<\/li>\n<li>Train and deploy the model.<\/li>\n<li>Automatically label objects.<\/li>\n<li>Run the notebook.<\/li>\n<li>Create the annotated video.<\/li>\n<\/ol>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>This code pattern showed how to create and use a classifier to identify objects in motion and then track and count the objects as they enter designated regions of interest. The code pattern is part of the <a href=\"\/series\/learning-path-powerai-vision\">Getting started with IBM Maximo Visual Inspection<\/a> learning path. To continue the series and learn about more IBM Maximo Visual Inspection features, look at the next code pattern, <a href=\"\/patterns\/validate-deep-learning-models\/\">Validate deep learning models<\/a>.<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/developer.ibm.com\/patterns\/detect-track-and-count-cars-in-a-video\/<\/p>\n","protected":false},"author":0,"featured_media":1364,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/1363"}],"collection":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/comments?post=1363"}],"version-history":[{"count":0,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/1363\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media\/1364"}],"wp:attachment":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media?parent=1363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/categories?post=1363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/tags?post=1363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}