07-10-2014 07:48 PM
Hi NI community
I am facing problem with changing values of mask.
My prgram is as follows
1) Converting image into binary
2) Choose ROI over image
3) Count number ones in ROI
When I am choosing larger ROI it is showing less pixels than small ROI . I have attached my problem picture, see there when I chose large ROI values I am getting smaller values wrt to smaller ROI.
I will appreciate your help
07-11-2014 12:21 AM
Hello,
please put a probe/indicator right after the summation (and before the addition). What are the values for both cases?
Why do you add the local variable "Total pixels" to your calculations? Also, why do you have so many local variables in general. You will get into troubles with that...
Your calculations are way off. Just by looking at the number of calculated pixels (3 million pixels) and your image size is 512x512 (262144 pixels, so if all are 1, the sum is equal to this), you can see that something is not ok.
Best regards,
K
07-11-2014 04:34 PM
Thank you for your reply.
Here I am reading volume of 512*512*512 binary matrix that why count is very high . I am taking ROI over these each binary image and counting number of ones, as we sum up all ones so we will get number of pixel.
It is calculating proper for samll ROI, but when I choose large ROI it shows less count than small ROI . Is there any modification IMAQ mask do with image.
Actually this is part of program, my main program constitite 4 to 5 tabs and many frames and for loop. In such condition it is difficult for me use wire for connection.
07-14-2014 07:20 AM - edited 07-14-2014 07:21 AM
Hello,
I think I see what your problem is. Try casting your array to double before you sum the elements.
Best regards,
K