0

I have a problem where I have to track and then draw the map of the moving object. I have done the tracking part but now I am stuck on how to map the moving object where I have to draw the trajectory of that moving object on Opencv? Can you please help me?

wohlstad
  • 12,661
  • 10
  • 26
  • 39
  • 1
    You can use `cv::line` to draw a line over a `cv::Mat` (opencv class used for images). There are other drawing functions as well. See: https://docs.opencv.org/3.4/d6/d6e/group__imgproc__draw.html. – wohlstad Jul 09 '22 at 13:10
  • Thank you very much for your comment. But I think it is with C++, I am doing it with py. Is there any example that is done with py where the implementation is shown? – Nuray Eminov Jul 09 '22 at 13:42
  • See examples of using opencv drawing function in python: https://stackoverflow.com/questions/18632276/how-to-draw-a-line-on-an-image-in-opencv. – wohlstad Jul 09 '22 at 13:46
  • @wohlstad Thank you very much! I wish you an amazing day! – Nuray Eminov Jul 09 '22 at 13:52
  • I have gotten to the point where I can perform this: ''' importing cv2 import cv2 path = r'test.jpeg' image = cv2.imread(path) window_name = 'Image' start_point = (0, 0) end_point = (250, 250) color = (0, 255, 0) thickness = 9 image = cv2.line(image, start_point, end_point, color, thickness) cv2.imshow(window_name, image) cv2.waitKey() ''' But I cannot see the simulation. Do you know how can I see it? – Nuray Eminov Jul 10 '22 at 11:08

0 Answers0