feature-extraction

Issue: Bag of Features Training SIFT or SURF for car detection within Video with OpenCV + Python

吃可爱长大的小学妹 提交于 2019-12-04 21:55:35
I am trying to dump keypoints of cars with SIFT or SURF and match these keypoints to a video in order to detect cars. Keypoints are more convenient to use instead of Haar Cascades because I would have to use a lot of images for example 5000 to train, which will take a lot of computation process. Keypoints from SURF or SIFT are scale invariant which will be almost the same in every car. The code for dumping keypoints into a txt file is: import cv2 import numpy as np import os import cPickle surf = cv2.xfeatures2d.SURF_create() descriptors = [] image = cv2.imread('1.jpg') kp, dsc = surf

Simple speech recognition from scratch

本秂侑毒 提交于 2019-12-04 19:37:45
The most alike question I found related to my question is this ( simple speech recognition methods ) but since had passed 3 years and the answers are not enough I will ask. I want to compute, from scratch, a simple speech recognition system, I only need to recognize five words. As much as I know, the more used audio features for this application are the MFCC, and HMM for classification. I'm able to extract the MFCC from audio but I still have some doubts about how to use the features for generating a model with HMM and then perform classification. As I understand, I have to perform vector

How can I work with my own dataset in scikit-learn (for computer vision)?

烂漫一生 提交于 2019-12-04 19:19:01
问题 How can I work with my own dataset in scikit-learn? Scikit Tutorial always take as example to load his dataset (digit dataset, flower dataset...) http://scikit-learn.org/stable/datasets/index.html ie: from sklearn.datasets import load_iris I have my images and I have no idea how create new one. Particularly, for starting, i use this example i found (i use library opencv): img =cv2.imread('telamone.jpg') # Convert them to grayscale imgg =cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) # SURF extraction

Tensorflow feature column for variable list of values

倾然丶 夕夏残阳落幕 提交于 2019-12-04 17:43:19
问题 From the TensorFlow docs it's clear how to use tf.feature_column.categorical_column_with_vocabulary_list to create a feature column which takes as input some string and outputs a one-hot vector. For example vocabulary_feature_column = tf.feature_column.categorical_column_with_vocabulary_list( key="vocab_feature", vocabulary_list=["kitchenware", "electronics", "sports"]) Let's say "kitchenware" maps to [1,0,0] and "electronics" maps to [0,1,0] . My question is related to having a list of

Determinig the number of hidden states in a Hidden Markov Model

可紊 提交于 2019-12-04 10:35:46
I am learning about Hidden Markov Models for classifying motion in a sequence of t image frames. Assume I have m dimensions of feature from each frame. Then I cluster it into a symbol (for observable symbol). And I create k different HMM model for k class. Then, how do I determine the number of hidden states for each model to optimise prediction ? Btw, is my approach correct? If I misunderstood how to use it, please correct me:) Thanks :) "is my approach already correct?" Your current approach is correct. I have done the same thing some weeks ago and had asked the same questions. I have built

How to save resulted face landmark image in dlib?

穿精又带淫゛_ 提交于 2019-12-04 07:17:24
I am using dlib's face_landmark_detection_ex.cpp which display the detected face image and all face landmarks on the original image. I want to save the original image with all 68 face face landmarks to my computer. I know it can be done by save_png and draw_rectangle function of dlib but draw_rectangle only give detected face rectangle position, along with it, I also want to draw the landmark points on the original image and save them like this : The parameter pixel_type is used to specify the kind of pixels to be used to draw the rectangle. In the header declaration of the function it is

Why is this Deprication Warning halting code execution?

你说的曾经没有我的故事 提交于 2019-12-04 06:25:44
问题 I tried to use the TfidifVectorizer and CountVectorizer from the Sci-Kit Learn package, but when I import them: from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer I get the following warning message: /anaconda3/lib/python3.7/site-packages/sklearn/feature_extraction/text.py:17: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import Mapping, defaultdict

Android AudioRecord and MediaRecorder

巧了我就是萌 提交于 2019-12-04 06:14:05
I'm developing an audio processing application where I need to record audio, and then process it to obtain features of that recording. However, I want the audio in a playable format to play it after with MediaPlayer. I've seen that to record audio to process it it's better to use AudioRecord, because I can get the raw audio from there. But then I can't write the data to a file in a playable format (is there any library to do this in android?). I used this method to record raw data and then write it into a file: http://andrewbrobinson.com/2011/11/27/capturing-raw-audio-data-in-android/ But when

Feature Extraction with Javascript

邮差的信 提交于 2019-12-04 03:15:16
I am wondering whether there is any open source or free library for Image feature extraction with Javascript? I am developing an app where I need to use an algorithm like SIFT. It is tough to implement in JS, and I couldn't find a good SIFT implementation in JS. I thought of implementing a feature extraction library in JS if one doesn't exist. Please can anybody help me to find a good solution or guide me to write one from scratch. Thanks, Keshan. I'm not familiar with implementation for sift descriptor in JS, yet, it might worth starting with a simple HOG descriptor which has a great

How to use feature extraction with DStream in Apache Spark

ⅰ亾dé卋堺 提交于 2019-12-03 21:34:39
I have data that arrive from Kafka through DStream. I want to perform feature extraction in order to obtain some keywords. I do not want to wait for arrival of all data (as it is intended to be continuous stream that potentially never ends), so I hope to perform extraction in chunks - it doesn't matter to me if the accuracy will suffer a bit. So far I put together something like that: def extractKeywords(stream: DStream[Data]): Unit = { val spark: SparkSession = SparkSession.builder.getOrCreate val streamWithWords: DStream[(Data, Seq[String])] = stream map extractWordsFromData val