如何在Hough变换后在对象上绘制一个框架?

时间:2017-04-16 18:11:32

标签: matlab video-processing hough-transform

我需要在Hough变换后在图片上的RFID上绘制一个框架。我该怎么加入该计划? Picture

nFrames = obj.NumberOfFrames

shapeInserter = vision.ShapeInserter('Shape','Lines','BorderColor',
                'Custom','CustomBorderColor',uint8([255 255 0]));

rgbvideo = vision.VideoPlayer;

for k=1:nFrames

    I_color=read(obj,k);      
    I=rgb2gray(I_color);
    BW = edge(I,'canny');
    [H,T,R]=hough(BW);
    P=houghpeaks(H,10);
    lines = houghlines(BW,T,R,P,'FillGap',5);
    for j=1:length(lines)
        for p=1:2
            jk(j,p)=lines(j).point1(p);
            jk(j,p+2)=lines(j).point2(p);
        end
    end

    rgb1 = step(shapeInserter, I_color, int32(jk));        
    step(rgbvideo,rgb1);
end

 release(rgbvideo);

0 个答案:

没有答案