Home Community Blog Buy Now
Blog

Misty Community Forum

Getting an image from Misty using javascript

Hello to everybody,
I am trying to extract an image taken by the RGB camera. I am programming in Javascript so I am working with the function misty.GetImage(“imagename”) but as output of this function I see in console the image in base64. the problem is that this result seems to be not complete and in fact if I extract these values and put them into a base64 converter this not give me an image.
have you some idea on how I can solve this problem? or do you know another way to extract and visualize the image working with javascript?
Thanks in advance.

Can you be more precise about your application?

If you want to download images from the robot that you captured by misty.TakePicture(), then you can create an offboard program that calls GET /api/images.

You can also go to the Misty Command Center after executing the skill code, and find the image that you saved in the dropdown menu in the “Expression” section.

https://docs.mistyrobotics.com/misty-ii/javascript-sdk/api-reference/#misty-getimage

Especially note this part:

Yes. I capture the image using _TakePicture() and I want to display it as an image and not as an array in base64 (that is the result obtained using the callback function Get). I used this Misty Docs | API Reference
but if I change the value of “bool base64=false” it does not give me an image, but the function skips this value putting false into "string callbackRule " argument. For the moment I decide to create an offboard program that calls GET /api/images as you suggested. I have another question… do you know if there is a way to display the depth image?

thank you so much for your availability.