Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

per-element max of channel 1 with copy of channel 2 ? (java)

I need to implement something like this:

  • do a per-element max() for two not-equal-sized matrices a, b into a result matrix c [that is: c[i]=max(a[i],b[i])]
  • remember if a or b provided the max value (in a second channel of c or in a new matrix d)
  • alternative to second point: have channel 2 of a or b copied to channel 2 of c, depending if a or b provided the max value (in channel 1)

Is there a good way to use opencv functionality for this? (NB: I'll implement in java, but I guess my question is language-independent.)

per-element max of channel 1 with copy of channel 2 ? (java)

I need to implement something like this:

  • do a per-element max() for two not-equal-sized matrices a, b into a result matrix c [that is: c[i]=max(a[i],b[i])]
  • remember (separately for each element) if a or b provided the max value (in a second channel of c or in a new matrix d)
  • alternative to second point: have channel 2 of a or b copied to channel 2 of c, depending if a or b provided d) (this is the max value (in channel 1)interesting part for me)

Is there a good way to use opencv functionality for this? (NB: I'll implement in java, but I guess my question is language-independent.)