Ask Your Question
0

background processing in binary images

asked 2014-10-02 13:30:52 -0600

matman gravatar image

I want to know if in an binary image or an segmentation image the background pixels are neglected to speed up the processing with objects which are not equal to zero.

I worked with a commercial library that makes a list of non-zero grayvalue coordinates and it speeds up processing the more, the less foreground object pixel relative to image size exists.

I hope I could explain my problem, english is not my native language.

thanks

matman

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-10-02 14:30:06 -0600

rwong gravatar image

Some operations support a "mask matrix", which will selectively write-back the result to the destination according to the mask value. Not every element-wise matrix operation support this option. Is this what you are looking for? Search for "mask array"

In addition, in OpenCV one can create a rectangular "sub-matrix" out of a parent matrix. The pixels will map to the same underlying memory addresses. Any pixel data read from or written to the sub-matrix, will be reflected or become visible to the parent matrix. Search for "region of interest" (ROI). Below, I will explain why this rectangular ROI is much more useful.

As for speeding up, note that OpenCV uses SIMD (short vector processing) on some CPU architectures such as x86 (SSE2) and possibly ARM (NEON).

With SIMD processing, there will be no reduction of computation efforts from applying per-pixel masking. However, rectangular region-of-interest will still be able to reduce computation effort with SIMD.

If you approach this question from a vendor-selection perspective, I strongly encourage you to write and optimize some benchmarks for each library, and compare their performance in a scientific and unbiased way. My suggestion is that a side-by-side library feature comparison might not be useful.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-10-02 13:30:52 -0600

Seen: 329 times

Last updated: Oct 02 '14