Robot Not a Dev? Pre-order Now
Not a Dev?

Misty Community Forum

Image resize when display?

I was developing Python package to turn Misty into a conversation chatbot. In the process I noticed that a photo cannot be resized when displaying on the robot.

Right now, Misty takes photos at a fixed hight/width ratio. When I call TakePicture function, it only accept the smaller value in Width or Hight, not both. If I set height to 272px, the photo taken this way will only display on the right half of the robot’s display. If instead I set width to 480px, only the top of the photo displays.

Dan
Palo Alto City Library

Perhaps somewhat related:

Thank you @fishbb for reporting this.

  1. Did you want to resize the photo you took or just display it on the robot?
  2. Did you want to crop it or change the aspect ratio?

Thanks for the quick response!
I think I want to be able to crop or change the aspect ratio for images when displaying it on the robot.

Thank you for reporting this and thank you for your patience here. I investigated this and I think there’s a couple of changes we can make with the API to make it easier for you.

A couple of question I have:

  1. Since the width and height are optional should we resize the image to the correct resolution of the display when DisplayOnScreen=true? This means you would not need to “guess” the right resolution.

  2. Should we change the aspect ratio of the width and height to the setting you provide? Right now we if you supply disproportionate values for Width and Height , the system uses the proportionately smaller of the two values to resize the image. If we change the aspect ratio this means the image would likely be distorted. This would also mean we would not crop it.

@Ben @Woo Thank you for the response! Sorry I did not spell out what I need clearly enough. After talking to Justin on the phone, what I really want is a smaller thumbnail comes with each high quality photo Misty takes.

I would like Misty to take a high quality image when it takes photos since it has a 4K camera, and I will save the original photo to my computer for future use. But when Misty displays the photo on its LED display, I would like it to use a smaller version of the same photo that fits the display’s dimension of a max height of 272px.

Right now, the take photo API works fine, but if I ask it to take a really huge photo, it will only display a tiny corner on its display.

Let me know if my explanation makes sense.

@fishbb assuming that you are going to download the full size photograph anyway, one solution that does not require changes to Misty firmware is

  1. download the full size image (as you are already planning),
  2. resize the image using Pillow,
  3. upload the smaller image to Misty and display it.
1 Like

@slivingston Thank you for the suggestion. I was considering doing that but thought it would be nice if this is a built-in feature. Right now, the taking photo PAI call already takes some time, and it will takes extra time to resize and upload image to Misty to display. But I agree this is a quick fix without Misty firmware update and I will implement it. Tks!