找到boundingbox

   %Compute Rectangle and Bbox Features
        BW = bwareaopen(binaryImage,200);
        bboxImage = zeros(size(BW));
        bboxes = regionprops(BW,'BoundingBox');
        for k=1:1:length(bboxes)
            bb = bboxes(k).BoundingBox;
            bboxImage(round(max(1,bb(2))):round(bb(2)+bb(4)),round(max(1,bb(1)):round(bb(1)+bb(3)))) = 1;
        end
        bboxImage=bboxImage(1:size(BW,1),1:size(BW,2));
        bboxFeatures(:,t) = bboxImage(:);
        bFeatures = bboxImage(:);
        y = double(mapClasses == t) .* unaries(:,t);
        rFeatures = y;
        rFeatures(bFeatures==0) = 0;
        rectFeatures(:,t) = rFeatures;

 

 

matlab

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章