FastLocalCorrelationCoefficients.jl
Fast computation of local (Pearson) correlation coefficients for arbitrary size tensors of real and complex numbers.
Install / Use
/learn @pitsianis/FastLocalCorrelationCoefficients.jlREADME
FastLocalCorrelationCoefficients.jl
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.
Full documentation of latest release can be found here
Overview
Computing locally normalized correlation coefficients (also known as Pearson correlation coefficients) is a basic step in various image-based data or information processing applications, including template or pattern matching, detection and estimation of motion or some other change in an image frame series, image registration from data collected at different times, projections, perspectives or with different acquisition modalities, and compression across multiple image frames.
The Fast Local Correlation Coefficients (FLCC) Package FastLocalCorrelationCoefficients.jl
computes the Local Correlation Coefficients between a template (the needle) and all sliding subframes of a frame (the haystack). The maximum values of the LCCs correspond to the subframes that are most similar to the template. The implementation supports arbitrary dimensional tensors with real or complex values.
For example:
julia> using FastLocalCorrelationCoefficients
julia> haystack = rand(ComplexF32,2^5,2^5,2^5,2^5);
julia> needle = rand(ComplexF32,1) .* haystack[10:14, 11:15, 12:16, 13:17] .+ rand(ComplexF32,1);
julia> c = flcc(haystack,needle);
julia> best_correlated(c)
CartesianIndex(10, 11, 12, 13)
The computational complexity of flcc is ${\rm O}((m+n)\log(m+n))$, which can be substantially faster than the direct lcc computation in ${\rm O}(m n)$, where $m$ and $n$ are the number of elements of the needle and the haystack, respectively.
Moreover, flcc allows the precomputation of common calculations when we search a haystack multiple times for needles of the same size, reducing the run time even further. No such optimization can be performed with the direct lcc computation.
For more information see:
-
X. Sun, N. P. Pitsianis, and P. Bientinesi, Fast computation of local correlation coefficients, Proc. SPIE 7074, 707405 (2008)
-
G. Papamakarios, G. Rizos, N. P. Pitsianis, and X. Sun, Fast computation of local correlation coefficients on graphics processing units, Proc. SPIE 7444, 744412 (2009)
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
