1 / 9

Taking Pictures

Taking Pictures. Sec 9-9 Web Design. Objectives. The student will: Know how command the scribbler robot to take a picture. Know how to display the picture taken by the robot Know how to save a picture or pictures. Taking a Picture. The command to take a picture in Myro is:

tiva
Télécharger la présentation

Taking Pictures

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Taking Pictures Sec 9-9 Web Design

  2. Objectives The student will: • Know how command the scribbler robot to take a picture. • Know how to display the picture taken by the robot • Know how to save a picture or pictures.

  3. Taking a Picture • The command to take a picture in Myro is: takePicture("color") • Simply issuing the command does nothing but instruct the robot to take a picture. • The picture is not saved • The picture is not displayed • To take and display a picture at the same time you can: show(takePicture ("color"))

  4. Storing a Picture in a Variable • A picture can be stored in a variable. pic = takePicture("color") • Once stored the picture can be displayed over and over again: show(pic) • This command will display the same picture every time.

  5. Saving a Picture in a File • Myro has a command to save pictures in a file. savePicture(pic,"my_picture.jpg")

  6. Taking a Series of Pictures • Your robot can be programmed to scan its environment and display what it sees: while timeRemaining(40): show(takePicture("color")) turnLeft(0.5,.1)

  7. Animated Gifs • You can also save an animated GIF of the images generated by the robot by using the savePicture command by accumulating a series of images in a list. Pics = [] while timeRemaining(40): pic=takePicture("color") show(pic) Pics.append(pic) turnLeft(0.5,.1) savePicture(Pics, "room_movie.gif")

  8. Summary • The command to take a picture in Myro is: takePicture("color") • Pictures can be stored or saved. • The robot can programmed to “scan” its environment.

  9. Rest of Today • Write a function to have your robot scan the room and take pictures. • Work with the settings on the turn command so that the pictures only overlap slightly (less than ¼ of the picture should overlap) • Show me the results • Save this in a python file. This is the beginning of your final project!

More Related