My query is why cant we intially set the min_dist closer to 0.7 rather than 100 , like why it is even necessary to consider the distance near 100 or large distance and getting their identity why cant we only focus on our minimum threshold (0.7)
The point is you want the loop to select whatever the minimum actually is and then you will make a decision based on that. The initial value just needs to be something high enough that any actual value will be lower than that. The 100 doesn’t last past the first iteration of the loop, right? The actual value you start with is meaningless really as long as it’s big: it could just as well be 42 or 1000000, right?
I guess you’re right at one level: if you just start with 0.7, then you’ll get your “no” answer if nothing goes below that. But the point is you are losing information if you do it that way: you don’t know how much you missed by. Maybe there was one picture that gave you 0.7001 and maybe the real answer is that 0.7 is not the right decision criterion based on your database.
What i thought is when we have a threshold value for min_dist why even initialize it with large number and get the the identities. Why not just check or consider images where images are below threshold and loop until we reach the lowest min_dist value.
Can you explain me “But the point is you are losing information if you do it that way” , like i did not understand this point how we are losing info as the one with large min_dist are not even of our interest right, so why to even start with large min_dist? like initial set min_dist around 0.8(smaller value)
The larger point is that the starting minimum is meaningless, as I stated. Why do you care about it, as long as it’s big? Then you watch all the values that you actually generate for real distances.
When you start the loop, you don’t have any distance yet, right? So how are you going to write that loop? What do you do with the first distance value you get? Do you save it or not? It’s the smallest you’ve seen so far, right? How do you know that? You can write a separate if statement to check for “None” or “loop count == 0” or you can write it with a fake big threshold the way they did.
This isn’t a big deal. They are just trying to keep the code a little bit simpler.