Image identification and acquisition

5 vues (au cours des 30 derniers jours)
mohamed  al-asklany
mohamed al-asklany le 25 Juil 2018
i have 5 MP camera system with usb dvr has resolution 708*528 and i have 1 meter *1 meter red panel has character ,distance between camera and panel 60 meters when i captured the image of panel the panel can not seen character clearly so i can not detect it how can i solve this problem to detect and i identify it and this is my code
clear all; %%clear all privious variables
clc;
warning('off','all'); %.... diable warining msg ...;
vid = videoinput('winvideo',1);
set(vid, 'FramesPerTrigger', Inf);
set(vid, 'ReturnedColorspace', 'rgb');
%vid.FrameRate =30;
vid.FrameGrabInterval = 1; % distance between captured frames
start(vid)
imgData=getsnapshot(vid);
% w=imgData(:,:,1)-rgb2gray(imgData);
% I=imbinarize(w);
% I = bwareaopen(imgData,100);
I = bwlabel(imgData, 4);
stats = regionprops(I, 'BoundingBox', 'Centroid');
imshow(I)
figure
imshow(I);
hold on
for object = 1:length(stats)
bb = stats(object).BoundingBox;
bc = stats(object).Centroid;
rectangle('Position',bb,'EdgeColor','r','LineWidth',2)
plot(bc(1),bc(2), '-m+')
a=text(bc(1)+15,bc(2), strcat('X: ', num2str(round(bc(1))), ' Y: ', num2str(round(bc(2)))));
set(a, 'FontName', 'Arial', 'FontWeight', 'bold', 'FontSize', 12, 'Color', 'yellow');
end
hold off
word=ocr(I);
stop(vid);
  1 commentaire
Aarti Dwivedi
Aarti Dwivedi le 26 Juil 2018
Please format the code properly, and use the {}Code option for greater ease of reading.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by