From: Krishna C on 26 Apr 2010 13:47 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <e8b836f2-eac9-400b-8c9e-47fcaced3ed2(a)y21g2000vbf.googlegroups.com>... > On Apr 25, 11:31 am, "Krishna C" <chaitanya.a...(a)gmail.com> wrote: > > Sir, > > I want to make an attempt using this, > > http://blogs.mathworks.com/steve/2007/03/28/neighbor-indexing/ > > can you give me an idea of implementing the same thing to 8-connected neighborhood... > ------------------------ > Sorry but that won't work. The reason is that your points you want to > find are not next to the points you're looking out from. They are > several pixels away, connected by a single pixel wide path of "lit up" > pixels. That method will only find the first pixels on the path, not > the ones at the ends of the path which is where the next intersection > point it. You're going to have to start at every node and go out from > there along each of the paths emanating from the node until you hit > another node. You could probably do it with some kind of a recursive > breadth first tree search algorithm. Maybe there's something in the > optimization toolbox that could do it as a canned routine - I don't > know since I don't have that toolbox. _________________ Sir, I want to proceed in other way. can you give me an idea how to solve this, In the above mentioned image, i want to make all nodes (red marked) and its 8-connected neighbors to zero i.e. want to make them as background pixels (because some of them, at every node are ones, foreground pixels). Then only the lines (boundaries) connecting these nodes (red marked) should be in foreground. kindly give me an idea to do this. This will help me to get the part of my results. Thank You.
From: Ashish Uthama on 26 Apr 2010 13:49 On Sat, 24 Apr 2010 11:41:05 -0300, Krishna C <chaitanya.alur(a)gmail.com> wrote: > Hi everybody, > > I need some help regarding the following problem, > > I have an image with many intersection points ( marked in red in the > following image).. > > http://www.flickr.com/photos/30274557(a)N05/4547638073/ > > every intersection point is connected to the other intersection point > through a white line..What i want to do is find out the connected > intersection points for every intersection point i.e. if we take a > particular intersection point i have to find the points that are > connected to it through that white lines..the output should be like, a > intersection point and its connected points (their coordinates0 > > The image is a binary image and also i have the set of all intersection > points(coordinates) in a matrix... > > Kindly anybody give an idea of solving this problem ... > > Many many thanks in advance... > > from, > Krishna Chaitanya How about using some kind of http://en.wikipedia.org/wiki/Flood_fill approach. Let Im be your logical image, 1 is foreground, 0 is background. Convert Im to say uint8 Mark all your intersection points with value 2 (any unique value to act as a marker will do). Im(intersection points) = 2 Now, loop through each element of IM, if the value is 2, start flood filling surrounding 1's with say '3' till you reach a 2. Implement your own floodfill algo based on the first pseudo code listed in the wiki page. Replace step 1 with: 1a. If the color of node is equal to 2, return node position. 1b. If the color of the node is not equal to target-color, return. Note that this will help you build an association between connected intersections depending on your scan order (if if pointA lists pointB and pointC an being connected, point B wont list pointA).
From: ImageAnalyst on 26 Apr 2010 18:17 On Apr 26, 1:47 pm, "Krishna C" <chaitanya.a...(a)gmail.com> wrote: > _________________ > Sir, > > I want to proceed in other way. > > can you give me an idea how to solve this, > > In the above mentioned image, i want to make all nodes (red marked) and its 8-connected neighbors to zero i.e. want to make them as background pixels (because some of them, at every node are ones, foreground pixels). Then only the lines (boundaries) connecting these nodes (red marked) should be in foreground. > > kindly give me an idea to do this. This will help me to get the part of my results. > > Thank You. ------------------------------------------------------------------------- Krishna: I thought I did that in my previous response. I don't really know how to do it otherwise. Maybe if I thought about it a while I could come up with some clever morphological way to do it (like my fun maze solver: http://www.mathworks.com/matlabcentral/fileexchange/27175-mazesolution) but I haven't thought about it very much, and all I could think of off the top of my head was what I said before about tracing outwards from the nodes until you find another one, or see if there's something in the optimization toolbox. But good luck with it. By the way, why do you need to find the nearest neighbor nodes? Maybe you just THINK you do to get what you really want, but there's actually another DIFFERENT way to get what you really want. Can you share the larger picture about what you're trying to solve in your project? ImageAnalyst
From: ImageAnalyst on 26 Apr 2010 18:23 On Apr 26, 1:49 pm, "Ashish Uthama" <first.l...(a)mathworks.com> wrote: [nice algorithm snipped] ------------------------------------------------------------------------------------------- Krishna: Ashish's algorithm about tracing outward from the nodes is pretty much what I was thinking - but he thought it out more. I'd follow his idea unless someone else comes along with something better. It should be pretty fast because you're only dealing with a few coordinates (a few thousand or so). Good luck.
From: Krishna C on 28 Apr 2010 15:09 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <df81bebf-60bf-4a22-8be0-037836e486c0(a)e28g2000vbd.googlegroups.com>... > On Apr 26, 1:49 pm, "Ashish Uthama" <first.l...(a)mathworks.com> wrote: > [nice algorithm snipped] > ------------------------------------------------------------------------------------------- > Krishna: Ashish's algorithm about tracing outward from the nodes is > pretty much what I was thinking - but he thought it out more. I'd > follow his idea unless someone else comes along with something > better. It should be pretty fast because you're only dealing with a > few coordinates (a few thousand or so). Good luck. To Ashish and Imageanalyst, Many thanks for the idea and suggestions. I implemented that flood-fill operation on the image. Its taking so much time to compute the result. its taking around 25min or so for the result. Any improvements for that flood-filling operation. The resolution of my image is 572*760, that give 434,720 pixels which is quite a big number. And checking out every pixel in the loop is taking more time. As you asked, what i exactly want to compute is, 1. the angle of each boundary with the horizontal 2. the overrun of each each damage portion, i.e the ratio of A/B in the following image(the following image is part of the original image) http://www.flickr.com/photos/30274557(a)N05/4560719935/sizes/o/ kindly have a look and give me some idea of solving this.. Thank You..
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: how to create a custom bit pattern in simulink Next: find centroid of a moving object |