How Import image from MS SQL?
2 次查看(过去 30 天)
显示 更早的评论
In stock:
1. MS SQL Database
2. Table of images Images
3. Running BigBase ODBC connection ('Microsoft SQL Server' driver '13 .00.1601 ')
4. Code reading photos using MatLab:
clear all;
close all;
cd 'D:\NEWDoc\MATLAB';
% Make connection to database. Note that the password has been omitted.
% Using ODBC driver.
conn = database ('BigBase', 'user', 'pass');
% Read data from database.
st = 'select top 10 RecID, Image from images';
data = fetch (conn, st);
5. The results:
RecID Image
6143047 5999x1 uint8
224233 8000x1 uint8
4200382 6130x1 uint8
13687913 8000x1 uint8
2212046 8000x1 uint8
8346866 6400x1 uint8
1305479 6760x1 uint8
7806085 6641x1 uint8
6851834 7164x1 uint8
7084710 6550x1 uint8
As you can see, some fields, when imported, are cropped to 8000x1 uint8 it turns out that when importing, large images are lost.
Why? How to fix it?
Additional Information:
In the database, the field Image type - (blob)
5 个评论
Kojiro Saito
2018-12-26
What is the data type of Image column? Are you using varbinary or varbinary(MAX)?
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Database Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

