How to have MATLAB provide picture output from a typed sentence
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Rik
2022-6-13
If you are fine with a 'dumb' system, you could create a lookup table that matches phrases and loads the corresponding image.
回答(2 个)
Pratheek
2023-9-22
编辑:Pratheek
2023-9-22
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 个评论
Image Analyst
2023-9-22
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!