Converting Blob from an sqlite file to image

9 次查看(过去 30 天)
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?

回答(1 个)

Dhaniklal
Dhaniklal 2023-1-16
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

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by