How to have MATLAB provide picture output from a typed sentence
1 view (last 30 days)
Show older comments
Hello all,
I would like to create a program which will provide me with pictures based on a sentence/word/phrase that I type in before running the code. If I have a data set of sign language/hand gesture images, how can I create a code to display pictures to interpret the words/letters that I type into the code?
Thank you.
1 Comment
Rik
on 13 Jun 2022
If you are fine with a 'dumb' system, you could create a lookup table that matches phrases and loads the corresponding image.
Answers (2)
Pratheek
on 22 Sep 2023
Edited: Pratheek
on 22 Sep 2023
Hello Denise,
I understand you want to create a program in MATLAB that displays pictures based on a sentence/word/phrase you type in, using a dataset of sign language/hand gesture images, you can follow these steps:
- Load the dataset: Write code to load the dataset into your MATLAB program. This involves reading the images and their corresponding labels or filenames. You can use functions like imread to read the images and store them in an appropriate data structure, such as a cell array or structure array.
- Input the word/phrase: Use the input function to prompt the user to enter the word/phrase they want to interpret. Store the input in a variable.
- Find the corresponding image(s): Search your dataset for images that match the input word/phrase. You can iterate through the dataset and compare the labels or filenames with the input. Store the matching images in a separate data structure, such as a cell array or structure array.
- Display the image(s): Use the imshow function to display the image(s) that correspond to the input word/phrase. You can loop through the matching images and display them one by one using a loop. Alternatively, you can randomly select an image from the matching set to display.
Hope this will help you!
0 Comments
Image Analyst
on 22 Sep 2023
Use a dictionary to find the image file name corresponding to the word. For example the word "speak" might correspond to the "speak.png" image file. Then use imread to read that image, and imshow to display it.
help dictionary
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!