atduskgreg / opencv-processing

OpenCV for Processing. A creative coding computer vision library based on the official OpenCV Java API
Other
1.33k stars 462 forks source link

Problem with frame difference #79

Open kasperkamperman opened 9 years ago

kasperkamperman commented 9 years ago

I try to do a simple frame difference. I know I can do it with Processing directly, however I wanted to try it with OpenCV (also because of threshold, flip and more functions).

I found that diff returns a difference even when you compare two the same images. I tried also the diff function that compares two OpenCV Mat objects, that works better.

Any idea if this is a bug, or I make a thinking mistake?

framedifference problem (special script to compare two the same images): https://gist.github.com/kasperkamperman/b0a412d2a0a99f002856

difference found when comparing the same image

Mat version that works, however I have some problem with the toCV function and to create a new Mat: https://gist.github.com/kasperkamperman/0605812c7fb35515ac6c

tocv function

I hope I post on the right place (was in doubt to post this in the comments of your blog or overhere).

Version info: OpenCV for Processing 0.5.2 by Greg Borenstein http://gregborenstein.com Using Java OpenCV 2.4.5.0 Processing 3.0a4

jorditost commented 9 years ago

I experienced the same problem some weeks ago using the diff function (I didn't try it directly with the Mat).

Is there some reason / explanation?

On 19 May 2015, at 22:43, kasperkamperman notifications@github.com wrote:

I try to do a simple frame difference. I know I can do it with Processing directly, however I wanted to try it with OpenCV (also because of threshold, flip and more functions).

I found that diff returns a difference even when you compare two the same images. I tried also the diff function that compares two OpenCV Mat objects, that works better.

Any idea if this is a bug, or I make a thinking mistake?

framedifference problem (special script to compare two the same images): https://gist.github.com/kasperkamperman/b0a412d2a0a99f002856

Mat version that works, however I have some problem with the toCV function and to create a new Mat: https://gist.github.com/kasperkamperman/0605812c7fb35515ac6c

I hope I post on the right place (was in doubt to post this in the comments of your blog or overhere).

Version info: OpenCV for Processing 0.5.2 by Greg Borenstein http://gregborenstein.com Using Java OpenCV 2.4.5.0 Processing 3.0a4

— Reply to this email directly or view it on GitHub.