how to use the retrieved blob data from MySQL and reconstruct it to its original image form?

7 views (last 30 days)
Hi everyone! I'm building my school project wherein the main functionality is to store the image in MySQL. In my case, i only get the matrix value of an image (as what I've read other developers was recommending) to be stored in a blob type column. Currently, i have this following code that functioning well
% code
F='F0001';
colnames = {'F_ID','Matrix'};
data = {F img_temp};
tablename = 'Images';
%datainsert(conn,tablename,colnames,data)
the code above allows me to save an mxn matrix. Now i use the following code to retrieve the data under Matrix column:
% code
curs = exec(conn,'select Matrix from fingeprints where F_ID=''F0001''');
curs = fetch(curs);
curs.Data
What my problem is, the value I get back is a completely stranger to me!!! -> [11x1 int8]. Does anybody know how can I get back the original matrix value I inserted in the database so I display it as an image?
% code
imshow(curs.Data) is not working though. :(
Thanks a lot in advance folks, i hope you could help me solving this one. Have a good day! :D

Answers (1)

Image Analyst
Image Analyst on 29 Nov 2014
What does it show when you do this:
curs
whos curs.Data
  8 Comments
Image Analyst
Image Analyst on 24 Jan 2018
clarens, it doesn't sound like you have a database question but merely a question as to how to convert your in8 data to an image. What form is it in now? Is it a 2-D array of numbers? If so, it's already an image and you can view it simply by doing:
imshow(yourImage, []);

Sign in to comment.

Tags

Products

Community Treasure Hunt

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

Start Hunting!