- Finding a number to particular value:
- example: Here if we want to find ratio close to 0.7 then we will look for ar for the current image to be close to 0.7.
ar = imgBB.width/imgBB.height
tmp = abs(aspect_ratio - ar);
[val, idx] = min(tmp);
if (idx == 2) then print .... found it.
No comments:
Post a Comment