Info

此问题已关闭。 请重新打开它进行编辑或回答。

My project is extracting text from image i try below code i can't get clear output, please help me to solve my problem

1 次查看(过去 30 天)
clc; clear all; close all; fontSize = 20; a=imread('C:\Users\shankar\Documents\MATLAB\code\T2.jpg'); figure(1),imshow(a),title('original image', 'FontSize', fontSize), b=rgb2gray(a); figure(2),imshow(b),title('GRAY image', 'FontSize', fontSize),
H=fspecial('laplacian'); b2=imfilter(b,H); figure(3),imshow(b2),title('FILTER image', 'FontSize', fontSize), whos b whos b2 %% thresholding %B1=255*(b2>=200); %figure(4),imshow(B1),title('FILTER image', 'FontSize', fontSize), %% MEDIAN B=medfilt2(b2); figure(4),imshow(B); title('edge detect image');
figure(5) imshow(~B);title('Edge detected Image'); [pan leb]=size(b);
BW2 = bwareaopen(B, 50,6); figure(6);imagesc(BW2);
[m n]=size(b2); squaredErrorImage = (double(b) - double(B)) .^ 2; mse = sum(sum(squaredErrorImage)) /((m * n)); RMSE = sqrt(mse); PSNR = 10 * log10( 256^2 / mse); mad = mean2(abs(double(b)-double(B))); message = sprintf('The mean square error is %.2f.\nThe PSNR = %.2f.\n THE RMSE=%.2f.\n THE mad=%.2f',mse, PSNR,RMSE,mad); msgbox(message);
input:
output:

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by