accelerate-framework

Accelerate - Lower the threshold for contrast stretching

ぃ、小莉子 提交于 2020-07-07 09:07:09
问题 I am using Swift and Accelerate and am trying to color-correct an image using the vImageContrastStretch method available in Accelerate's vImage module. When I try to stretch the histograms I get a result which does do exactly what I want, but it is a bit too relaxed. The resulting image histograms still have unwanted space on the sides. As you can see in the image, the result of the vImageContrastStretch (middle) operation still has some room for snipping on both sides of the histogram

Swift Linear Interpolation and UpSampling

杀马特。学长 韩版系。学妹 提交于 2020-06-13 09:20:20
问题 I have a stream of metrics that are unevenly sampled. I want to linearly interpolate and upsample these metrics to a specific sampling frequency. I have tried to use the Accelerate Framework and the SIMD framework but I am not really sure what to do. The problem itself is as follows: let original_times:[Double] = [0.0, 2.0, 3.0, 6.0, 10.0] let original_values: [Double] = [50.0, 20.0, 30.0, 40.0, 10.0] let new_times:[Double] = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] So I am

CMake is not able to find LAPACK sgemm on macOS

生来就可爱ヽ(ⅴ<●) 提交于 2020-05-16 22:36:27
问题 I'm trying to compile this code, but when running cmake .. in the build folder I get the messages: -- Looking for Fortran sgemm -- Looking for Fortran sgemm - not found -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Looking for Fortran dgemm -- Looking for Fortran dgemm - found -- Found BLAS: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System

Apple Accelerate Framework scale and normalize a vector

浪子不回头ぞ 提交于 2020-05-12 02:48:58
问题 What functions can I use in Accelerate.framework to scale a vector by a scalar, and normalize a vector? I found one I think might work for scaling in the documentation but I am confused about it's operation. vDSP_vsma Vector scalar multiply and vector add; single precision. void vDSP_vsma ( const float *__vDSP_A, vDSP_Stride __vDSP_I, const float *__vDSP_B, const float *__vDSP_C, vDSP_Stride __vDSP_K, float *__vDSP_D, vDSP_Stride __vDSP_L, vDSP_Length __vDSP_N ); 回答1: The easiest way to

vImageBoxConvolve: errors when kernel size > 255

北城余情 提交于 2020-02-05 03:53:36
问题 Is anyone else having any problems when the kernel size > 255? The error I'm getting looks like the color channels are overloading...but only when kernel size is > 255. The documentation says nothing about the limits of the kernel size. And vImage is not returning an error. BTW, I'm using vImageBoxConvolve_ARGB8888. It happens on any image, and specifically in the white areas. Here's an output: That multicolor mess in the top left is really just a bright background. Seems odd that with all

Objective-C Peak Detection Accelerate Framework

十年热恋 提交于 2020-01-01 19:57:34
问题 I am a no math guru here, so I want to ask anyone familiar with Digital Signal Processing, what is the best way of detecting real time peaks. I get about 30 frames/values a second and I've tried to implement the slope algorithm for detecting peaks, it worked OK, about 80% of the cases, but its really not good enough :(. From what I've searched one should use the Fast Fourier Transform, but I have no idea how to get started with it, perhaps I'm missing the general idea of how I should use FFT

vDSP_zrvmul not returning any results (or all zeros)

血红的双手。 提交于 2019-12-24 07:58:41
问题 I have tidied my code up and condensed it to make it readable, as per another users comments. I have a complexFloatArray class, to store arrays of Complex vectors class complexFloatArray { var reals: [Float] var imaginaries: [Float] init(reals: [Float], imaginaries: [Float]){ self.reals = reals self.imaginaries = imaginaries } } I then have some functions defined in extensions to this class. One being: func useAsDSPSplitComplex<R>(_ closure: (inout DSPSplitComplex) -> R) -> R { return reals

Hilbert Transform (Analytical Signal) using Apple's Accelerate Framework?

纵饮孤独 提交于 2019-12-24 04:11:37
问题 I am having issues with getting a Matlab equivalent Hilbert transform in C++ with using Apple's Accelerate Framework . I have been able to get vDSP's FFT algorithm working and, with the help of Paul R's post, have managed to get the same outcome as Matlab. I have read both: this stackoverflow question by Jordan and have read the Matlab algorithm (under the 'Algorithms' sub-heading). To sum the algorithm up in 3 stages: Take forward FFT of input. Zero reflection frequencies and double

Hilbert Transform (Analytical Signal) using Apple's Accelerate Framework?

爱⌒轻易说出口 提交于 2019-12-24 04:11:17
问题 I am having issues with getting a Matlab equivalent Hilbert transform in C++ with using Apple's Accelerate Framework . I have been able to get vDSP's FFT algorithm working and, with the help of Paul R's post, have managed to get the same outcome as Matlab. I have read both: this stackoverflow question by Jordan and have read the Matlab algorithm (under the 'Algorithms' sub-heading). To sum the algorithm up in 3 stages: Take forward FFT of input. Zero reflection frequencies and double

Setup the accelerator framework for fft on the iPhone

馋奶兔 提交于 2019-12-23 05:11:35
问题 I have set a function to setup the accelerator, after i have read : Using the Apple FFT and Accelerate Framework iPhone FFT with Accelerate framework vDSP and apple docs. i did this : void fftSetup() { COMPLEX_SPLIT A; FFTSetup setupReal; uint32_t log2n; uint32_t n, nOver2; int32_t stride; uint32_t i; float *originalReal, *obtainedReal; float scale; uint32_t L = 1024; float *mag = new float[L/2]; log2n = 10 ; n = 1 << log2n; stride = 1; nOver2 = n / 2; printf("1D real FFT of length log2 ( %d