19-02-2015, 01:15 PM
Need help. Have started coding. Here's what i have written.
Need to make database and connect it to a gui too further.
How can I store my cropped images into any database? does Matlab have an internal db management option?
clc
clear all
close all
%
% Input sample image
%
test = imread('test5.jpg');
imshow(test);
test = imresize(test,[400,600]);
%
% Convert to Grayscale (thresholding)
%
testGrayed = rgb2gray(test);
imshow(testGrayed);
%
% Convert to BW (binarization)
%
testBnW = im2bw(testGrayed,graythresh(testGrayed));
imshow(testBnW);
%
% Gathering edges of text
%
testedge = edge(uint8(testBnW));
imshow(testedge);
%
% Image Dilation
%
se = strel('disk',2);
testedge2 = imdilate(testedge, se);
imshow(testedge2);
%
% Image Filling
%
testfill= imfill(testedge2,'holes');
imshow(testfill);
%
% Blobs analysis
% This cell of codes find all the objects on the image, and find the properties of each object.
%
[L, num] = bwlabel(testfill);
disp(num);
Iprops = regionprops(L);
Ibox = [Iprops.BoundingBox];
M2 = reshape(Ibox,[4 num]);
M3 = M2';
imshow(test);
% Plot the Object Location
% This cell of codes plot the object locations.
%
hold off;
for cnt = 1:num
rectangle('position',M2(:,cnt),'edgecolor','r');
end
% cropping individual characters and resizing to 50x70 pixels
for cnt = 1:num
i2 = imcrop(testfill,M2(:,cnt));
i3 = imresize(i2, [50,70]);
figure(cnt)
imshow(i3);
endjenson.junkie[at]gmail.com" class="mycode_email
Need to make database and connect it to a gui too further.
How can I store my cropped images into any database? does Matlab have an internal db management option?
clc
clear all
close all
%
% Input sample image
%
test = imread('test5.jpg');
imshow(test);
test = imresize(test,[400,600]);
%
% Convert to Grayscale (thresholding)
%
testGrayed = rgb2gray(test);
imshow(testGrayed);
%
% Convert to BW (binarization)
%
testBnW = im2bw(testGrayed,graythresh(testGrayed));
imshow(testBnW);
%
% Gathering edges of text
%
testedge = edge(uint8(testBnW));
imshow(testedge);
%
% Image Dilation
%
se = strel('disk',2);
testedge2 = imdilate(testedge, se);
imshow(testedge2);
%
% Image Filling
%
testfill= imfill(testedge2,'holes');
imshow(testfill);
%
% Blobs analysis
% This cell of codes find all the objects on the image, and find the properties of each object.
%
[L, num] = bwlabel(testfill);
disp(num);
Iprops = regionprops(L);
Ibox = [Iprops.BoundingBox];
M2 = reshape(Ibox,[4 num]);
M3 = M2';
imshow(test);
% Plot the Object Location
% This cell of codes plot the object locations.
%
hold off;
for cnt = 1:num
rectangle('position',M2(:,cnt),'edgecolor','r');
end
% cropping individual characters and resizing to 50x70 pixels
for cnt = 1:num
i2 = imcrop(testfill,M2(:,cnt));
i3 = imresize(i2, [50,70]);
figure(cnt)
imshow(i3);
endjenson.junkie[at]gmail.com" class="mycode_email
Quote:Oi..!