I am trying to implement a VI and I need to get the co-ordinates of all pixels enclosed by a ROI (Freehand). With IMAQ ROIProfile I can only extract the pixel co-ordinates of the points lying on the contour line only. It would be very helpful if anyone could tell me how can I get the all pixel co-ordinates withing the ROI.
Thanks in advance!!
Solved! Go to Solution.
I've not used IMAQ ROI Profile, but if it does give you the coordinates of the pixels on the ROI boundary, you can write code to find the coordinates of all the points in the ROI. It's simple math (though there can be some minor complications). I'm assuming the following (which might not be true, in which case, ignore all of this ...) -- if you choose any pixel anywhere, then if it is inside the ROI, moving left or right to the edge of the screen will intersect multiple pixels (and an even number of them) on the ROI boundary.
You could let IMAQ ROItoMask do the hard work for you.
Is there a reason you need a list of coordinates? A lot of IMAQ functions work with masks.