02-02-2016 01:52 PM
I'm trying to process some image data, and am uncertain about the actual image size once I have pixmap data.
I use "read bmp data". If I look at the image data from that function, the "rectangle" is 0,0 and 640,480. Then I "draw flattened pixmap", and link this to an image object on the front panel. I set the image properties height and width to 640 and 480. But the resulting image is cropped compared to the original.
I read in "draw flattened pixmap" help that image creation VIs add 2 pixel padding around the image. So maybe I need to increase the image properties to 644 and 484. But I find that I'm still cropping 2 pixels.
I need to understand why the size appears to be incorrect, because I need to perform some image processing of specific zones in the image. Can anyone explain why the image is getting cropped?
Thanks
02-02-2016 02:18 PM
A copy of your code (VI with the part of your code that give you problem) would be make it so much easier for us to help you and for you to get the proper help.
02-02-2016 03:02 PM
OK, thanks. See attached file. Default image in VI is a 30 wide 20 high image with red rectangle inside from 0,0 to 29,19 and blue rectangle from 1,1 to 28,18 (the forum wouldn't let me insert the original BMP file). In the VI I have to set the image properties to 36 wide, 26 high, or the image gets cropped. Why? I can understand maybe this 2 pixel boundary is added, so perhaps I have to set it to 34 wide 24 high, but why 36x26?
In other words, I just need to understand why...
02-02-2016 03:03 PM
@mattstiles wrote:I'm trying to process some image data, and am uncertain about the actual image size once I have pixmap data.
I use "read bmp data". If I look at the image data from that function, the "rectangle" is 0,0 and 640,480. Then I "draw flattened pixmap", and link this to an image object on the front panel. I set the image properties height and width to 640 and 480. But the resulting image is cropped compared to the original.
I read in "draw flattened pixmap" help that image creation VIs add 2 pixel padding around the image. So maybe I need to increase the image properties to 644 and 484. But I find that I'm still cropping 2 pixels.
I need to understand why the size appears to be incorrect, because I need to perform some image processing of specific zones in the image. Can anyone explain why the image is getting cropped?
Thanks
There is nothing spefically named "image properties height and width". How are you setting these values, programmatically using the "draw area size" property (which is how you should do it, using ricght-left and bottom-top from the image data cluster) or by right-clicking the 2D picture control and setting the size height and width manually? (note that what I observed using 2D Picture modern control is that the border is 3 pixels thick).
Ben64
02-02-2016 03:08 PM
Hi,
Yeah, the latter (right click the picture control). All my images are the same size so this should be OK, but I could do this programmatically as well. So is this just because of the picture control? The bottom line is that I'm going to draw a circle over the image, and it needs to be located properly down to the pixel. For example, if I want a circle center coord at 10,10, do I need to add any pixels to accommodate some sort of boundary added by the VIs I'm using?
Thanks
02-02-2016 03:22 PM
@mattstiles wrote:Hi,
Yeah, the latter (right click the picture control). All my images are the same size so this should be OK, but I could do this programmatically as well. So is this just because of the picture control? The bottom line is that I'm going to draw a circle over the image, and it needs to be located properly down to the pixel. For example, if I want a circle center coord at 10,10, do I need to add any pixels to accommodate some sort of boundary added by the VIs I'm using?
Thanks
It is better to set the drawing area to the size of the image.
Ben64
02-02-2016 04:13 PM
COULD YOU SEND YOUR VI IN LOWER VERSION ?
also why you do not use vision toolkit for this propose
02-02-2016 04:28 PM
@Hatef wrote:COULD YOU SEND YOUR VI IN LOWER VERSION ?
also why you do not use vision toolkit for this propose
Who are you responding to?
Why would someone use the vision toolkit which is a pricey addon when it isn't needed in this case?
02-02-2016 08:03 PM
Hi RavensFan
as I understand this friend just want to know image resolution for some processing
so I think may this vi in image help him
also my labview version is 2012 so I could not open mattstiles vi because it is in 2015 so i ask him if he could send vi with previous versions
02-03-2016 01:23 AM
@Hatef wrote:Hi RavensFan
as I understand this friend just want to know image resolution for some processing
so I think may this vi in image help himalso my labview version is 2012 so I could not open mattstiles vi because it is in 2015 so i ask him if he could send vi with previous versions