10-21-2010 03:04 PM
Need a little help with a simple problem.
I'm working on an image correlation project where the end result is an array MxN
all of the values of my array vary between -1 and 1 and I need to extract the indexes (row and colum) of this 2D that are greater than or equal to 0.9.
The row corresponds to a specific point of an intensity graph and the colum to a point on another image.
Any guesses as to how to extract my indexes?
Thanks in advanced
10-21-2010 03:36 PM
Use a nested while loop? Have you attempted this problem?
10-21-2010 04:25 PM
Hi Bruno,
I attached a quick vi showing how to do this. The first part generates a 2D array while the second part of the flat sequence generates row and column values. I did look at Search and Threshold 1D array, but couldn't come up with anything.
Hope this helps.
Rick
10-21-2010 04:43 PM
Sorry. This one will run on LabVIEW 8.0+
Rick
10-21-2010 04:51 PM
This seemed to have been a university course problem, and there was no apperent attempt at the problem. Why are source code answers being given?
10-21-2010 05:13 PM
@Been bitten by LabVIEW wrote:
This seemed to have been a university course problem, and there was no apperent attempt at the problem. Why are source code answers being given?
Maybe the example answer given above is a trap?! 😄
From a first glance, it is buggier than an ant farm and overly complicated and inefficient 😮
10-21-2010 05:18 PM
Hmmmm, well I never looked at it since I can't read anything above 7.0 at the moment. Enjoy.
10-22-2010 08:11 AM
The code was not meant to be perfect as it was thrown together in just a few minutes.
The sequence was just to show that the two are seperate.
There was no need to initialize the shift register to demostrate a point.
Yes, I have heard of auto-indexing, it is used to build the 2D array. For some reason I was running into problems with the second loop.
Maybe next time your comments can be more constructive instead of bashing other peoples' example code.
How unprofessional for a professional site.
Rick
10-22-2010 12:00 PM - edited 10-22-2010 12:07 PM
rpage wrote:
Maybe next time your comments can be more constructive instead of bashing other peoples' example code.
How unprofessional for a professional site.
I agree that it is quite unprofessional to throw out example code that is highly flawed and showcases bad coding habits. The new users here seeking advice deserve better. I am serious! I can guarantee you that the users will run the code more than once, so having the uninitialized shift register can lead to serious confusion.
Thus my constructive criticism, mentioning some of the flaws. 😄 There was no bashing intended, and if you feel I did, I am sorry. Maybe I will use a few more smileys next time. :):):)
Here's how it should have looked like. I would guess it would have taken faster to code because there is less code to do the same thing. (no index array, no need to wire the N's of the second loop, no flat sequence, fits on a laptop screen, ...)
I am by no means perfect, for example I misspelled one of the indicator terminals 😄
10-22-2010 01:12 PM
@altenbach,
Yes, I should have cleaned it up better. Sorry for the snappy attitude. The day had not started out well and I obviously took your comments in a way that you had not intended. Thanks for clarifying with the image. When you were talking about auto-indexing, I assumed that you were talking about my use of shift registers instead of auto-indexing to come up with the final results.
Rick