Image identification and acquisition
조회 수: 2 (최근 30일)
이전 댓글 표시
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
Aarti Dwivedi
2018년 7월 26일
Please format the code properly, and use the {}Code option for greater ease of reading.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!