Ask Your Question

mobmsc's profile - activity

2017-08-15 12:44:47 -0600 received badge  Student (source)
2016-08-03 17:03:47 -0600 commented answer What options are there for Dimensionality Reduction of HoG Descriptors

What options would there be to scale the BoW (could I run in parallel and combine the output? Also wouldn't I need to aggregate the descriptor output of the frames if it was the action/sequence I was trying to train on not specific image elements, taking your pizza example from earlier instead of trying to identify a pizza, the aim would be to identify someone making a pizza instead of cooking a steak

2016-08-03 05:56:04 -0600 commented answer What options are there for Dimensionality Reduction of HoG Descriptors

Could I ask what you mean by 128D ? When I run HoG I have a flattened array of (251328,) for each frame/image and at 25 frames per second it soon adds up if the video sequence is long. My understanding (possibly incorrectly) is you use kmeans to define the clusters based on the descriptors then each cluster label becomes a "word" in the corpus/BagOfWords and each image is then annotated with the cluster labels present in that image. You then use Random Forrest or other suitable classifers to train using the annotations Is that correct?

2016-08-02 15:19:41 -0600 commented answer What options are there for Dimensionality Reduction of HoG Descriptors

Thanks for the small light at the end of the tunnel regarding Kmeans. Any advice for dealing with the descriptors prior to BoW as while using python I'm running into memory issues due to the amount and size

2016-08-02 06:44:07 -0600 commented answer What options are there for Dimensionality Reduction of HoG Descriptors

Hi Guanta,

Thanks for responding. My source images are video frames so wouldn't they have alot of similar descriptors as slight changes occur between frame x and x+ 1 and so if you were to sample the descriptors isn't there a possibility that the 100 samples per image would not be representative of the image detail and so could not be used to discriminate between images of different class ?

2016-08-01 16:46:26 -0600 asked a question What options are there for Dimensionality Reduction of HoG Descriptors

I have a very large number of HoG descriptors for 960x540 images and I was wondering if there was any recommendations I could take that would let me reduce the dimensionality of the HoG descriptors that are produced to make the dataset more manageable for BoW and KMeans and what the trade off against predictive accuracy could look like?

2016-07-02 06:29:49 -0600 asked a question What options exist for removing Crowds/Audiences from Videos

Could the community suggest methods for removing or reducing the influence crowds or audiences from videos as a preprocessing step? If you take this image as an discussion example and assume its a video of a game.

  1. what options are available in OpenCV to remove the crowd in the background without manually cropping the frame
  2. Which of those options could be used for multi angle environments (assume there was a camera in an elevated position in corner of the stand behind the white team and looking down at the game) so the crowd is now appearing on a diagonal angle to the playing area with the playing area taking up most of the frame
  3. What options could be carried out without manual intervention

Could you flip the problem and remove everything thats not within X pixels of the dominate playing area colour and what would the OpenCV code for that look like?

image description

The image came from here

2016-06-10 04:00:53 -0600 asked a question OpenCV2 BatchDistance Error -215 when looping through images while individual comparisons work correctly

I had asked this question on stackoverflow but now think this is a better place for it

I have python code to use OpenCV2 (3.10) to calculate the features of 2 images, match then and plot the most similar points. If I run the individual code it works and I can manually change the 2nd image file and the code will plot the matches, My problem is when I try to automate it to loop through a directory of images to compare to the 1st image I get the following error on Ubuntu 14.04, OpenCV 3.10 and Python 2.7

Besides the roughness of my code, anyone see why the loop errors out but the individual comparisons don't?

opencv/modules/core/src/stat.cpp:3749: error: (-215) type == src2.type() && src1.cols == src2.cols && (type == CV_32F || type == CV_8U) in function batchDistance

Individual Code Will match without triggering the error for every test image I supply by manually editing the 2nd image filepath value.

import sys
import cv2
import os
import numpy as np
from matplotlib import pyplot as plt

#Load the crest and create a grey version
crest = cv2.imread('Crest.png')
greyCrest = cv2.cvtColor(crest,cv2.COLOR_BGR2GRAY)

#Create the ORB Object and BruteForce
orb=cv2.ORB_create()
#Use Hamming Distance as its ORD (other algorithms would use a different distance measure)
BruteForceMatch = cv2.BFMatcher(cv2.NORM_HAMMING,crossCheck=True)
#Calculate the keypoints and descriptors for the crest
Crestkeypoints,Crestdescriptor = orb.detectAndCompute(greyCrest,None)

#
testimage = cv2.imread('OtherImage.jpg')
testkeypoints, testdescriptors = orb.detectAndCompute(testimage,None)

#Basic Idea
matches = BruteForceMatch.match(Crestdescriptor,testdescriptors)
#Sort the matches so the strongest are at the top
matches = sorted(matches, key = lambda x:x.distance)
Title = "Total Matched " + str(len(matches)) +" Plotting Top 40"
#display the top 40 matches on the plot
MatchImage = cv2.drawMatches(greyCrest,Crestkeypoints,testimage,testkeypoints,matches[:40],testimage,flags=2)
#This gets rid of the blue tint to the end image when plotting OpenCV image in Matplotlib because of the RGB ,BGR difference
plt.imshow(cv2.cvtColor(MatchImage, cv2.COLOR_BGR2RGB))
plt.title(Title)
plt.show()
#Pause for 10 Seconds so you can see the plot
plt.pause(10)
#Have to close as for some reason the figures weren't plotting correctly when I ran the code the 2nd time
plt.close('all')

Looping Code

Below is code to loop through a directory, load the image into OpenCV, calculate the keypoints and features of the image and compare it to a search image before getting the number of matches and plotting the top 40 matches

#Load the crest and create a grey version
import cv2
import os
import numpy as np
from matplotlib import pyplot as plt
    crest = cv2.imread('Crest.png')
    greyCrest = cv2.cvtColor(crest,cv2.COLOR_BGR2GRAY)

    #Create the ORB Object and BruteForce
    orb2=cv2.ORB_create()
    #Use Hamming Distance as its ORD (other algorithms would use a different distance measure)
    BruteForceMatch = cv2.BFMatcher(cv2.NORM_HAMMING,crossCheck=True)
    #Calculate the keypoints and descriptors for the crest
    Crestkeypoints,Crestdescriptor = orb2.detectAndCompute ...
(more)
2016-06-07 09:55:39 -0600 commented question How to access Scene Text Detection in OpenCV 3 in python ?

Has the release of OpenCV 3.1 changed this and if so is scene text recognition also now available?

2016-06-05 15:33:18 -0600 commented question Installing OpenCV2 on Ubuntu 14.04 - script failing on make install

If I run the script on a Ubuntu Desktop vm I set up locally it completes properly but I need it to run on the hosted ubuntu server

2016-06-04 10:49:23 -0600 asked a question Installing OpenCV2 on Ubuntu 14.04 - script failing on make install

I have amended a script from https://github.com/jayrambhia/Install... to try to install 2.4.13 onto a vm running 14.04 where I have sudo permissions. I'm new to openCV so any help getting this script to work would be appreciated as I have to deploy 20 vm's with OpenCV

After a few minutes of running the script returns with an error saying can't

/bin/sh: 1: cd: can't cd to /home/myaccount/setups/OpenCV/opencv-2.4.13/build

and

make[2]: *** [3rdparty/libtiff/CMakeFiles/libtiff.dir/depend] Error 2
make[1]: *** [3rdparty/libtiff/CMakeFiles/libtiff.dir/all] Error 2

The last few lines of the output is included below and the script is before that.

Any ideas why the script wont complete successfully as I need to install OpenCV on many vms

Install Script

arch=$(uname -m)
if [ "$arch" == "i686" -o "$arch" == "i386" -o "$arch" == "i486" -o "$arch" == "i586" ]; then
flag=1
else  
flag=0
fi
echo "Installing OpenCV 2.4.13"
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
sudo apt-get -y remove ffmpeg x264 libx264-dev
echo "Installing unzip"
sudo apt-get -y install unzip
echo "Installing Dependenices"
sudo apt-get -y install libopencv-dev
sudo apt-get -y install build-essential checkinstall cmake pkg-config yasm
sudo apt-get -y install libtiff4-dev libjpeg-dev libjasper-dev
sudo apt-get -y install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev
sudo apt-get -y install python-dev python-numpy
sudo apt-get -y install libtbb-dev libeigen3-dev
sudo apt-get -y install libqt4-dev libgtk2.0-dev
sudo apt-get -y install libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-core-dev
sudo apt-get -y install x264 v4l-utils ffmpeg
sudo apt-get -y install libgtk2.0-dev
echo "Downloading OpenCV 2.4.13"
if ! [ -f "OpenCV-2.4.13.zip" ]; then
  wget -O OpenCV-2.4.13.zip http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.13/opencv-2.4.13.zip/download
fi
echo "Installing OpenCV 2.4.13"
if ! [ -d "opencv-2.4.13" ]; then
  unzip OpenCV-2.4.13.zip
fi
rm OpenCV-2.4.13.zip
cd opencv-2.4.13
rm -rf build
mkdir build
cd build
cmake -D CUDA_ARCH_BIN=3.2 -D CUDA_ARCH_PTX=3.2 -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D BUILD_TIFF=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
make -j$(nproc)
sudo make install
sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
echo "OpenCV 2.4.13 ready to be used"

Command Output

[100%] Build Java tests
Buildfile: /home/myaccount/setups/OpenCV/opencv-2.4.13/build/modules/java/test/.build/build.xml

build:

compile:
    [mkdir] Created dir: /home/myaccount/setups/OpenCV/opencv-2.4.13/build/modules/java/test/.build/build/classes
    [javac] Compiling 104 source files to /home/myaccount/setups/OpenCV/opencv-2.4.13/build/modules/java/test/.build/build/classes

jar:
    [mkdir] Created dir: /home/myaccount/setups/OpenCV/opencv-2.4.13/build/modules/java/test/.build/build/jar
      [jar] Building jar: /home/myaccount/setups/OpenCV/opencv-2.4.13/build ...
(more)
2016-06-04 05:14:19 -0600 commented answer OpenCV 3.1 Build for multiple virtual machines

when you say install may be neccessary to link opencv libraries is thats different from the build process ?

2016-06-04 05:13:05 -0600 received badge  Supporter (source)
2016-06-02 14:57:12 -0600 asked a question OpenCV 3.1 Build for multiple virtual machines

If I build openc 3.1 on Ubuntu 14.04 with default jdk do I have to build it again to use on another virtual machine if the OS version is the same?

2016-05-24 10:54:27 -0600 commented question Cascade Classifier Training: Train different object variants together or separate?

Hi @aKzenT did you get an answer to your cascade training question ?

2016-03-31 13:47:02 -0600 received badge  Scholar (source)
2016-03-30 14:56:17 -0600 received badge  Editor (source)
2016-03-30 14:40:32 -0600 asked a question OpenCV, Space Time Interest Points (STIP) & Camera Motion

I understand the implementation of space(spatial) time(temporal) interest points by Laptev http://www.di.ens.fr/~laptev/download... required OpenCV but since the release of the updated STIP code in 2011 has OpenCV integrated the feature into its toolkit or does OpenCV have its own similar function and how susceptible are STIP methods to camera motion

2016-03-19 07:03:25 -0600 received badge  Enthusiast
2016-03-15 01:26:27 -0600 commented question Detect Broadcasted Video using OpenCV

It looks to be the same camera angle but that the TV producer adds the overlay then switches to a replay of action, the original shot is still available. I can't say for sure they are the same length till I find the TV feeds. I have multiple videos to process and possibly different overlays used as different TV stations involved

2016-03-14 09:08:27 -0600 asked a question Detect Broadcasted Video using OpenCV

How would I detect or identify videos using opencv as being the broadcast output from multiple video files ? Forgive me but I may not have the correct terminology but i guess what I'm asking is how do I inspect a video for tv channel overlays or graphics a broadcaster adds to the raw video that appear intermittently in a video like a channel logo ?

And following that how do I compare 2 videos to know if video A is the broadcast then video G is the raw video without the graphics

2016-02-10 10:42:33 -0600 asked a question Video / Image exploratory data analysis: OpenCV a good starting point

Forgive the novice question but is OpenCV a good set of tools to start exploring a dataset of images/video or are there other tools that users would recommend instead to get a feel for a new dataset of images or video data?