Clear Filters
Clear Filters

Converting Blob from an sqlite file to image

9 views (last 30 days)
The dataset that I am working on is saved as an sqlite file, when I fetch it in matlab, the value becomes a 1 dimensional uint8 data, how will I convert this to an RGB or Grayscale image?

Answers (1)

Dhaniklal
Dhaniklal on 16 Jan 2023
I understand that you are trying to convert a blob from an sqlite database file to an image and you have managed to get the data from sqlite database file into a matlab single dimensional array of uint8. You can reshape the array using reshape function.
Example:
sampleArr = [1, 2, 3, 4, 5];
img = reshape(sampleArr, row, size, channels); % rows*cols must be equal to size of sampleArr
I am assuming that you know the size of the RGB image (height x width x 3) you want and possibly a single image.
For more information on reshape function please follow below link:
Thanks,
Dhaniklal

Categories

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!