Image Processing: Counting Lines in a Range of Angles

2 ビュー (過去 30 日間)
Cole 2014 年 8 月 14 日
編集済み: Amir 2014 年 8 月 21 日
I'm working on a problem right now that involves a method to automate scanning drill core data from a mining property and identifying volume of vein and the angle at which the vein crosses the core axis.
With help from this forum and online, I've gone from the original image to the cleaned image. The cleaned image identifies the veins in the photo quite well.
If possible, it would be great if I could remove the rectangular sample tags and mini whiteboard. This step isn't completely necessary.
The main thing that I now need to do is somehow measure the angle of the veins to horizontal. I need to fit these objects with a line then identify lines between say 15 and 75 degrees (I don't want horizontal or vertical lines). Once they're identified, I need to record the angle to horizontal and count the number of them.
I'm trying to use the hough transform, houghpeaks and houghlines functions but it seems to be only grabbing the long, horizontal lines.


Amir 2014 年 8 月 14 日
編集済み: Amir 2014 年 8 月 14 日
Hi Cole. Please try this code. I hope it can give you some ideas
clear all
close all
[filename, pathname] = uigetfile('*','File Selector');
I = imread(strcat(pathname,'\',filename)); % for example FileName='MyImage.jpg'
BW = edge(I,'canny',0.1);
[bw, loc2]= imfill(BW,'holes');
rp = regionprops(bw,'All'); % you can specify the parameters which you need
for i=1:size(rp,1)
CenterX (i)= rp(i).Centroid(1);
CenterY (i)= rp(i).Centroid(2);
% you can other properties (for example area, perimeter etc here)
Final=[ObjOrient CenterX CenterY];
hold on
for i=1:size(Final,1)
'HorizontalAlignment' , 'center',...
'VerticalAlignment' , 'middle');
title('Coordination of Particles - between -90 and +90');
xlabel('Angle - Degree');
ylabel('Number of objects');
  4 件のコメント
Amir 2014 年 8 月 21 日
編集済み: Amir 2014 年 8 月 21 日
Hi Cole Sorry for delay. I wanted to think about this and write a code (if I can) for you. But these days I am very busy and couldn't find any free time to think about this. I think you need to combine object detection (code above) with the colour detection. i.e. for those objects which have -5<orientation <5 (horizontal)find the colour histogram of ORIGINAL image and if white colour is dominant then you can say most likely that object is a label. Hope this helps.


その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by