LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Imaq image: changing the origen of coordinates

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 .

0 Kudos
Message 1 of 6
(3,855 Views)

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).

0 Kudos
Message 2 of 6
(3,843 Views)

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.

0 Kudos
Message 3 of 6
(3,826 Views)

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)

0 Kudos
Message 4 of 6
(3,814 Views)

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. 

0 Kudos
Message 5 of 6
(3,803 Views)

I think your best bet will be shifting those data to your desired origin before writing it to your txt file.

0 Kudos
Message 6 of 6
(3,795 Views)