LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem Saving overlayed image

Solved!
Go to solution

Oops, that signature should have said --

 

Bob Schor

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

Hey Bob, sorry i was on Holiday.

I tested your VI and it works like expected. I can now save overlayed Image. But i am getting a Problem now due to the "merge overlay Funktion". My VI takes more time to overlay and Show on the pannel (10*time). I think this happens because i am overlaying a rectangle on every Pixel which is greather than my threshold. Can you give me an Idea how i can overlay a rectangle using an Array of value for his Dimension? That means i will like to overlay a rectangle on the Pixels which are greather than the threshóld, but now i am overlaying a rectangle on each of These Pixels.

Thank you for your help.

Idrissou

 

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

@moidrissou wrote:

Hey Bob, sorry i was on Holiday.

 


... and I'm sitting in a Hotel a thousand miles from home with my laptop on my lap.

 

So I don't really understand what it is that you are trying to do, and why you are having so much difficulty.  However, I do notice that you are doing two of the "more complex" things that LabVIEW offers, namely (1) Image Processing and (2) "Remote Processors", a category that includes LabVIEW RealTime and processing on things such as myRIO.

 

I have a suggestion.  Get an Image typical of the Images that you want to process with the myRIO and save it as a PNG.  Write a little 4-5 function VI that runs on your Host machine (i.e. your Desktop or Laptop computer) that (a) reads the PNG using IMAQ ReadFile and displays it on an IMAQ Display indicator.  Do you know how to use the Rectangle Tool to draw a rectangular Region of Interest on your Image?  If so, draw such a suitable ROI.  Now, look at your Image (with one rectangle) -- is this typical of what you are trying to do?  Does your Image, as you interpret it, have many such "Regions of Interest"?

 

It is much more straight-forward to develop and test your Vision routines on your Host machine than on a Remote myRIO.  I'd strongly advise you to go through the exercise described above, and once you've drawn the ROI, see if you can figure out how to save the new Image+ROI (as I recall, the code is similar to saving Image with Overlay).

 

Then post the following:

  1. Original PNG.
  2. PNG of Image + ROI Overlay.
  3. Code used to read PNG and save ROI Overlay (should not take very many functions).

This gives us (and me) something to look at to better understand what you are trying to do.  With a pair of Data Images we can look at, you can now say what you want to do about creating more rectangles.

 

If we see the underlying Image and what you designate as an ROI, we might be able to suggest other/faster ways to get the ROI.  Also, depending on the situation, you might find that "doing this by hand" makes more sense than doing this on a myRIO with no interaction.

 

And why do it on a myRIO, anyway?  Wouldn't a modern PC be faster?  [I actually have no idea about the answer to this question, as I haven't been a Good Scientist/Engineer and done the test ...].

 

Bob Schor

0 Kudos
Message 13 of 19
(992 Views)

mantapp bgt gan...sharring yuks obat mata minus

0 Kudos
Message 14 of 19
(981 Views)

Hey Bob,

I am already able to overlay a part of my Image and save it, using your last solution.

For a better Illustration of what my Problem is, i attached you 5 Pictures.

as you recommended it to me, i am working on my Computer without myRio and without the Camera.

1) I am subtracting two similar Images: abs(Im_A - Im_B)

2) The result of the subtraction is called Im_Dif.  i want to overlay on Im_A the Pixels of Im_Dif which are not 0.

3) Im_A_Highlight Shows you how the overlay must look like.

4) the Problem i have is that i am overlaying each Pixel>0, which takes too much time. Im_A_overlay Shows you how i am overlaying until now.

5) that means I will like to overlay a rectangle on every part of Im_A which appears in Im_Dif.

 

I will be very thankfull if someone has an idea how i can implement it.

0 Kudos
Message 15 of 19
(972 Views)

Thanks for the pictures, that's very helpful in defining the problem and some possible ways to proceed.

 

Leaving aside (for now) how you get Images A and B, it looks like your Image Diff defines two areas where you could define "Regions of Difference" and basically create a binary Image (i.e. the pixel is either On or Off) that corresponds to the region (which is Image Diff where any difference = 1 and no difference = 0).  You've now reduced your problem to taking this Binary Image and determining how many "Regions" there are (here I would say there are two, with the one at the bird's head being a single region defined by the boundary of the "different" pixels).  Now we are getting into elements of Machine Vision, something LabVIEW also can do, but not something with which I have much experience.  However, there is a recent book, "Practical Gude to Machine Vision Software" (subtitle "An Introduction with LabVIEW") by Kwon and Ready, published by Wiley, that discusses using LabVIEW to solve problems like this.

 

Bob Schor

0 Kudos
Message 16 of 19
(965 Views)

Thank you for your Replies. I will developp a vi using your method and let you know if it works.

Thank you very much for your time.

idrissou

0 Kudos
Message 17 of 19
(955 Views)

And i have this book 🙂 but i dont know if will solve my problem

0 Kudos
Message 18 of 19
(953 Views)

the key is use " IMAQ Merge Overlay.vi" to destroy the overlay on a image,then use "IMAQ Write Image And Vision Info File 2.vi" save the PNG image file with the overlay info.that is my need,thanks.

0 Kudos
Message 19 of 19
(890 Views)