Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
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 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154699/image.jpeg)
output:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154701/image.jpeg)
1 Commento
Risposte (0)
Questa domanda è chiusa.
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!