Averaged distribution of NumPy array [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 days ago.
Improve this question
I have a NumPy array with a shape of (893, 3). It is storing color data that I'm trying to convert into a file format that only support 255 unique colors. Is there a way to average the differences between the range of colors to produce 255 unique colors that are closest in value to the original 893?

Related

I'm trying to make an array work with user inputs [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I would like to make a number array with numpy based on user inputs then find the mean median and mode of this array.
Here you go:
import numpy as np
array = np.asarray([int(i) for i in input().split()])
print(array.mean())
print(array.mode())
print(array.median())

Character recognition from image with low contrast [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have images (about 1000) with different numbers. Using opencv I extracted ROI from these images. Here's a small sample:
And I don't know how to extract these numbers or identify them. For opencv have a small threshold. I tried VGGnet keras (I rotated each image 1 degree to create 360 images as input for tensorflow), but the control image was mostly not recognized. Does anyone have an idea?

Getting the y axis value(amplitude) on FFT [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am working on a FFT program, and I would like to get the frequency which has the largest amplitude or intensity in a sound. I checked out some codes on internet, but I couldn't find how to get the amplitude on a python program.
Check librosa.core.stft This gives magnitude of each frequency bin at given time. More details here:
https://librosa.github.io/librosa/generated/librosa.core.stft.html?highlight=stft#librosa.core.stft

Time Series Calculation using pandas [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
What is the fastest method to write a function for time series calculation that counts consecutive values in the same series ? A For loop or vector
Here is what my data looks like:
enter image description here
You can use rolling function to calculate the sum of 4 consecutive hours
df.consumption4hr = df.Consumption.groupby(level='Accounts').rolling(window=4).sum()
with that you can just find the list of accounts that has 0 in that column. for example:
df[df.consumption4hr == 0].Accounts.unique()

Opencv get average color of detected object [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I have a mask of an object I've detected. Now I want to calculate the average color of the object. Is there a way to just check the unmasked pixels?
And what would be the best way to get the average color?
Should I use a Cluster or get the average g,b and r values ?
(I'm using python 3.5 and opencv 3.1 with extras.)
Thanks in advance
Use cv::mean with mask. It will give you Scalar with color components.

Categories

Resources