This is the Python program that I need to write following precisely the directions I wrote this program which is how I am suppose to write it but I am having some problems getting the output I need. import math import stdio import sys from blob_finder import BlobFinder from picture import Picture # Entry point def main(): pixels = int(sys.argv[1]) tau = float(sys.argv[2]) delta = float(sys.argv[3]) frames = (sys.argv[4]) bf = BlobFinder(Picture(frames[0], tau)) prevBeads = bf.getBeads(pixels) for i in range(1, len(frames)): bf = BlobFinder(Picture(frames[i], tau)) currBeads = bf.getBeads(pixels) for currBead in currBeads: closest = math.inf for prevBead in prevBeads: r = currBead.distanceTo(prevBead) if r <= delta and r < closest: closest = r if closest != math.inf: stdio.writef('%4f\n', closest) prevBeads = currBeads stdio.writeln() if __name__ == '__main__': main() Or OI am doing something wrong or I am missing something but this is how I am suppose to write the program no format or anything simple following directions the output I get is: $ python3 bead_tracker.py 25 180.0 data/run_1/frame00000.jpg data/run_1/frame00001.jpg Traceback (most recent call last): File "bead_tracker.py", line 33, in main() File "bead_tracker.py", line 12, in main delta = float(sys.argv[3]) ValueError: could not convert string to float: 'data/run_1/frame00000.jpg' (wrong output) The output I should get is this: $ python3 bead_tracker . py 25 180.0 25.0 data / run_1 / frame00000 . jpg data / run_1 / frame00001 . jpg 7.1833 4.7932 2.1693 5.5287 5.4292 4.3962 P L E A S E help me figure where I did wrong

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

This is the Python program that I need to write following precisely the directions

I wrote this program which is how I am suppose to write it but I am having some problems getting the output I need.

 

import math
import stdio
import sys
from blob_finder import BlobFinder
from picture import Picture


# Entry point
def main():
   pixels = int(sys.argv[1])
   tau = float(sys.argv[2])
   delta = float(sys.argv[3])

   frames = (sys.argv[4])
   bf = BlobFinder(Picture(frames[0], tau))
   prevBeads = bf.getBeads(pixels)
   for i in range(1, len(frames)):
       bf = BlobFinder(Picture(frames[i], tau))
       currBeads = bf.getBeads(pixels)
       for currBead in currBeads:
           closest = math.inf
           for prevBead in prevBeads:
               r = currBead.distanceTo(prevBead)
               if r <= delta and r < closest:
                   closest = r
                   if closest != math.inf:
                       stdio.writef('%4f\n', closest)
                       prevBeads = currBeads
                       stdio.writeln()


if __name__ == '__main__':
   main()
 

 

Or OI am doing something wrong or I am missing something but this is how I am suppose to write the program no format or anything simple following directions

the output I get is:

 

$ python3 bead_tracker.py 25 180.0 data/run_1/frame00000.jpg data/run_1/frame00001.jpg
Traceback (most recent call last):
 File "bead_tracker.py", line 33, in <module>
   main()
 File "bead_tracker.py", line 12, in main
   delta = float(sys.argv[3])
ValueError: could not convert string to float: 'data/run_1/frame00000.jpg'
(wrong output)

 

The output I should get is this:

 

$ python3 bead_tracker . py 25 180.0 25.0 data / run_1 / frame00000 . jpg data / run_1 / frame00001 . jpg 

7.1833 

4.7932 

2.1693 

5.5287 

5.4292 

4.3962

 

P L E A S E help me figure where I did wrong

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY