From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to crop an image using points from pattern matching?

Hi,

 

I recently started using vision assistant and am trying to crop an image using 2 points (upper right, lower left corners) that I located with the pattern matching function. Using the image mask function, it seems that I can only do this manually though.  Is there any way that I can use my reference points to crop the image automatically?

 

Thanks,
Tei

0 Kudos
Message 1 of 5
(5,451 Views)
Hello,

is pattern matching only shift invariant? Take a look at IMAQ Extract function. Mind the order of the coordinates input.

Best regards,
K

https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 2 of 5
(5,437 Views)

Hi,

 

Unfortunately, in Vision Assistant, not many functions support using results from previous steps.

However, the Run LabVIEW step does, and you can create a simple LabVIEW VI that extracts the image, using IMAQ Extract suggested by Klemen. Create an image control and numeric controls (x1, y1, x2, y2) that you connect to the connector pane. Use these controls in the VI to extract the region.

Follow the instructions on the FAQ page to save the VI for source distribution, so that it can be called from the Vision Assistant executable.

Then call it using the Run LabVIEW step in Vision Assistant. From the VI Controls tab, you can associate your previous pattern matching results to the input of the VI, and the image control to the current image.

 

Sorry it's not more straightforward....

 

Best regards,

 

Christophe

0 Kudos
Message 3 of 5
(5,423 Views)

HI SIR HOW TO CROP DISEASES IDENTIFY NORMALCROP, DISEASES HIG HOW TO INDICATING PLEASE SEND THE PROGRAM  SIR PLEASE SIR

 

                               THANK YOU

       

            I AM WATTING SIR PLEASE SEND THE PROGRAM6

 

0 Kudos
Message 4 of 5
(2,745 Views)

I think you might struggle with NI Vision. In LabView I use IMAQ extract tetragon. ROI coordinates need to be transformed into tetragon coordinates for the input to this VI, but this is relatively straightforward. It is easy to save your NI Vision script as a VI and then add the IMAQ extract tetragon VI. 

 

Simon

0 Kudos
Message 5 of 5
(2,719 Views)