Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c++]

The tag has no usage guidance.

-1
votes
0answers
18 views

help to troubleshoot an implementation of compressed sensing using L-BFGS and c++

i'm trying to reimplement the tutorial : http://www.pyrunner.com/weblog/2016/05/26/compressed-sensing-python/ i'm using the optimisation library from (https://ensmallen.org), to be more specific the ...
1
vote
1answer
37 views

Signal in frequency domain with OpenCV dft

I am experimenting with cv::dft: a 1HZ sinus signal is generated, and displayed in the frequency domain. But for some reason it hasn't got the maximum component at ...
0
votes
0answers
104 views

What does opencv `mean` function do when passing a mask of zeros?

INTRO I am looking at this project to implement some changes. The project is written in C++ using openCV library. Its goal is to detect cars in parking area to calculate the number of free spots. It ...
1
vote
0answers
32 views

Is the behaviour of the following filter plausible?

I've designed a filter based on this equation $$ E(u) = \frac{1}{2}\int_{\Omega} \left[(u-f)^2 + g(\lVert \nabla u \rVert)\right]dxdy $$ Euler-Lagrange equations in this case are (should be) given ...
0
votes
0answers
48 views

Comparing Octave/Matlab FFT results against CPU FFT

I wrote a program which runs FFT from Intel MKL and am trying to compare its results with that of Octave, but things don't quite match. The program does: Populates a 1D array of, say, 1024 elements, ...
0
votes
0answers
31 views

Output of a bank of gabor filters, derive ellipses like regions

I'm trying to implement an algorithm that show how to detect wrinkles in clothes, without going to much into details this is the step that is confusing me. Assuming we have an image $I$ and a set of ...
-1
votes
1answer
1k views

Calculating the SNR of Audio Signal (Recommended Libraries)

Are there any open source packages or libraries available which can be useful in calculating the SNR(signal to noise ratio) of an audio signal. The input will be just an audio signal and I have to ...
1
vote
0answers
68 views

How to generate the amplitude of a signal with a certain power spectral density?

I am a newbie. If I posted a question someone else already asked, please forgive me. Thank you! Now, I have a power spectral density named $P(f)$ as a function of $f$. Let's say this function is ...
0
votes
2answers
195 views

Why Is Non Linear Least Squares Method from MATLAB and Alglib Gives Different Results on the Same Data?

i'm trying to rewrite my Matalab prototype for some DSP to C++ and encountering a displeasing problem. I'm trying to fit data to a function $y = a * (\pi / 2 + arctg(b * x))$. In Matlab it works well ...
0
votes
1answer
54 views

DSP using audio IO from PC using C++

This is my first question on dsp. I am looking for something very simple here and I am sure there are libraries that will do pitch recognition and FFT but my requirement is very simple. I have a PC ...
0
votes
1answer
55 views

Windows Audio WAVEFORMAT buffer BYTE to 16-bit int

I am trying to understand audio-buffer processing at the low-level for the first time. I have the following C++ code copying WAVE-format byte data from capture buffer of Window Core Audio (*ppData in ...
0
votes
0answers
129 views

How to read .wav file to n array [duplicate]

Can anyone provide a solution to move the value on a .wav signal into an array in C# or C++? I want to process the signal. Thank you.
0
votes
1answer
399 views

What exactly is “sparse representation”? [closed]

I saw a recommended topic for the final project in my university called "dsp and dip applications using sparse representation techniques (MATLAB, C, C++)". I consider taking this topic as my final ...
0
votes
1answer
204 views

Block normalization of histogram of oriented gradient

I am a beginner in image processing. I have some questions regarding HOG. https://www.learnopencv.com/histogram-of-oriented-gradients/ From this website, it mentioned that each element inside the ...
0
votes
0answers
36 views

Problems regarding training SVM light to detect human body in images

I am now working on a project about human body detection. In the project, I would like to use HOG descriptor which is written by my own using C++ to extract features from images 400 positive samples ...
2
votes
0answers
224 views

PortAudio: sound fade in/out by scaling sample data

I've done already some fade in or fade out effect in portaudio, but that is not working properly. My callback function: ...
0
votes
1answer
298 views

PortAudio: how to generate multiple sounds

I have simple wave generator in PortAudio. I'm creating single sine wave, and then I use a lookup sine to play it. Now I've stucked here. I have no idea how I can add another sine sound. Is it ...
0
votes
1answer
156 views

Programming the IDWT for image processing

I want to program the 2D inverse discrete wavelet transform (only 1 level) in the case of image processing. In the matlab website there's this diagram: now, I want to program the IDWT with haar ...
0
votes
1answer
398 views

Why entropy is undefined in low contrast image

I am trying to measure contrast of image by entropy of histogram of image. Code for computing entropy ...
0
votes
1answer
430 views

Implementation of the filter function (Matlab) C/C++

I am trying to apply some filtering in C/C++ code, I have designed an algorithm using Matlab and it works well, so now I am moving it to native code. I am ...
0
votes
1answer
52 views

Determining the pattern direction of a bitmap image

How can I obtain average direction of the pattern shown in the figure below. It is the direction of the red arrow relative to the yellow (horizontal) line. Any ideas for an approach? I couldn't figure ...
0
votes
0answers
165 views

How to create a smooth graph/waveform from AudioSignal?

I'm pretty new to dsp programming so if my question is bad please forgive me ;) So i want to "design" a smooth waveform from my Audio Signal. Actuall it look like this: //Edit: I played a little bit ...
2
votes
2answers
508 views

Find smoothed first derivative from signal with noisy slope

How can I get filtered first derivative from a noisy signal that has slowly changing slope in form of y=kx+b? k can slowly ...
1
vote
1answer
668 views

Using a Kalman filter to predict samples between measurements

(cross posted from stack overflow) I have a dataset where measurements were taken at 10 Hz, and I am trying to use a Kalman filter to add predicted samples in between the measurements, so that my ...
0
votes
1answer
302 views

How can i measure soundcard latency?

I want to write sonar/radar like sample application. For sake of simplicity (and not to use Arduino and specialized RTOS) - I simply used using audio in/out analog ports of a motherboard integrated ...
0
votes
2answers
987 views

Parameters of Gaussian Kernel in the Context of Image Convolution

Hi Everyone i am new at image processing. I copy code from this website, I have image $600 \times 480$ gray scale. What will be the value of standard deviation or $\sigma$? What will be the value of ...
0
votes
0answers
436 views

Distance from an object.. Where is the camera origine?

I compute the distance from an object (Chessboard) using OpenCv and my camera parameters using those steps: findChessboardCorners solvePnP ->Distance The distance I get is between two points: the ...
0
votes
1answer
42 views

A PID that can handle 2 inputs for my application

I am currently working on a Drone that navigates to different points that it detects on the ground. To go from one point to another in a smooth manner, I am employing a PID looks at the error between ...
0
votes
1answer
153 views

Two question about RBJ Peak filter

I'm new into DSP and Filters in general. Its the first step ahead I do from learning and using a 1-pole IIR basic Low Pass Filter. I'm about to implement for my VST audio application (using C++ and ...
0
votes
1answer
312 views

Doing audio processing with DFT on a microcontroller

I have written an audio processing application in C++ which runs on a desktop windows computer. My next step is to implement this on an embedded system using a microcontroller, preferably arm-based. ...
0
votes
0answers
934 views

FFT with kissFFT in C++

I'm trying to do the spectrogram of an audio signal, by dividing it into buffer of 1024 samples and passing that to this function which should calculate the short Fourier transform of that bin using ...
0
votes
2answers
786 views

C++ based FIR filter design using GNU Octave remez function [closed]

I am designing a system where I want a FIR filter coefficient generator feature. I try the remez.cc source file provided in the Octave Signal package. The source code for remez.cc is here. I have ...
0
votes
1answer
318 views

ICY feature detector and edge detector in opencv

I need to trace the internal feature boundaries of blobs (blood cells) in OpenCV to train a classifier. As a good reference from ICY in java, the following sequence of operations gives good, ...
1
vote
0answers
1k views

Line Detection with OpenCV

I'm trying to use the native functions of OpenCV HoughLines and HoughLinesP to detect the lines from an image. The Canny edge output of that image is the folllowing: The problem is that the OpenCV ...
1
vote
2answers
392 views

Power spectrum of a pure sine problems

I am writing a C++ program to use to analyse oscillations and create a power spectrum. I am using FFTW3. To test the system, I am using a perfect sine function. But no matter what parameters I try, ...
1
vote
0answers
296 views

Upsampling with FIR filter causing discontinuity at start of new buffer [closed]

I have implemented an oversampling algorithm for an audio signal in C++ which is producing a distortion of the signal at the start of a buffer. The algorithm is wrapped in a class with methods for up ...
2
votes
2answers
3k views

How to remove noise from this image without causing the crack to 'shrink'?

I am currently embarking on an image processing project to detect cracks on surfaces using OpenCV and Visual Studio via C++. I have tried writing my program and at the moment, I am stuck because I ...
0
votes
1answer
847 views

Which pattern (circle pattern or checkerboard pattern) should be used for automotive camera calibration (fisheye/wide webcam)?

Calibrating a Fish-eye camera / webcam with large angle mounted on car by using opencv 3 One important issue is to define the calibration pattern and its position !!!! The affects error that paly an ...
1
vote
1answer
2k views

Basic FIR Filtering with audio buffer in C++

I am willing to implement a basic FIR filter using C++ and JUCE. I wrote this simple algorithm using the information I found in the DSPGuide, but I only seem to get a variation in volume for all the ...
2
votes
3answers
962 views

Aquila DSP C++ Library - Wave file FFT analog frequency off by factor of 4?

I'm working with the Aquila C++ DSP library. I'm computing the FFT of a wave file (16 bit depth, single channel, 44100 sample rate). I am using a window size of 16384 to calculate the FFT spectrum. I'...
1
vote
1answer
2k views

Create 16 bit sine and write to file

This seems a simple task, yet I am making some stupid mistakes I am not able to find. I create a sinus wave (integer) and then convert it to 16 bit char, little endian. Then I save to file and open it ...
-1
votes
1answer
105 views

Add padding to object in 4-channel image

I have a 4-channel image (.png, .tif) like this one: I am using OpenCV, and I would like to add padding of type BORDER_REFLECT around the flower. ...
1
vote
0answers
35 views

Get level of wellness in a cascade classifier using LBP

I'm currently working in a Lolipop LBP cascade detector using OpenCV. The training is correctly done and the cascade classifier detects the sticks of the Lolipops correctly but with some minor errors. ...
0
votes
2answers
3k views

Blending artifacts in OpenCV image stitching

I am using OpenCV to blend a set of pre-warped images. As input I have some 4-channel images (*.png or *.tif) from where I can extract a bgr image and an alpha mask with the region related to the ...
2
votes
1answer
710 views

VIbrato (pitch variation) function

I'm looking for an algorithm for Vibrato audio effect for a cross-platform C++ program of audio processing. Now I use the realization from Chaotic-DAW sources. The problem is that Chaotic-DAW has a ...
2
votes
1answer
1k views

NORM_HAMMING2 vs NORM_HAMMING

I'm trying to use ORB features with a cv::BFMatcher. ORB is based on binary descriptors so HAMMING must be the choice, but I'm not sure I understand the difference ...
2
votes
1answer
600 views

removal of blackman harris window results in signal higher than expected

We are capturing data using a PX14400 adc. The samples are 16bit unsigned integer, 200M samples/sec, I data only. 100MHz bandwith. We have a cw signal at 51MHz, -11.4dBm. The -11.4dBm is measured ...
1
vote
1answer
580 views

normalize fft produced by fftw_plan_dft_r2c_1d

fftw_plan_dft_r2c_1d takes an array for real numbers and produces an array of complex numbers 1/2 the size of input array + 1. per fftw's website: As a result ...
0
votes
2answers
3k views

Should I use CV_HAAR_SCALE_IMAGE while using LBP CascadeClassifier?

I trained a cascade-LBP to detect Lollipops with 1000 images, now I'm trying to "adapt" the openCV HAAR-Cascade example to use my LBP trained .xml but I'm not sure about the "HAAR_SCALE_IMAGE" flag, I ...
0
votes
0answers
127 views

How to apply a signal to FIR Filter in C/C++?

When I using code to compute FIR Coefficient and Window function, then I don't how to apply this generated filter to a audio data(PCM) signal. What is the procedure of creating a FIR filter and the ...