{"id":22326,"date":"2017-09-28T08:00:50","date_gmt":"2017-09-28T15:00:50","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=22326"},"modified":"2021-06-10T16:28:33","modified_gmt":"2021-06-10T23:28:33","slug":"design-contest-project-highlight","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/design-contest-project-highlight\/","title":{"rendered":"Design Contest Project Highlight: Part Two"},"content":{"rendered":"<p>Coming in strong on our list of cool projects made with our boards is another interesting project that uses the Zybo board:<\/p>\n<p>&#8220;An object tracking vision system using a moving camera implemented in a Zynq heterogeneous device&#8221;, by Marcin\u00a0Kowalczyk, from AGH University of Science and Technology in Krakow, Poland.<\/p>\n<p>Autonomous object tracking with use of a moving camera is used for examples in issues connected with security, surveillance or in military applications. This particular project involved creating a\u00a0video system demonstration for tracking objects, assuming that the camera is mounted on a moving stand.<\/p>\n<p>The system consists of:<\/p>\n<p>\u2013 Camera &#8211;\u00a0Xiaomi Yi Action YDXJ01XY sports camera<br \/>\n\u2013 Computing platform &#8211; the Digilent Zybo board<br \/>\n\u2013 Sensors &#8211; PmodNAV, PmodGYRO, PmodACL<br \/>\n\u2013 Bluetooth module &#8211; PmodBT2<br \/>\n\u2013 Servomechanisms<br \/>\n\u2013 Servo controller<br \/>\n\u2013 Power supply<br \/>\n\u2013 Pointer &#8211; laser pointer<\/p>\n<p>The output of tracking module is the basis for the positioning of moving stand. The aim of the positioning is to keep a tracked object in the center of frame and mark it with a pointer. Below are the modules of the project can be visualized by the connection between them.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-22328\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTracking-600x415.png\" alt=\"\" width=\"600\" height=\"415\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTracking-600x415.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTracking-768x532.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTracking-1024x709.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTracking-800x554.png 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTracking.png 1062w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>Object tracking &#8211; This contains elements responsible for receiving and decoding data from camera. Except<br \/>\nthat it contains tracking algorithm. Outputs of this module are properly delayed input signals,<br \/>\ntracked object coordinates and signal indicating end of frame processing.<\/li>\n<li>Object marking &#8211; The marks received coordinates in frame. It may be marked with two perpendicular<br \/>\nlines or rectangle.<\/li>\n<li>Visualization &#8211; This is responsible for coding data from RGB form and synchronization signals to VGA<br \/>\nform and sending it to output.<\/li>\n<li>Center coordinates to angles &#8211; converts the input coordinates to the error of pan and tilt angles.<\/li>\n<li>Kalman filter &#8211; This receives data from sensors (accelerometer, magnetometer and gyroscope) and calculates<br \/>\nposition using sensory fusion.<\/li>\n<li>Regulator &#8211; Based on any angle errors received on input it calculates a new set of positions for servomechanisms,<br \/>\nconverts it to pulse widths and passes them to output.<\/li>\n<li>Communication &#8211; This is responsible for receiving commands and data from PC and sending appropriate signals<br \/>\nto the servo controller. If autonomous mode is enabled, received pulse width from regulator is passed<br \/>\nto controller.<\/li>\n<\/ul>\n<p>It was decided by the team \u00a0to use Xiaomi Yi Action YDXJ01XY sports camera<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-22329\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingcamera.png\" alt=\"\" width=\"291\" height=\"221\" \/><strong>Communication<\/strong>: it was implemented between all elements of the system. It can be divided into PC-Zynq part and Zynq-servo controller \u2019Maestro\u2019.<\/p>\n<ol>\n<li>PC &#8211; ZYNQ &#8211; via bluetooth<\/li>\n<li>ZYNQ &#8211; Maestro &#8211;\u00a0via UART interface which was imposed, because it is the only protocol supported by Maestro.<br \/>\nSuitable pins (MIO 14 and 15) of ZYBO\u2019s MIO PMOD connector were connected to Maestro pins<br \/>\nresponsible for serial communication. Then pins were connected to another processor\u2019s peripheral for<br \/>\nserial communication &#8211; UART0<\/li>\n<\/ol>\n<p><strong>Regulator:<\/strong><\/p>\n<p>In the designed system, camera is a sensor of regulation error. Regulator was created for system without<br \/>\nsensors of moving stand position, thus control algorithm is currently based only on data from camera. For constructing a model, simulations were performed in MATLAB and Simulink, below is the block diagram of the servomechanism:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-22402\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingServo-600x151.png\" alt=\"\" width=\"600\" height=\"151\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingServo-600x151.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingServo-768x193.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingServo.png 783w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>and the block diagram of entire system:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-22403\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingServo1-600x78.png\" alt=\"\" width=\"600\" height=\"78\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingServo1-600x78.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingServo1-768x99.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingServo1-1024x133.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingServo1-800x104.png 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingServo1.png 1391w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><strong>Image processing:<\/strong><\/p>\n<ol>\n<li>Tracking by detection algorithm, output can be seen:<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-22404\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingTD-600x449.png\" alt=\"\" width=\"600\" height=\"449\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingTD-600x449.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingTD.png 701w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>2. Mean Shift algorithm:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-22405\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingMS-600x336.png\" alt=\"\" width=\"600\" height=\"336\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingMS-600x336.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingMS-768x430.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingMS-800x448.png 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingMS.png 890w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Calibration of the sensors was needed in order to obtain proper results, and their integration and fusion as well.<\/p>\n<p>Conclusions:<\/p>\n<p>\u2013 Parallel realization of algorithm (hardware implementation) requires a lot more work than software<br \/>\nimplementation (in processor).<br \/>\n\u2013 Mean-shift algorithm has good effects, when tracked object\u2019s color is much different from the<br \/>\nbackground\u2019s (if H component of HSV color space is used).<br \/>\n\u2013 Tracking by detection algorithm usually gives correct coordinates of object, but it does not use<br \/>\ninformation from previous frame. In result, there are possible situations, when in two consecutive<br \/>\nframes object is detected in other sides of image (e.g. in result of noises), what may result in<br \/>\nmechanical damage, related to sharp movement of servomechanisms.<br \/>\n\u2013 Selection of proper regulator and it\u2019s parameters is much easier based on mathematical model of<br \/>\ncontrolled system.<br \/>\n\u2013 Mathematical model does not have to perfectly reproduce operation of the real system. Effects<br \/>\nsuch as very short delays may be neglected.<br \/>\n\u2013 Breakdown of project into independent modules greatly simplifies work.<\/p>\n<p>\u2013 Testing each module separately, after realization, makes it easier to connect them into a complete<br \/>\nsystem.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-22408\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/DDC-76-600x399.jpg\" alt=\"\" width=\"600\" height=\"399\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/DDC-76-600x399.jpg 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/DDC-76-768x510.jpg 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/DDC-76-1024x680.jpg 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/DDC-76-800x532.jpg 800w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-22407\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/DDC-77-600x399.jpg\" alt=\"\" width=\"600\" height=\"399\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/DDC-77-600x399.jpg 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/DDC-77-768x510.jpg 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/DDC-77-1024x680.jpg 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/DDC-77-800x532.jpg 800w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-22406\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/Portrait-451x600.jpg\" alt=\"\" width=\"451\" height=\"600\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/Portrait-451x600.jpg 451w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/Portrait-768x1022.jpg 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/Portrait-770x1024.jpg 770w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/Portrait.jpg 772w\" sizes=\"auto, (max-width: 451px) 100vw, 451px\" \/><\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-22326 jlk' data-task='like' data-post_id='22326' data-nonce='a7290e5e40' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-22326 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-22326 jlk' data-task='unlike' data-post_id='22326' data-nonce='a7290e5e40' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-22326 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-22326 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>What can you do with a Zybo board?<\/p>\n","protected":false},"author":19,"featured_media":22329,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[1662],"ppma_author":[4498],"class_list":["post-22326","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-events","tag-fpga"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2017\/09\/ObjTrackingcamera.png","jetpack_sharing_enabled":true,"authors":[{"term_id":4498,"user_id":19,"is_guest":0,"slug":"monicai","display_name":"Monica Ignat","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/14ed7afe56fad6ee0e382429a49d15df2b51de30ce26fa87b756b19e8bdb2215?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/22326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=22326"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/22326\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/22329"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=22326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=22326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=22326"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=22326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}