Color Point Calculation in OpenGL etc - colors

If I have time series brightness outputs in Lumens from three LEDS (R,G,B), then will OpenGl helpful to compute the colorpoint calculation of every point in that time series? If not, is there any other library?
Thanks in Advance.

Related

Calculate center frequency for a given signal in frequency domain

I have a signal (points in frequency domain (nanometers, then converted to tera hertz; along with magnitude level in mW). My signal looks like the attached pic. I would like to know a way to calculate the center frequency.
One theory suggests finding the -3dB cutoff frequencies on both ends. However, I could not find how to do that. So, please tell me how to calculate the -3dB cutoff frequencies so that I can apply te following formula- (f1+f2)/2
or suggest me a better way of finding the center frequency.
You could perform this measurement as an OBW measurement. - 3dB is when you half the total signal power by 50%. (in Watts)
The way to do it manually is to get the whole signal spectrum in an excel table, for example 1000 points, measure the total power, Ptot, and start adding the power by the lowest frequency until you reach 25% of Ptot. The frequency at that point will be Flow. Do the same, but starting from the top frequency until you reach 25% of Ptot. it will be Fhigh. The center will be (Flow + Fhigh)/2.
Sorry if it's not very clear but if you look for OBW measurements You should find better explanations on the net. Most of modern spectrum analyzers have this function built in.

How do I create an animated 3D day night cycle in godot?

I am trying to create a 3d game in godot and I have been wondering how I would go about creating a day/night cycle. I would assume I would use shaders but I have found no resources on the subject. My idea to have a directional light as the sun but from there I do not know where to go. EX. how would I know when the sky should be a certain color?
Thank you in advance.
This is a very broad topic and therefore as a whole not very suitable for a stack overflow question. I'll focus on the last part of the question ("how would I know when the sky should be a certain color"), because that is a well focussed question. You will have to figure out the rest on your own (directional light is certainly an option).
Godot does not keep the time for you. But you get the length of the current frame in the delta parameter of the _process function. You can sum up the value of delta over every frame which gives you the number of real seconds since the game started.
Usually time passes faster in game than in the real world. You need to decide on a factor that specifies how much faster. If you divide the summed up delta time by this factor you get the number of in-game seconds since the game started. Take that modulo the number of in-game seconds in an in-game day and you have the time of day.
How to map the time of day to sky colours is up to you again.

How to identify shot boundary of a video using a threshold value in python opencv?

I want to implement code for shot boundary detection. The difference measure is the sum of the absolute bin-wise histogram differences. A shot boundary is
declared if the histogram difference between consecutive frames exceeds a threshold.
But i was unable to implement it.
It would be great if anyone can help me on this.
You can use cv2.calHist:
hist = cv2.calcHist([img],[0],None,[256],[0,256])
to calculate the histograms to the current and previous frames
Since the histograms are of the same size, you can take the absolute value of the difference(numpy.abs()), and then take the sum (np.sum()) to calculate the difference measure.
Caution: in practice, it takes a lot of experimenting to come up with the right bin count and the threshold for shot detection.

Simple image processing solution in python for measuring interval on a scanned electorcardiogram (ECG)

I have a MacOS 10.13.4 and I want to write a GUI in python3 able to measure measure intervals on a scanned Electrocardiogram or ECG (hear rhythm of a patient). I have some programming knowledge in python but I'm not a professional computer scientist
For this I need to do the following steps:
Rotation: Rotate the image so that the ECG baseline is pefectly horizontal (because the ECG on the scan can be a little rotated by a few degrees of angle). Here is an image of an ECG which needs to be rotated:
Set the scale: As an ECG paper has always a system of grid squares which defines the time on the horizontal axis (40ms for a small square and 200ms for a big square) and the the amplitude of the signal in mV in the vertical axis (0.1mv for a big square). I want to measure unit time an unit amplitude and set it as reference. Here is an image of the scale
Measure intervals: Measure the different in terms of time interval and amplitude difference of the difference ECG points (P Wave, QRS, T Wave). Here is an image of the different intervals:
For the GUI, I'm thinking using Tkinter (any other thoughts)
What would be a simple Solution for this in terms of image processing:
- I tried to install openCV but got stuck in the install openCV
- Is Python Imaging Library - PIL a good alternative
- Any other thoughts?
Many thanks in advance!

Detect red square in image with OpenGL-ES

I need to write a program that will detect a red square in an image. I would like to do this on my GPU using OpenGl-ES. I have no experience with GPU programming, and haven't found the answer through Google so far.
Is it possible to do this using OpenGL? Does OpenGL-ES give access to the whole matrix of pixels as well as their location in the matrix, allowing a program to go through the pixels, and check the color value of each one as well as their locations in the matrix?
Thank you.
Above all, you are confused to call a few terms. There is 'no matrix of pixels'
If what you meant by that is Convolution, yes, you can put the convolution on Fragment shader to detect edges. However, there is no returning datas, and no way to access each pixel to get the color value. Convolution would work if you just want the shader to draw of square's edge. But if you want to know if a red square exist in the camera frame it must be calculated in CPU not in GPU.

Resources