Thank you very much, Bruce
The problem right now becomes how to set up a zone by 4 points(their coordinates known!) as ROI.
I tried to figure out what is your exact meaning in the procedure but still half understanding right now.About vision, I am much relying on the IMAQ Vision Builder, of course I will try to do it in labview when it's much simple. But I found some new factors and I'd like to solve my ROI problem in another way and maybe it is simpler and makes my vi work more reliable and stabler.
I made a vi which creates a new image(bottom edge horizontal angle=0 or 360) from a previous reference image(used as background image, its related angle not =360 or 0)by rotating itself and this new image under Vision Builder was tested and it firmly proves both top and bottom edges are exactly horizontal. And at the same time I found that both top and bottom edges can be very easily and exactly found by " find straight edge:horizontal/edge" function and it indicates an exact zone to be ROI as desiration. But it shows the zone is not exact rectangle by glacing at their coordinates of 4 points. I used this script to test other images that are not exact horizontal and their results show both top and bottom edges are located badly. These promt something to me that it would be perfect if my ROI could be set up by the coordinates of these 4 points from both top/bottom edges found by vision vi and it exactly reflects the dynamically changes of ROI in real process operation. In another words, The ROIs are very tiny differnces and dynamically changed in machine-vision-view since settings up with device opticals,reflection of lightings are not exact the same each time and system vibration, and also the tube space is not exact rectagle due to its manufecturing tolorence, etc.
Hence, the problem becomes how to set up the zone marked by these 4 points as ROI. I didn't find the related way to do this in Vision Builder but suppose it should be simple in labview. I still have no any idea of the function to do this now. Comments are still warm welcome, especially what functions to be used on this purpose.
Thanks! Nice weekend!
Swedlin