From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need a ROI of FIXED Size


@MarcoMauri wrote:

Hi!

 

Try this one.

 

I'm capturing the mouse click and creating on the fly a rectangular ROI of a given size.

 

Regards,

Marco

 

p.s. change the X and Y size of a ROI to a value different from 0... I forgot to update  the default value.



Hi Marco,

Thanks a lot. It is working very well. I able to code with help of your reference vi attached in your post.
NOw I am facing another problem -

"Error -1074396154 occurred at IMAQ WritePNGFile


Possible reason(s):

IMAQ Vision:  The image is not large enough for the operation."

Even after cropping a 100X100 ROI I am getting this message from a IMAQ Write File 2 vi. It has been used to save the cropped ROI.
I am trying hard to fix it.
I shall be thankful if anyone can pu some light on it.

Thanks.

0 Kudos
Message 11 of 19
(1,385 Views)

Hi sukhiray, please attach your code which is generating the error. I tried to save mine for 2012, let's see if it works:

0 Kudos
Message 12 of 19
(1,370 Views)

@Gregory wrote:

Hi sukhiray, please attach your code which is generating the error. I tried to save mine for 2012, let's see if it works:


Thanks gregoryj for your support. These are openable.

Now the previous problem has been solved. Presently I am getting trouble in saving the cropped ROI. See the attached code, The last vi to save image is returning error. I have attached the code and error snapshot.
I shall be thankful if you can help me to findout the problems or mistake in my codes.

Thanks again for your active participation.

 

Download All
0 Kudos
Message 13 of 19
(1,350 Views)

I use another method with more flexibility test this vi too

 

0 Kudos
Message 14 of 19
(1,337 Views)

 


@Hatef wrote:

I use another method with more flexibility test this vi too

 


Thanks Hatef.

It is also working good but it is adding fill color which is not required.
Till thank you very much for your support.

0 Kudos
Message 15 of 19
(1,296 Views)

there is the control in vi that you can select three method for roi

frame

highlight

and fill

chnge fill to frame for not filling

0 Kudos
Message 16 of 19
(1,282 Views)

HI all, Thanks for your support.
My code is runnign well with floating ROI of user defined size.
Now I am getting an odd problem with IMAQ readfile vi. Sometimes it is working really good but next day it is showing error like -

------------------------------------------------------------------

Error -1074395995 occurred at IMAQ ReadFile

 

Possible reason(s):           IMAQ Vision:  File not found.

-------------------------------------------------------------------

 

I am really confused. Can anyone help me to understand this?

0 Kudos
Message 17 of 19
(1,256 Views)
vi please
0 Kudos
Message 18 of 19
(1,243 Views)

VI can't be uploaded as it is part of a big program and extracting that part will includes a huge hazzard.

I have solved this problem by designing my own VI for the same.

0 Kudos
Message 19 of 19
(1,218 Views)