solving simple MRF problem with graph-cut - graph

I'm trying to solve this simple question with graph cut:
I draw the graph and I get that that all pixel label sould be 1 while 000 is minimizing E,
what did I missed?

Related

solve Systems of linear inequalities - find point of 2 groups inequalities

I have 8 inequalities, 4 y>= (dashed lines) and 4 y<= (continous lines). Reading graph I can determine solution area (grey area). For me most interesting is only most right point of solution area. Now i need to do somethig similar but without graph uing only some algorithm. So does exist any methot/algorithm to do that or something similar? Or any other tips how to try find that point mathematically? Ofc image below is only example, I'm looking for method, not solution of this example.
inequalities graph

Is triangle rasterization possible without baryzentric coordinates?

Im just planing a triangle rasterizer on GPU (GLSL) and I came across an algorithm that could remove barycentric coords (which is quiet expencive to copute) from rasterization.
Given the triangle ABC with the edges abc and the linear equation f.
In the first step I check each of the edges abc for intersection with f, (the triangle is already projected in R²)
then I take the factor from the linear equation of abc (each edge is an linear equation) and use this parameter in R³ for determinating a new equation which conects the two intersection points on two differnt edges of the triangle.
So now I can fill my triangle line by line (the pixels between the intersection points are filled).
Based on the linear equation in R³ (of the intersection points) I can now determinate the R³ cooeds of each pixel so I have a depth value.
I know it's a bit complicated so if you have any quaestion please ask me.
So do you think it's possible this way and if yes, is iit faster ??
If I forgot anything or if I did a mistake please inform me.
If you have any optimisation idea or something else please inform me.
I found out that it is a bit faster but I'll have some problems with textures and additionsl calculations would slow the whole thing so I think I will use barycentric coordinates.

Smoothing a flat surface in maya

i was wondering if anyone of u here knows how to smooth a polygon in Maya? I've tried 2 methods which i found online. One of which is 'Vertice Averaging' and the other 'Smooth' which are both under the 'Mesh' option.
Vertice Averaging caused my polygons to have 'gaps' or 'holes' between the triangles, which i do not intend for that to happen.
While Smooth causes the polygon's face to have 4 vertex instead of the original 3, which i do not want as well, as i need a polygon with triangle faces.
http://img.photobucket.com/albums/v483/dragonlancer/PolygonAveragingampSmoothing.jpg
And to whoever told me that it is a bug, i tried, but doesnt work =[
You said you wanted to maintain your tris so you could switch the smooth option 'Add Divisions' from exponential to linear.
If you're getting gaps, its because the original mesh has verts which are not welded together. Try Edit Mesh > Merge with a small tolerance value before running average or smooth.
In general you'll get more pleasant results if you smooth a quadrangular mesh instead of a trimesh - when you subdivide quads the results are very similar to NURBS curves, whereas smoothed triangles always tend to look look like old-fashioned 1990's game graphics.

Smoothing a 3 dimensional Euclidean space matrix

I have a general question about what method to use for smoothing a 3D (xyz) grid.
My program has large matrixes of 3D points obtained with a stereovision method. The shape of the result is always something like a semisphere, but it has a rugosity due to stereovision errors I want to eliminate.
The question is, how to do it? Rigth now I have half developed a method for soomthing, but I think there may be a better method.
My actual idea is to use Hermite method. The idea is to:
Take all XY and smooth in two directions ->XYnew and XnewY
Convert the Hermite lines into Bezier lines and find the cross point between XYnew and XnewY, having the new point. (Repeat with all points, normally 2000)
Use hermite XYZ smoothing having XYZnew.
Rigth now I have the hermite surface smoothing and hermite line smoothing inplemented in C++, but the middle part is not as easy as espected.
Anyway, my question is, is this a correct method or is there another one which may be better?
Of course the idea is to elliminate the error generated by the stereovision method, this is not a computer graphics problem, is more a data treatment problem
Appendix:
At first I thougth that with a Z smoothing would be suficient, but clearly it is not, there is also a lot of XY error. In the images below you can see the Z fitting working but still it is really rugous as it can be seen in the 2 image. (The colours are deformations and shoul be quite continous)
Unless you have better priors, it's hard to beat the classic Taubin's algorithm: http://mesh.brown.edu/taubin/pdfs/taubin-iccv95a.pdf

Plotting nodes on a graph based on node-pair distances

I was wondering if someone could help with the following problem.
I have a dozen nodes, each a different sized circle between 0 - 10. I have a distance for each node-pair (e.g. node A and B are 6 from each other, etc.)
Given this data, would it be possible to compute the position of each node on a grid?
The distance could be from the centre or the edge of a node.
Thanks.
If you just want to have a graph to look at, try building a neato file where you specify edge distance. Neato is a layout program that is part of the GraphViz package.
This is quite easy. Your example above would look like this:
graph G {
A -- B [len=6]
}

Resources