1

I have been looking into the possibility of subtracting two images in Bytedeco/JavaCV. The objective is to perform what is suggested by Dat Chu for OpenCV but in JavaCV. Unfortunately, direct subtraction of Mat variables appears to be not possible.There are other more complex substitutes available such as performing a background subtraction via Mixture of Gaussian and Bayesian inference but again, only in OpenCV. Moreover, these background subtraction techniques appear to have a higher performance overhead compared to simple, direct subtraction. One alternative I have tried is to iteratively go through pixel-by-pixel via a UByteRawIndexer and perform a Hamming distance-based count but it would have been concise if an existing method was already available.

User
  • 108
  • 1
  • 6
Psi-Ed
  • 683
  • 1
  • 9
  • 22
  • If you want to work in Java why don't you use the OpenCV java port... or if you are working in JavaCV why don't you create the function like in the examples? in OpenCV I would recommend to use absdiff, you may get problems with underflow.... If the structure is the same, the data is organized in RGB RGB RGB sequences, unless that it is greyscale. And each of them is a byte... it should be possible to substract directly but taking care of possible underflow – api55 Oct 20 '17 at 11:24

0 Answers0