![]() ![]() As a result, though for some nodes located in dark areas, the highlighted path is still its local optimal one.įor the fuzzy path, you could either smooth it after you find it or use some smoothed features instead of raw intensity. Since I donot use any prior knowledge to specify what are possible starting and ending nodes, I simply decode w.r.t every possible starting node.įor the fuzzy endings, it is caused by the fact that we are looking for optimal paths for every possible ending nodes. Here is a short demonstration of the above idea. Your solution will be more robust against noise, because as long as noise is equally distributed among all pixels, those optimal paths remain stable. Your results are optimal in the sense of path optimizations Here are some pros of adopting this approach:Īll your results will be continuous ( unlike the threshold method that might break one center line into pieces )Ī lot of freedoms to construct such a graph, you can select different features, and graph topology. Though it is more complicated than the simple binarization-and-then-curvefitting solution, it is more robust in practice.įrom the very high level, we should consider this image as a graph, whereĮach node is connected to some other nodes, known as neighbours, and this connection definition is often referred as to the topology of this graph.Įach node has a weight (feature, cost, energy, or whatever you want to call it ), reflecting the likelihood that this node is in an optimal central-line we are looking for.Īs long as we can model this likelihood, then your problem of finding 'the centerlines of the fringes' becomes to the problem to find local optimal paths on the graph, which can be effectively solved by dynamic programming, e.g. Here is yet an alternative solution to your problem by modelling your question as a 'path optimization problem'. ![]() Linkaxes( cell2mat(get(get(0,'Children'),'Children')) )įunction = FitCurveByPolynom(x,y) Props =regionprops(labels,im,'Image','Area','BoundingBox') ImBinary = imclose(imBinary,strel('disk',2)) These are the curves after fitting a polynomial: These are the curves that are found by finding the weighted average per column: I skipped the automatic threshold selection. Here is a Matlab code that shows steps 1,2 and 4. You can also fit a high-level polynomial, though it is worse, in my opinion. Connect the (x,y) points by fitting some kind of curve.Possibly, smooth the y values, to remove noise.For each blob in the binary image (one zebra stripe), for each x, find the weighted center (by pixel intensity) in y direction.Find a threshold to separate the foreground from the background.My impression, by looking at the images, is that the centerlines could be more continuous (more points) and smoother (not quantized) if they were detected directly from the non-thresholded image (either RGB or grayscale), by some statistical sweeping method (some flooding / iterative convolution, whatever).Īny suggestion would be much appreciated! The problem is that, by thresholding and also by taking the mean height of a discrete pixel column, we're having some precision loss and quantization, which is not desired at all. ![]() The photo is a PNG (RGB), and former attempts used grayscaling then difference thresholding to get a black-and-white, "zebra-like" photography, from which it was easy to find the midpoint of each pixel column of each fringe. The task is to find the centerlines of the fringes, which represent, mathematically, the 3D curve of intersection between the fringe plane and the subject surface. I'm working in a project where fringes are projected against a subject, and a photo is taken. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |