# Steve on Image Processing

## Showing image pixels associated with a Hough transform bin

Someone here recently puzzled over the output of the Hough transform functions in the Image Processing Toolbox. The Hough transform is used to detect line segments, typically in binary images. For the example we were looking at, some of the detected "line segments" didn't seem to correspond to line segments at all.

Let me show you what I mean:

I = imresize(imread('concordorthophoto.png'),0.15);
bw = edge(I, 'canny', [], 2);
imshow(bw)

The function hough computes the Hough transform; houghpeaks finds peaks in the Hough transform; and houghlines detects line segments corresponding to the peaks.

[H,theta,rho] = hough(bw);
peaks  = houghpeaks(H,5);
lines = houghlines(bw,theta,rho,peaks);

Now superimpose the detected line segments on the original binary image.

imshow(bw)
hold on
for k = 1:numel(lines)
x1 = lines(k).point1(1);
y1 = lines(k).point1(2);
x2 = lines(k).point2(1);
y2 = lines(k).point2(2);
plot([x1 x2],[y1 y2],'Color','g','LineWidth', 4)
end
hold off

Several of the green line segments shown above don't seem to correspond to any particular linear feature in the binary image. So why are they there?

Well, this is a fairly "busy" binary image, with many white pixels belonging to small, curvy features. These pixels do add up in the Hough transform accumulator bins. If you draw a line in any direction across this image, you'll find a lot pixels that lie on the line. All these pixels will contribute to the same accumulator bin.

I got to thinking that it would help to be able to visualize this in some way. That is, how can we see all the white pixels to contribute to a given accumulator bin?

Inside houghlines.m there's a subfunction called houghpixels that does this computation. I've pulled this out into an M-file called hough_bin_pixels.m. You give it a binary image, the theta and rho vectors returned by hough, and the row/column coordinates of a particular bin. It returns a new binary image containing only the white pixels that contributed to that particular bin.

For example, here are the white pixels corresponding to the fifth peak in the example above:

bw2 = hough_bin_pixels(bw, theta, rho, peaks(5,:));
imshow(bw2)

Let's overlay those pixels in color on the original image. (imoverlay is a function available on the MATLAB Central File Exchange.)

rgb = imoverlay(bw, imdilate(bw2,ones(3,3)), [.6 .6 1]);
imshow(rgb)

(I used dilation above to "thicken" the overlay pixels so that they are easier to see.)

So I think the Hough transform is not very useful for an image like this. It won't distinguish well between the linear features and the large number of other small features that also contribute to the accumulator bins.

Get the MATLAB code

Published with MATLAB® 7.2

### 124 Responses to “Showing image pixels associated with a Hough transform bin”

1. dp paudel replied on :

sir
i have problem in shape reconisation while working in matlab
i have one binary image & i have to check weather input image contains the image that i have or not
after that i have to write it in 1(for yes) & 0(for no) in a text file
what should i do for that
plz help me for coding

dp7rose@yahoo.com

2. Vy replied on :

Hey Paudel,

Steve probably have a much better answer for you, but I noticed that Fourier transform can do what you asked. From my reading (I haven’t done them myself), you can use it to find features in an image, like the letter ‘a’ in text, or I presume a polygon.
In Matlab 6.1 (my version) you can search for help under ‘Image Processing Toolbox – Transforms: Applications’. After the sections on Frequency Response of Linear Filters and Fast Convolution is a section called ‘Locating Image Features’. There is example codes there you can look at and modify. Good luck.

V.

3. Steve replied on :

DP – Try Vy’s suggestion, or take a look at normalized cross correlation (normxcorr2).

4. jayanth replied on :

sir i got hough lines on images thats fine .
but i want to extract coordinates of the lines that came
after hough lines.
please send me the matlab code for extracting coordinates
from hough lines.
so that i can go further in my project.

5. jayanth replied on :

6. Steve replied on :

Jayanth – the function houghlines, mentioned in this post, will give you the end-points of the detected lines.

7. Guntur replied on :

i’m being confused on how to locate the license plate on an image, i using indonesian plate which only have 1 white line on the plate, the basic color is black and character color is white, please can you help me, now i using an edge detection by vertc and hortz but i still have problem to combine that two picture to locate the plate because i still can find line that they combine an 90 degrees angle

8. Steve replied on :

Guntur – please see this post.

9. akram replied on :

i am looking for a matlab code for horizontal and vertical projection. i need to detect the interline spaces and interword spaces in a text document and locate them.
can you guide me where to find this

10. Steve replied on :

Akram – you can use the sum function in MATLAB to do horizontal and vertical summations, or you can use the radon function in the Image Processing Toolbox to do projections in arbitrary directions.

11. Houghlepough replied on :

I understand why Hough sometimes picks up spurious lines, but why does it not pick up some obvious line segments – are thet too curved, not enough ‘votes’ for some other reason?

hough is a bit under-speced – for instance, restricting the range of angles searched; also, some way of restricting the max linelength would be useful to avoid spurious hits as above.

12. Steve replied on :

Hufflepuff – The function houghlines, not hough, is responsible for finding line segments. It has parameters for controlling the minimum line length, as well as the gap-fill length.

13. Neve replied on :

hi, i m doing project on text detection and recgnitin from still images..but m unable to localise text in the image. Tried using connected components and merging using MATLAB but failed to do the meging part.Can u plz guide me.PLz reply as early as possible.

14. Zubair Alam replied on :

Hi Steve,
im doing a project of detection of 2D barcodes and im using hough transforms to detect the lines of the morphological image that was closed.I was intending to know where I could download houghlines.m and houghpeaks.m from. ive been looking everywhere but to no avail. it may be a stupid question but please, im desperate, please help,
thank you

15. Steve replied on :

Zubair – These functions are in the Image Processing Toolbox, and there are similar functions in the book Digital Image Processing Using MATLAB.

16. yasha replied on :

hi

I want to detect all the elliptic in image using Hough Transform . can you help me?

im living in italy
yasha taghia

17. Steve replied on :

Yasha – There are several contributions to the MATLAB Central File Exchange that claim to do circle detection based the Hough transform idea. You might take a look at them to learn some of the basic ideas. There are also some papers about Hough-based ellipse detection on the web.

18. Isabel replied on :

Dear Steve,

I hope you can help me. I’m trying to implement a code for Hough transform oriented to detect parabola in a binary image. Can you help me? Is it the same as for the detection of circles? Thank you :D

19. Steve replied on :

Isabel – the basic Hough idea is:

1. Identify a parameterized representation of the curve you are trying to detect.
2. Set up an accumulator array. The number of dimensions of the accumulator array corresponds to the number of curve parameters. The size of the accumulator array in each dimension corresponds to how the parameter space along that dimension is divided into bins.
3. For each foregound pixel in the binary image, compute all possible accumulator array bins that the pixel could belong to. These bins correspond to the set of curves that the pixel could lie along. Increment these bins.
4. Look for peaks in the accumulator array.

I’m curious—What is your application for looking for parabolas in a binary image?

20. Isabel replied on :

First of all, thank you very much. The application is the detection of the vascular arch in fundus images and the hough transform for the localization of parabola matches perfectly with it. I will try an implementation based on the knowledge I have about the circle detection. Thank you again :D

21. Steve replied on :

Isabel—Fascinating! I had no idea about that application. I’ll be interested to hear if the Hough technique works for you.

22. Isabel replied on :

When I have some results, I’ll let you know :)

23. Isabel replied on :

Dear Steve, I have just implemented and tested the code for detecting parabolas using Hough transform (at last!). I´m obtaining good results for my images :D. Thank you for your help

24. Steve replied on :

25. Jarrod replied on :

Isabel, do you plan on posting your hough parabola code on the file exchange? I’m sure others could benefit from this algorithm also.

26. Steve replied on :

Jarrod—I sent Isabel an e-mail with your question, just in case she doesn’t come back to this post.

27. Robert replied on :

Hi Steve,
I am doing a project on generalized hough transform(GHT). I don’t quite understand the concept of GHT compare to line detection which i can understand quite well. How does these 2 differs? Do u have any sample codes about GHT?

28. Steve replied on :

Robert—No, I don’t have information or code for the GHT. There’s a brief description of it here.

29. Robert replied on :

Steve-Thanks very much for the info.

30. Isabel replied on :

Jarrod- Sorry for replying so late :(. I have just posted the hough parabola code on the file exchange. If you have some suggestions, just let me know.

31. Robert replied on :

Steve- Do u know any method to find the tangent equation for a curve in a image? let’s say i got a image with circles, how do i find the tangent of each points?

32. Steve replied on :

Robert—The problem doesn’t ring any bells. If you can get an ordered list of points, such as provided by bwboundaries, then you might be able to compute a smoothing spline of some sort, and then analytically compute the tangent direction based on the spline. But I’ve never worked through the details of something like that myself.

33. prangya replied on :

hi….
sir,
i am doing project on pattern recognition of script. i have to find the hough transform of the script. i need the matlab code for the hough transform. can you send it to me?
thanking you sir

34. Steve Eddins replied on :

Prangya—There is source code in the Image Processing Toolbox and in the book Digital Image Processing Using MATLAB. I think there’s also some code available on the MATLAB Central File Exchange.

35. priya replied on :

I am doing project on EDGE ENHANCEMENT of image i have to find the canny edge detection of the image. i need the matlab code for the canny edge detection. can you send it to me?
thanking you sir

36. Steve replied on :

Priya—It’s in the Image Processing Toolbox. Look at the edge function.

37. Michael replied on :

Hi Steve,
I have a problem concerning detecting elliptical markers in an image of the eye.
Four markers with the shape of a circle (only the contour) are drawn on the eye. The problem is to distinguish between markers and reflections. So far the algorithm is able to detect the markers, and determine the coordinates of them. But there is a problem when a reflection lies on the contour of the marker, which means that there is a gap after filtering the reflection. Do you know an accurate (fast) way to detect partly occluded ellipses in matlab?
Thank you very much!

38. Steve replied on :

Michael—See this comp.soft-sys.matlab newsgroup thread for some possible suggestions.

39. Pratima replied on :

I am using matlab 7.0. I tried using hough function, but I get an error, ‘There is no function or block with this name’. So can you please tell me where I can get the code for this function.

Thanks,

Pratima

40. Steve replied on :

Pratima—You need to upgrade to a more recent release, and you need the Image Processing Toolbox. As an alternative, you can find Hough transform code in the book Digital Image Processing Using MATLAB, and there are also some related contributions on the MATLAB Central File Exchange.

41. surekha replied on :

heip me with the basics of hough transform for iris recognition

42. RIYA replied on :

hiiii sir,
m doin project on feature enhancemeny of image using matlab nd got stuck up in the problem of artifects in the image.can u suggest how to get thru it??
thnx

43. Ashar replied on :

well !
i am working on a project of creating a navigation system for a small vehicle !

i need to draw lines on an image and measure the angle between the lines to generate a control signal

and i am stuck and need help !

44. Ashar replied on :

i got the answer my self thnks it was plain obvious just needed sum thought to it !

45. Steve replied on :

Riya—That’s a pretty broad question. I suggest that you take a look an image processing textbook and look up topics such as noise removal and morphological closing and opening.

46. Umar replied on :

Dear Steve

If I want to detect a hyperbola in a 2D binary image how can i use hough transform to do that?

If I have a number of points in 3D space, how can I use Hough transform in order to find a straight line that passes thorough those points?

47. Umar replied on :

Dear Steve

I also have one more question, the Hough function transforms from image space to parameter space, is there any function that transforms data from parameter space to image space?

Thanks

48. Umar replied on :

One more thing, Isabel has written a code of detecting parabola, she has posted that she has uploaded the code on the exchange server, How can i access that?

49. Umar replied on :

Me again…

well ive found Isabela’s code and had a look at it, in that the vertex of the parabola is known…. what if we have a binary image that has a number of shapes including a parabola… and we would like to find the parabolic shape within that image….
Actually im personally interested in finding hyperbolic shapes in an image… My research area is ground penetrating radars and an underground pipe or cylindrical object generates a hyperbolic pattern within the GPR image. Im interested to extract that…
Can some one help me…

50. Steve replied on :

Umar—The function hough_bin_pixels that I mentioned in this post contains code that transforms from parameter space to image space, so you might want to look at that.

Look at the book Machine Vision by Davies. It has the most detailed textbook coverage I’ve seen about Hough-related techniques for detecting various shapes.

Keep in mind that the Hough family of techniques can quickly become impractical as the dimensionality of the parameter space rises.

51. hanin replied on :

Hi Steve,

My project is about estimate age base from human face. I already using edge detection technique. My question is, is it possible to use Hough to count line on face image? I assume line on face as wrinkle and trying to get some result base from the line. If possible I dont want to do image testing. Thank you

52. Steve replied on :

Hanin—Seems like a reasonable thing to try. I don’t know what you mean, though, by “I don’t want to do image testing.”

53. hanin replied on :

Thanks Steve. “I don’t want to do image testing.” It’s mean i’m not using neural network to test image. i’m just trying to count line on face and base from that we can estimate the age. do you think it’s ok?

54. Steve replied on :

Hanin—I’ve never worked on such an algorithm, so I can’t offer a well-informed opinion. Give it a try.

55. Kara replied on :

Steve,
I’m having trouble finding certain near vertical lines in an image using the hough transform. The algorithm correctly identifies the full line in my test image when theta = -2.5. But when I flip the image left to right, houghlines only identifies lines if I drastically increase the fillgap and reduce the minlength. This is not an ideal solution, because houghlines returns several small lines (as opposed to the one full line), and these parameter changes would increase my chances of returning erroneous lines over an entire image. Have you run across this problem before? Any thoughts on how to fix it? Thanks!

56. Steve replied on :

Kara—Can you send me a sample image illustrating the problem?

57. Alejandra replied on :

Hi mr Eddins *_*. i´m a magister student from Colombia… and i´m working on image segmentation of time – frequency spectrum, (i hope you can understand this, my english is awful T_T), the point is… I need to detect a line, but is not straight, is a curve line, but the code for Hough in circles dont apply here -_-.
is a small curve, so hough lines do not detect the entire line, just pieces, and this is my problem… do exists a method for non straight lines?? what else can i do?
Thanks for the help :)

58. Steve replied on :

Alejandra—Techniques similar to the Hough transform generally work by starting with a parametric expression for the curve you are trying to find. If you can’t do that for your “curved line,” you probably can’t use Hough-like techniques.

59. Victor replied on :

What would you suggest as an alternative method to find lines in the example image?

60. Steve replied on :

Victor—After thinking about it a little more, I imagine that you might have success with hough and houghlines by tweaking the minimum length parameter of houghlines.

61. fatemeh replied on :

Hi

62. Steve replied on :

Fatemeh—Those functions are all part of the Image Processing Toolbox. They are not available for download here.

63. star replied on :

Hi
I used from hough function but have this error:
Error using ==> -
Matrix dimensions must agree.

Error in ==> D:\Matlab\work\hough.m
On line 14 ==> theta = [theta - fliplr(theta(2:end - 1))];
thanks

64. Steve replied on :

Star—From your error message, it appears that you are using your own file, D:\MATLAB\work\hough.m, instead of the M-file that ships with the Image Processing Toolbox. I can’t help you with bugs in your own M-files.

65. Erazim replied on :

Hi Steve.

I want to compare several methods for ellipse detection and I have ONE little problem :) I implemented classic HT, but how to store large 5-dimmensional array? Now I have array like 10x10x10x10x10, but as you guess, it is not much :) Please, help me. Dynamic linked list is too slow solution.

Thank you very much, Erazim, Czech Rep

66. Sandip replied on :

Hi Steve,
I am writing a program to count the number of circles in an image. At the outset it seems pretty basic, but the image is a mosaic with touching circles and lines. I’ve tried out various methods – the hough transform, edge detection schemes, the matlab demo solution etc. but none have given me the correct result.
Can you provide some insight?
Thanks,
Sandip

http://cid-28e402cd8bdea72a.skydrive.live.com/self.aspx/Public/pattern.jpg

Note: I converted the image into binary before working on it.

67. Erazim replied on :

Sandip,

I would give you an advice :) If you solve circles and lines and you want just circles..

1. Use edge detector (Sobel, Canny)
2. Use Hough transform to detect lines and delete them :)
3. Use Hough transform to detect circles (HT is robust enough to make it even if you’ve deleted some circle pixels)

—-
4. I hope I am not wrong and it’ll help a bit.

Erazim

68. Sandip replied on :

Erazim,
The problem with Hough Transform in this case is that the straight line edges are thick, and I am unable to find the correct parameters for giving the desired result. I thought about convolving the image with a mask like M=[1 0 0;0 1 0;0 0 1] in order to filter out the diagonal lines etc. (the image has only horizontal, vertical and diagonal lines…which makes it 4 different masks to filter them out). But somehow, this method also fails.
SOS
Sandip

69. Erazim replied on :

Sandip,

some algorithms for thinning lines exist, but I would recomend you to use Canny filter (it produces edges 1px thick :)). I use it in OpenCV library, it’s opensource, so you can copy it.. there’s also implementation of Line Hough Transform :) (and some ellipse fitting).

See Canny filter: http://flowdesigner.sourceforge.net/wiki/index.php/OpenCV

70. Steve replied on :

Erazim—I don’t have any experience with Hough-like algorithms for ellipse detection. You might take a look at Machine Vision by Davies; it takes a very thorough look at the pros and cons of various algorithms based on the Hough idea.

71. Steve replied on :

Sandip—I’m sorry, but I don’t have any idea about how to tackle that sample image.

72. priya replied on :

Hello Steve,
Iam working with houghlines.Iam able to find the line coordinates of a single line at a time,but I want to know how to find the line coordinates for more than a single line at a time.Please help me.
Thanks
priya

73. priya replied on :

Steve,
pixval helps to find the coordinates of the houghlines in the image,but it is a manual operation,i want the coordinates to be displayed by the .m file itself,please help me in doing it.Waiting for your reply.

Priya.

74. Nick replied on :

Hi,Steve,
I have a b/w image about the root of some plant. I’m wondering how can I obtain its length with Matlab (the root is not straight but in curve form).
Thank you,
Nick

75. Payal replied on :

Hi Steve,
Is there a way to add pixels to make connections in an binary image?

76. Steve replied on :

Payal—Your question is pretty vague, so I can’t give a precise answer. You can change any pixel value you want, of course, by simply assigning to it. Or you can try the many morphological operators in the Image Processing Toolbox.

77. Andrew replied on :

Hi Steve,

I am trying to do some cell segmentation. I applied the canny algorithm to get the problem boundaries of the cells. My one problem is that there are various edge lines within the cell. I would like to remove these. Is the Hough transform the best way or is there another method? Thanks for your time

78. Andrew replied on :

Steve,

I would like to add that some of these spurious edges within the cell are curved and not perfectly straight

79. Steve replied on :

Priya—houghlines can find more than one line at time. It depends on how many peaks you pass in. See the documentation for the peaks input argument to houghlines, as well as the houghpeaks function.

80. Steve replied on :

Nick—You might be able to adapt the 'Perimeter' measurement of regionprops. If that doesn’t do it, try doing internet searches for “fiber measurement” algorithms.

81. Steve replied on :

Andrew—The Hough transform is not going to help you if some of the edges you are trying to remove are not straight. You might want to take a look at other segmentation methods, such as marker-controlled watershed segmentation.

82. Priya replied on :

Hello steve,
Thanks,thanks alot for the reply.I now got the answer for my question.
Priya

83. Guillaume replied on :

Hi Steve,

I’m a student, I’m in internship and I have a project who I need to detect the lines on the road, but I have some problem with the houghlines, I detect some lines but I can’t have all the lines, I don’t have peaks where I need, can you help me?

Guillaume

84. Steve replied on :

85. Nawal replied on :

Hi steve: can we use Hough to detect text line in handwriting image Thanks in advance

86. Steve replied on :

Nawal—I’ve never studied techniques for image analysis of handwriting, but I doubt the Hough transform would be useful for detecting lines of characters. It might detect lines within characters if the scan resolution were high enough.

87. arpan replied on :

Hi,
You have said about hough transform for lines and circles. But for detecting planes,can hough transform be implemented?? if so,how??

88. collin replied on :

Hi steve,
Could I erase the lines detected from an image. is there any function?
thank you!

89. Steve replied on :

Collin—There are functions that might be useful for the task. You might want to take a look at roifill.

90. Babak Taati replied on :

this is a good function.

(I wish there was an option for passing greyscale edge strength values to hough.m instead of a binary edge map)

91. Steve replied on :

Babak—Thanks for the suggestion about hough. If you get the original M-file implementation of this function, which appears in the book Digital Image Processing Using MATLAB, you may be able to modify it to accumulate gray-scale pixel values.

92. akshay sathe replied on :

Can i use Hough Transform to detect the road boundaries in an image, which may be curved as well? If not, is there something else that is useful in this regard?

93. Steve replied on :

Akshay—No, I don’t think the Hough transform would be useful for curved road detection.

Hi Steve,
Is there any way I can use Hough Transform to detect text lines in a handwritten manuscript? I had seen such an application some time back but can’t find it anymore.
Is there any other way I can detect text lines?

Assume text lines can be slanted also.

I’m working on OpenCV by the way.

95. Steve replied on :

Subhadip—I don’t have any experience with analyzing handwritten manuscripts, but it’s possible that the Hough transform could be useful. Can’t help you with OpenCV, though.

96. abc replied on :

Hi, also , i am trying to obtain all the closed loops in the binary image obtained after canny filtering, how will i do that ? thx a lot once again

97. Steve replied on :

ABC—Try bwboundaries.

98. abc replied on :

Hi Steve, thx a lot for suggestion, it works but requires additional Morphological operations.

99. Reza replied on :

Dear Sir,

The hough transform does not work well. It has lots of error and miss detection.

100. Steve replied on :

Reza—Your statement is a bit too broad. For what kind of image data? What size bins? What parameters for peak detection and line-gap filling? What preprocessing steps applied to image data? There aren’t any image processing operations that apply equally well in all circumstances.

101. Murat replied on :

dear Steve. I m a master student. I have a problem to find line on the road. I red your succession headgear 84. You suggest houglines.m ı studied very much on houghlines.m to detect line on the road but ıt doesnt detect correct line. ıt detect very much line. I cant fine the solution. I think maybe ı can apply region of interest but ıt is difficult to apply every image. Can you gime me a succession.
Tahnk you very much

102. Steve replied on :

Murat—I don’t have any suggestions for you.

103. Murat replied on :

Thank you Ms.Steve. Can I claim that hough transform isnt detect line on the road very well?

104. Steve replied on :

Murat—I caution you against making oversimplified claims. Line detection in realistic images can be a very complex process. The Hough transform is but one tool among many that must be applied, and the Hough transform itself has many different variations.

105. Nishtha replied on :

Sir,
I have to detect no. of tires in an image of vehicle. image of vehicle is at an angle so that all tires can come into image. I am using hough transform for circle from file exchange of mathworks. It is working fine but sometimes it show circles at place where no circle exist in image. i.e. false positives. What should I do to remove it?

106. Steve replied on :

Nishtha—Image analysis algorithms often don’t just work “out of the box.” Usually there’s a lot of work involved in determining how to preprocess the image and how to set algorithm parameters. I don’t have specific suggestions your particular application.

107. tommy replied on :

Dear Steve,
I have a question,please if you are kind to help me regarding the accumulator array dimensions of the standard hough transform available in Matlab.
I can specify the Theta Resolution and Rho Resolution but I don’t know what are the dimensions of the accumulator array built by default.
On my program I use the standard functions HOUGH,HOUGHLINES and HOUGHPEAKS

Sincerely,
Tommy

108. Nishtha replied on :

Sir,
I have preprocessed the image in following steps: [1] adaptive histogram equalization [2] thresholding [3] dilation [4] erosion [5] edge detection [6] Circle detection. Is this method proper for preprocessing. In edge detected image I am getting tires part of truck quite clearly.
Regards,
Nishtha

109. Steve replied on :

Tommy—See the documentation for hough. In particular, see the formulas for nrho and ntheta.

110. Steve replied on :

Nishtha—Seems reasonable.

111. collin replied on :

Dear Steve,
Thank you very much!

I would like to ask you if you could suggest a way or methodology of testing the line detection accuracy of the Hough Transform.

Sincerely Collin

112. Steve replied on :

Collin—The book Machine Vision by Davies has a lot of information about various kinds of Hough transform. If I recall correctly, it has information about accuracy analysis.

113. bharat patel replied on :

hello steve,
I want to detect lines and circles from image. If line and circle are join how can we separate them. please help me.

from
bharat

114. Steve replied on :

Bharat—Try applying a circle detector and a line detector in separate steps. There is circle Hough code available on the MATLAB Central File Exchange.

115. vishnu replied on :

Hi Steve,

I want to whether there is any matlab command which can find the pixels lie on a line drawn by two points in the space.

Vishnu

116. Steve replied on :

Vishnu—See the function toolbox/images/images/private/intline.m. You’ll need to make your own copy in order to call it.

I’d be interested to know more about why you need this function.

117. Aisling replied on :

hi steve,
I’m trying to find the preferred orientation of collagen fibres in histology stains. I thought I hit the jackpot when I found the Houghlines function, but unfortunately my edges look much like those of your example above and I seem to have the same problem. For the example above you did not offer any alternative approach. Have you any thoughts on this?
Thanks,
Aisling

118. Steve replied on :

Aisling—Try searching for terms such as “fiber analysis” and “texture orientation” to get some ideas.

119. raj patil replied on :

hello sir,
i have tried the same code of hough transform for my handwritten documet image but there is an error as your image should be two dimentional for edge function

120. Steve replied on :

Raj—Convert your color image to gray scale using rgb2gray.

121. Gumah replied on :

hi steve,
I am doing a project about text segmentation. I used your commands:
bw2 = hough_bin_pixels(bw, theta, rho, peaks(5,:));
imshow(bw2)
to get the white pixels corresponding to some peak in my image which represents the location of that textline in the original image
could you please tell me how to get the location of that white corresponded pixels in that image

122. Steve replied on :

Gumah—Use find.

123. subrata datta replied on :

how many pixels are there in a particular hough peak…i need the code
plz help me

124. Aurélie replied on :

Hello Aisling!
I actually encounter the same problem as you and I would like to know if you found an acceptable solution.