08-30-2018 10:58 AM
Hello,
I am stuck with one simple thing help me out with that please.
Actually, I am capturing the beam image. On that image I detect the particle and I have all the particle parameters (left, right, top, bottom, height, width of the bounding box). I want to expand the size of bounding box/ rectangle/ ROI.
How can I impalement this logic?
Any suggestions are helpful.
Thanks
Solved! Go to Solution.
08-30-2018 11:22 AM
We need more information:
1. Are you using an NI product such as the Vision toolkit for this, or a 3rd party library? Or is it all your own?
2. Where exactly is the problem? What is stopping you from expanding the box? What have you tried?
3. Can you post the code you're trying to use showing us what you've done so far?
08-30-2018 11:32 AM
Hello,
1. I am using NI Vision tool kit.
2. Exactly problem is I couldn't figure out the logic. if I want to expand my search area. Need a help to figure out the logic>
3. Here, I have attach the picture of my code and the image which i am using.
Thanks,
08-30-2018 09:33 PM
Sorry, I don't look at pictures of code, it's just too frustrating. You do realize how ROIs work, don't you? What shape is your ROI? If it's a simple shape (rectangle, circle), expanding it is just simple math.
Bob Schor
08-31-2018 10:02 AM
Hello,
That's Fine.
I know how ROI is working. but the problem is I couldn't think about the simple math which help me to expand the ROI.
ROI shape is rectangle.
if I want to expand my ROI by 3 times then what logic I have to use?
ROI size-
Left=2132
TOP=2128
Right=2169
Bottom=2166
Width= 24
Height=26
* all the values are in pixels.
Please suggest some logic it would be really helpful.
Thanks.
08-31-2018 10:15 AM
Given L, R, T, B, you can locate the center easily: (L+R)/2, (T+B)/2, or the mean between Left and Right, Top and Bottom. You can get the Width and Height also easily: W = R-L, H = T-B.
Now, you want the Center to stay the same, but the Width and Height to triple. Take pencil and paper, draw a picture, label L, R, T, B, W, and H, then work out the (very simple) equations to get L', R', T', and B' for the rectangle with the same center and triple the dimensions (in terms of L, R, T, and B). Now code it in LabVIEW. Then test it and confirm that it works.
If it does not, post your code (the VI, not a picture) here and we'll find the mistake. But you must try it first!
Bob Schor