Azzera filtri
Azzera filtri

Converting Blob from an sqlite file to image

9 visualizzazioni (ultimi 30 giorni)
Maria Jeseca Baculo
Maria Jeseca Baculo il 16 Gen 2023
Risposto: Dhaniklal il 16 Gen 2023
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?

Risposte (1)

Dhaniklal
Dhaniklal il 16 Gen 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

Categorie

Scopri di più su Convert Image Type in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by