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: 

Draw rectangle using min and Max values

Hello Everyone, 

 

I am strugling almost for one week and tried many ways as well but still could not figure out answer my question yet. I do apologies for all my post, I am not good in LabVIEW and only using this for last 4 months. 

What I am trying to do is finds the limits of my image like Xmin,Ymax etc and draw the rectangle accordingly to the limits and this algorithm can works for any image. After that calculate the area of the drawn rectangle.  Is this possible? Please someone help. 

 

I have onemore thread of very similar question which is http://forums.ni.com/t5/Machine-Vision/Find-Xmin-Max-and-Ymin-max-Please-Help/td-p/2391686. All my code can be seen on this thread. Bruce is very helpful but still I am unable to solve the problem. Please Help me. I have only this week to finish this and submit my report. Please help. 

 

Or If anyone can guide me how I can use this image into Matlab script to find these limits, can I code myself but only guide me how I can use matlab script. 

 

Thanks 

lazer

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

Hi lazer,

 

My understanding of the problem is as follows:

 

-  You have located each individual cell of your solar panel with rectangular regions of interest.  

 

Which of the two detection methods did you choose from the advice that ChristopheC gave you?  Are you using the Edge Detection method or the Contour Analysis method?

 

-  You now want to calculate the area of the whole solar panel.  To find the area of the whole solar panel, you are trying to calculate the corner coordinates of each rectangular region of interest to then determine the corner coordinates of the overall solar panel.  You could then calculate the area of the overall solar panel.  So far you have been using IMAQ Particle Analysis to determine these coordinates.

 

Is there a particular reason why you need to locate each individual cell of the solar panel rather than locating the whole solar panel to calculate its area?  I agree with Bruce that you should not need to re-write the algorithm for the IMAQ Particle Analysis VI to locate these coordinates.

 

What problem are you currently experiencing when using the IMAQ Particle Analysis VI?

Marshall B
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 6
(3,926 Views)

Hello Marshell, 

 

Thanks for reply.

 

I did not use advise methods by Christopher because those methods required ROI manually and my project is based on autonomous measurements however they are very useful tools and Christopher was very helpful as well. 

 

I need to define my co-ordinates limits which will indicate the active area of the image, therefore I am trying to find these points. At present there is no issue with particle analysis VI. It is only me who can not implement the ideas into LabVIEW. I have all the information and know I am almost there but can not draw the rectangle around the solar image. I have spent whole week and so far didn't get my outcome. 

 

Thanks

 

 

 

 

 

 

 

 

 

 

 

 

 

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

Hi Lazer,

 

I am slightly confused as to why the Edge Detection method is not working for you.  In my opinion, this would be a better tool to use to identify the boundaries of each solar module and provide a basis on which to then calculate the area.  

 

What problems were you having when specifying your ROI?  To my mind, you should be able to set a constant ROI within your code for the IMAQ functions to look at.  Provided that this ROI surrounds enough of the image, the Edge Detection method should work for every solar module you then wish to investigate.  From here you could quite easily calculate the area of the rectangle  There should be no need for a manual ROI input for every image.  What behavior were you seeing when using Edge Detection?

 

I would also consider pattern matching.  This method requires a reference image of the object you are searching for (in this case, your solar modules) and is independent of position, orientation and multiple instances of objects.  You could use the identified region from this technique as a basis for your area measurements.

 

Let me know if this helps.

Marshall B
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 4 of 6
(3,900 Views)

Hello Marshell, 

 

Thank you very much for this kind help. I have done this in Matlab. I saw matlab option in math sricpt which make my life very easier. I tried my best to utilise the edge detection tool but could not make it. The reason behind it is me, I am using LabVIEW for last 4 months and still struggling. 

 

Many Thanks 

Lazer

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

Hi Lazer,

 

That is not a problem.  I am sorry you have struggled to get it working with IMAQ.

 

You may find it useful to sit some of our online training courses for LabVIEW, DAQ and RIO.  These skills translate to all areas of LabVIEW programming, including Vision.

 

Another tool you could use for future reference is the NI Example Finder in LabVIEW (Help >> Find Examples...).  From here you can search for Vision examples that use methods such as Edge Detection and Pattern/Geometric matching.

 

Marshall B
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 6 of 6
(3,885 Views)