Detect a hole or a pit in an image.
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Gueni Hamza
am 21 Okt. 2021
Beantwortet: yanqi liu
am 26 Okt. 2021
Writing an algorithm to detect holes or pits in the street in an image and then measure it's size and depth.
0 Kommentare
Akzeptierte Antwort
yanqi liu
am 26 Okt. 2021
sir, here is an sample demo,for other image,may be use some DeepLearning method,such as yolo、frcnn
clc; clear all; close all;
img = imread('https://ww2.mathworks.cn/matlabcentral/answers/uploaded_files/774283/Hole_1.jpg');
im = rgb2gray(img);
bw = imbinarize(im,'adaptive','ForegroundPolarity','dark','Sensitivity',0.6);
bw = imopen(bw, strel('disk', 7));
bw = imclose(bw, strel('disk', 7));
bw = imdilate(bwareafilt(bw,1), strel('disk', 17));
[r,c] = find(bw);
wh = 7;
rect = [min(c)-wh min(r)-wh max(c)-min(c) max(r)-min(r)];
figure; imshow(img);
hold on; rectangle('Position', rect, 'EdgeColor', 'r', 'LineWidth', 2, 'LineStyle', '-');
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface) finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!