Image identification and acquisition
2 views (last 30 days)
Show older comments
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 Comment
Aarti Dwivedi
on 26 Jul 2018
Please format the code properly, and use the {}Code option for greater ease of reading.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!