The Joys of Recursion
So, in order to detect occlusions in a scene from a few images, first you've got to break up the image into regions. Then you simply determine which regions are not visible in different images, and this tells you what is in front of what.
The problem with this is that it requires you to break up your image into regions... The algorithm I'm using involves the image flow. So I calculate all the flows in the image and then segment by determining which part of the image belongs to which flow.
The basic algorithm is this:
-Get the image flows
-For each image flow, find the regions that match this image flow
-Repeat until all image flows have been run through the image and the whole image is broken into regions.
The problem with this is in finding regions that match a particular image flow. All the image flows were calculated between two frames, so you take the first frame, apply the image flow to it, and then compare it with the second frame. You then record good intensity matches. With this map of intensity matches you try to grow regions.
Well, how do you grow a region out of a bunch of pixels? Clustering. And the most simple clustering algorithm is simply to connect together adjacent pixels. But of course to search out these adjacent pixels, you have to use a recursive algorithm, much like searching a tree.
Well, it turns out MATLAB dies very quickly when performing recursion. When I try to find a region that's more than, say, 500 pixels (which is very likely) MATLAB will simply crash.
So it looks like I'll have to go back and use a different clustering method. Maybe K-means will work.
The problem with this is that it requires you to break up your image into regions... The algorithm I'm using involves the image flow. So I calculate all the flows in the image and then segment by determining which part of the image belongs to which flow.
The basic algorithm is this:
-Get the image flows
-For each image flow, find the regions that match this image flow
-Repeat until all image flows have been run through the image and the whole image is broken into regions.
The problem with this is in finding regions that match a particular image flow. All the image flows were calculated between two frames, so you take the first frame, apply the image flow to it, and then compare it with the second frame. You then record good intensity matches. With this map of intensity matches you try to grow regions.
Well, how do you grow a region out of a bunch of pixels? Clustering. And the most simple clustering algorithm is simply to connect together adjacent pixels. But of course to search out these adjacent pixels, you have to use a recursive algorithm, much like searching a tree.
Well, it turns out MATLAB dies very quickly when performing recursion. When I try to find a region that's more than, say, 500 pixels (which is very likely) MATLAB will simply crash.
So it looks like I'll have to go back and use a different clustering method. Maybe K-means will work.


1 Comments:
At 3:56 PM,
Gilead Pellaeon said…
Ok so I managed to fix up my recursion algorithm using a little bit of preprocessing so it will handle relatively large regions. I also decreased the region size by cropping my images down to only the relevant areas. That last fix is probably a bit of a cheat, but hey, it works :-)
Post a Comment
<< Home