Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with ROI definition

Hi,

I have a question about FFT image via NI vision.

I've a programm in C#, which use NI vision, and a camera which are displaying an image on a human-machine interface.

My HMI displays also an FFT image of an ROI in the image camera. But i have a problem with this FFT when I define a "small" ROI (with a drag and drop). Indeed, the FFT image show a pixelized image like what we see in this image "bug FFT.png". But this problem appears not at all time, I think it appears only when I define a new ROI (If I use a predefined ROI, so not with the drag and drop method, and I load the same ROI at different point, there is a bug only when I change the ROI)

I dont' know why this "small" ROI is a problem, is there someone who have an explanation? An idea? Is the drag and drop event the problem?

0 Kudos
Message 1 of 4
(3,054 Views)
may be because you your drag and drop is irreverent from your loop that calculate fft
may be some thing like event structure that force your loop to stop and calculate your fft after you finish drag an drop could help your problem
0 Kudos
Message 2 of 4
(3,033 Views)

Why not, but when I use 2 types of FFT for the same image:

- the first, classical FFT, has no problem with the ROI.

- the second is an average FFT, and the problem only appears with this average FFT.

The difference between the two is the size I think, because my Average FFT is an average of 5 images.

0 Kudos
Message 3 of 4
(3,023 Views)
 
_imageCount = value;

_imageCountFactor = new PixelValue(1 / (float)_imageCount);
         
 
var LastImage = RefreshBuffer(NewImage);

NationalInstruments.Vision.Analysis.Algorithms.Subtract(_buffer, LastImage, _buffer);

NationalInstruments.Vision.Analysis.Algorithms.Multiply(_buffer, _imageCountFactor, _buffer);

NationalInstruments.Vision.Analysis.Algorithms.Add(Sum, _buffer, Sum);
LastImage.Dispose();
 
 
I don't know why I multiply by the inverse when I can just divide? Why using inmagecountfactor when the imagecount is eaiser?
0 Kudos
Message 4 of 4
(2,987 Views)