Posts

Showing posts from February, 2017

Ads

GLCM Image features extraction using glcmcomatrix.

Image
GLCM based image features extraction using glcmcomatrix. in Main.m script call glcm_features1.m file to extract the features of images. Main.m clear all; I=imread('C:\Users\Admin\Desktop\Code\index.jpg'); imshow(I); i=rgb2gray(I); imshow(i); circuitboard=rot90(rgb2gray(imread('C:\Users\Admin\Desktop\Code\index.jpg'))); imshow(circuitboard); offsets = [0 1; -1 1;-1 0;-1 -1]; glcm = graycomatrix(circuitboard,'offset',offsets); stats = GLCM_Features1(glcm,0) % stats = GLCMFeatures(glcm); %figure, plot([stats.Correlation]); %figure, plot([stats.Contrast]); %figure, plot([stats.Homogeneity]); %figure, plot([stats.Energy]); %title('Texture Correlation as a function of offset'); %xlabel('Horizontal Offset') %ylabel('Correlation') %[glcm, SI] = graycomatrix(I,'NumLevels',9,'GrayLimits',[]) %GLCMFeatures(glcm); %glcm = [0 1 2 3;1 1 2 3;1 0 2 0;0 0 0 3]; %stats = graycoprops(glcm); -------------...
Image
Arabic text extraction from images using OCR. I used Matlab 2016 for this. Sampe.m colorImage = imread('easy-1.jpg'); I = rgb2gray(colorImage); % Detect MSER regions. [mserRegions, mserConnComp] = detectMSERFeatures(I,'RegionAreaRange',[200 8000],'ThresholdDelta',4); figure imshow(I) hold on plot(mserRegions, 'showPixelList', true,'showEllipses',false) title('MSER regions') hold off % Use regionprops to measure MSER properties mserStats = regionprops(mserConnComp, 'BoundingBox', 'Eccentricity','Solidity', 'Extent', 'Euler', 'Image'); % Compute the aspect ratio using bounding box data. bbox = vertcat(mserStats.BoundingBox); w = bbox(:,3); h = bbox(:,4); aspectRatio = w./h; % Threshold the data to determine which regions to remove. These thresholds % may need to be tuned for other images. filterIdx = aspectRatio' > 3; filterIdx = filterIdx | [mserStats.E...