Hello lazer,
From looking over your previous forum posts, specifically this one here:
http://forums.ni.com/t5/Machine-Vision/Pattern-Recognition-for-solar-cells-for-different-sizes/m-p/2...
The last program you posted ( "detect the shape 2.vi" ) looks like you have an angle coming out from your cluster of IMAQ Detect Shapes vi. What you would want to do to straighten up an image is to take a reference to your shape, which you are doing in that program, see its angle of offset from either the vertical or horizontal, which you also have coming out from an unbundle by name function, and then apply that angle to rotate your image in the opposite direction to get it "straight". I would suggest taking that angle and feeding it in to your IMAQ rotate function that you have in "straight the image.vi" and seeing the results of it there.
Best regards,
Mark W
Applications Engineer
National Instruments UK & Ireland