OpenCV in C++ - Calculation of the L Band Power of an Image - c++

I have to create a fire-detection program using OpenCV and C++ following an alghoritm from a scientific paper (see image below). At a certain point I have to calculate the "L band power" but I don't know what exacly it means. Can you help me?
Image of the Paper

I think that it refers the a wavelength of light/EM spectrum.
https://en.wikipedia.org/wiki/L_band
Edit: Actually I don't think this is correct after reading it again.

Related

Computer vision algorithm to use for making lines thinner

I have lecture notes written by a professor using a stylus.
A sample:
The width of the line used here is making reading difficult for me. I would like to make the lines thinner. The only solution I could think of is dilating the image. This gives a passable result:
The picture above is with uniform kernel of shape (2, 2) applied once; I've tried a bunch of kernel types, widths & numbers of iterations to arrive at this version that looks best to me.
However, I can't help but wonder if there's maybe another applicable algorithm that I'm missing; one that could lead to even better results? I wasn't able to google any computer vision approaches to font thinning, so I would appreciate any information on the subject.
Have been monitored such info during several days. Try to use Thinning described here, the link is also in the references to OpenCV-Python-Tutorial on morphological transforms. Taking Image Gradient can help, but it will make the image Grayscale, and with inverting colors you can get black-on-white text. Try to leave original color on black pixels location when original and final images are stacked.

Shadow Removal by inverse laplacian in C++

I have some query to code the algorithm in
Removing shadows from images by finlayson
I have gotten the matlab code to get illumination invariance image by jose alvarez and convert it to c++ coding
I have continued to follow the image reconstruction step outlined by finlayson algorithm but was stumped at the part of the Possion equation which is the part after removing the shadow edge from the log channel image
How should I proceed after that. The discussion of this part is vague to me. SI have read the following presentation slides. It say I must perform a inverse laplace operation on the image.
what should i do ? inverse laplace is not so common to code. Would need any advice I could get
ThANKS

Estimate color distribution with Gaussian mixture model

I am trying to use two Gaussian mixtures with EM algorithm to estimate color distribution of a video frame. For that, I want to use two separate peaks in the color distribution as the two Gaussian means to facilitate the EM calculation. I have several difficulties with the implementation of these in OpenCV.
My first question is: how can I determine the two peaks? I've searched about peak estimation in OpenCV, but still couldn't find any seperate function. So I am going to determine two regions, then find their maximum values as peaks. Is this way correct?
My second question is: how to perform Gaussian mixture model with EM in OpenCV? As far as I know, the "cv::EM::predict" function could give me the index of the most probable mixture component. But I have difficulties with training EM. I've searched and found some other codes, but finding the correct parameters is too much difficult for. Could someone provide me any example code for this? Thank you in advance.
#ederman, try {OpenCV library location}\opencv\samples\cpp\em.cpp instead of the web link. I think the sample code in the link is out of date now. I have successfully compiled the sample code in OpenCV 2.3.1. It shouldn't be a problem for 2.4.2.
Good luck:)
My first question is: how can I determine the two peaks?
I would iterate through the range of sample values possible, and test when the does EM.predict(sample)[0] peaks.

Noise Removal in Opencv

I'm currently working in a project where noise removal in document image is required. But i cant create any useful code to start my project. thanks.
According to what I've studied, noise (specifically salt/pepper noise) that produce in faulty scanner can be removed by k-Fill algorithm, but i can't understand that theory.
I'm using OpenCV in C++ , and Codeblocks IDE.
I'm new in the world of image processing.
Source code or any related link/s are appreciated.
If you do not understand k-fill try to use a simpler approach first.
Here is an article of alternative noise reduction algorithms with their performances.
I would suggest you to take a try with opening.
The OpenCV documentation has a short explanation on built-in morphological operations. You can make experiments with the example code as well.
K-filter, isnt that hard to understand.
Take a small area (ea 3x3 pixels or 5x5 pixels or so).
Now count the 'enabled' (ea dark) pixels on the border.
If total count is greater then n, fill central pixel(s) (which is a single pixel on (3x3 grid). and repeat this on the whole image. Or delete it, if total border is lower then n
I do not know how effective k-fill can be; But,
I explain this; it might be useful for someone else:
I will give an example with Python but CPlusPlus and Java should be similar (I do not know)
One way to reduce noise is the medianFilter algorithm, which definitely reduces image quality. How much this quality decreases depends on the ksize parameter. You must select a small number for this parameter (for example 3); This makes the quality not too low. Eliminates very small noise.
import cv2
im = cv2.imread("noisy_flower.png")
im = cv2.medianBlur(im, ksize=5)
cv2.imwrite("clean_flower.png", im)
This mode is applicable to images. For the text inside a photo, you may be able to create a mask and copy the text back to the final image according to the mask. It depends a lot on your case.
Java Version:
Imgproc.medianBlur(src, dst, 5);

Computer Vision: Detecting Parabolas using the Hough Transform

Papers have been written describing how the Hough transform can be generalised to detect shapes like circles and parabolas. I'm new to computer vision though and find these papers pretty tough going. There is also code out there that does this detection but this is more than I want. I was wondering if anyone could briefly describe in bullet points or pseudo-code really simply how Hough Transforms are used to detect parabolas in images. That would be amazing. Or if anyone knows any basic explanations online that I haven't come across than that would be good enough too :).
Thanks very much :).
Interesting question. This looks like a great resource. I included a summary (loosely quoted). Also see the source from Mathworks at the bottom of this answer - Matlab has houghlines and houghpeaks functions which will be useful for you. Hope it helps.
Run edge detection algorithm, such as the Canny edge detector, on subject image
Input edge/boundary points into Hough Transform (line detecting)
Generate a curve in polar space (radius, angle) for each point
in Cartesian space (also called
accumulator array)
Extract local maxima from the accumulator array, for example using a
relative threshold
In other words, we take only those local maxima in the accumulator
array whose values are equal to or
greater than some fixed percentage of
the global maximum value.
De-Houghing into Cartesian space yields a set of line descriptions of the image subject
cs.jhu.edu:
http://www.cs.jhu.edu/~misha/Fall04/GHT1.pdf
Code from Mathworks: http://www.mathworks.com/help/toolbox/images/ref/hough.html