필터 지우기
필터 지우기

Image identification and acquisition

조회 수: 2 (최근 30일)
mohamed  al-asklany
mohamed al-asklany 2018년 7월 25일
편집: Walter Roberson 2018년 7월 26일
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
Aarti Dwivedi 2018년 7월 26일
Please format the code properly, and use the {}Code option for greater ease of reading.

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by