01-13-2020 01:45 AM - edited 01-13-2020 01:48 AM
Hello Suraj
The solution is pretty easy now. Use edge detection(maybe after binary conversion) to detect two lines-(left and right extreme lines). Find the distance between two lines, that is your length in pixels. Then convert the pixels to mm based on the calibration factor. calibration factor is the mm to pixel ratio.
-Rahul
Hit KUDOS for Thanks
01-13-2020 04:29 AM - edited 01-13-2020 04:30 AM
@Rahulbala wrote:
The solution is pretty easy now.
This task may appear to be easy, but could be tricky in detail.
in card2-26.png ... does the 26 tell us that there are 26 cards in this photograph?
The term edge detection may be misleading in this context.
I'd rather say you want to find local extrema in a profil line, somthing like this:
01-13-2020 04:57 AM - edited 01-13-2020 04:58 AM
I'd also go straight to a profile line.
That reduces the problem to non-vision. You now have multiple 1D arrays that can be processed. Then process the results of each profile, and you'll even have some sort of quality check. If most profiles give n, you're good. If some give n-4 others n+4, you have a spread and that's not good.
If the cards are always the same thickness, you can of course get the nr of pixels between background-stack-background, and multiply it with a calibrated pixel\width ration... I think just like Rahulbala proposed.
01-14-2020 03:58 AM
Taking a line profile may be a solution in most cases. If there is a dirt/black texture in the cards, and the pixel values might drop giving us a different count. If you are sure that there will never be such cases, then you can go with the line profile solution.
Edge detection might be misleading but I meant that you can use "Find Straight Line Edge" VI.
-Rahul
Hit KUDOS for Thanks
01-14-2020 04:33 AM
Of course conditioning the lightning will do wonders.
Note that in the first image, the left and right side of the stack is completely different. That will make the problem a lot harder. A consistent lightning, probably a (or multiple) diffuse or indirect source will work. Note that any AC source will not work, the 50 or 60 Hz current will result in 100 \ 120 Hz lightning, and the 25\30 Hz camera images will not reproduce well.