12-14-2015 09:39 AM
Hello,
Does anybody know if it is possible to set the origin of coordinates (0,0) at a specific location in a Imaq image? In my aplication I convert an array to a grayscale image, filter it, treshold it, and in the end I use the Count Objects VI, but the object locations are referenced to the top left corner and they should be referenced to the center of the image, any Idea of how could I achieve this? Thank you .
12-14-2015 11:33 AM
It looks like the picture objects has an origin property, but that tells the picture control what should be displayed in the top-left corner, so it's probably not what you are thinking of.
I don't think it would make sense to have 0,0 be at the center of the image in LabVIEW, because then anything besides quadrant 1 would require a negative index to access, which won't get you very far. I think your best bet is to just make a simple function to shift you from your image coordinates to your analysis coordinates (assuming all of your analysis functions call 0,0 the center of the image.)
You can just subtract img_width/2 from x and img_height/2 from y, then negate the y-coordinate (assuming you want +y to move upward on your picture).
12-14-2015 12:21 PM
Hello Gregory
It does have an origin property, but I have already tried to modify that and only changes the "search area" of the Count Objects Vi.
You made a good point about the negative index, but I don't have to process this data in any way, I only have to export it to a spreadsheet what brings me to my problem, the software which has to read this file asumes 0,0 as the center of the picture. Thanks for your response, any help is apreciated.
regards,
Xavi.
12-14-2015 02:12 PM
Can you upload a sample spreadsheet? (You can put in all 0's where image data would be, I just want to see what the column and row labels look like)
12-14-2015 02:43 PM
Hello,
Don't have any sample right now in this computer, but will make sure to upload it tomorrow when I get the one where my work is. It's basically a .txt with all the info from the "Objects" Cluster X/Y center, bounding box limits, etz. all referenced to the 0,0 in the image. The X axis enumerates the objects (Object1, Object2, .. ) and the Y axis is where the data labels are, the ones I was talking before, center, box, etz.
12-14-2015 02:55 PM
I think your best bet will be shifting those data to your desired origin before writing it to your txt file.