Filter löschen
Filter löschen

How can ı clear plotted hough line in bw image?

2 Ansichten (letzte 30 Tage)
hayrettin karadol
hayrettin karadol am 27 Jul. 2017
Bearbeitet: hayrettin karadol am 30 Jul. 2017
I cant delete crop row after find crop row line with hough line transform. I want to convert plotted lines value to binary as zero. The aim of project delete crop roe and detect weeds. Thanks for replay.
  4 Kommentare
hayrettin karadol
hayrettin karadol am 28 Jul. 2017
You actually expressed the question exactly :) l have RGB image from corn field and ı want to delete corn row using houg line transform. I add pictures and cods. Tahanks
clear clc
<<
<<
>>
>>
close all
rgb_img = imread('C:\Users\Administrator\Desktop\resimtarla\12.png'); figure(1),imshow(rgb_img); r = rgb_img(:, :, 1); g = rgb_img(:, :, 2); b = rgb_img(:, :, 3); imageGreyed = g - r/2 - b/2; BW = imageGreyed >15; % BW = edge(imageGreyed,'canny'); figure (2),imshow(BW);
[H, T, R] = hough(BW); P = houghpeaks(H, 100); lines = houghlines(BW, T, R, P, 'FillGap',350, 'MinLength', 400);
%// NEW \\ figure(3), imshow(BW), hold on, max_len = 0;
for l = 1:length(lines) xy = [lines(l).point1; lines(l).point2]; if ((lines(l).theta < 45 && lines(l).theta > -25)) % sadece dik aç?ya yak?n olanlar
a= plot(xy(:,1),xy(:,2),'LineWidth',22,'Color','green');
end
end

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by