C++ :: How To Compare Two Histograms Using Opencv

Mar 6, 2013

I am tying to compare two histograms, but it gives error. Here I have given my code, histogram file and error message. Histogram file 3*5 matrix(output_test.txt):

1 2 3 4 5
5 2 1 4 2
2 1 2 4 2

code:

int main(..........)
{ ................................................
Mat first_histogram(1,feature_vector_size, CV_32F);
Mat second_histogram(1,feature_vector_size, CV_32F);
for(i=0;i<count_row;i++)
{
for(j=0;j<count_row;j++)
{

[Code]...

Error message: error LNK2019: unresolved external symbol "double __cdecl cv::compareHist(class cv::Mat const &,class cv::Mat const &,int)" (?compareHist@cv@@YANABVMat@1@0H@Z)

View 5 Replies


ADVERTISEMENT

Visual C++ :: Compare Two Histograms In OpenCV?

Mar 5, 2013

I am tying to compare two histograms, but it gives error. Here I have given my code, histogram file and error message. Histogram file 3*5 matrix(output_test.txt):

1 2 3 4 5
5 2 1 4 2
2 1 2 4 2

code:

Code:
int main(..........)
{
................................................
Mat first_histogram(1,feature_vector_size, CV_32F);
Mat second_histogram(1,feature_vector_size, CV_32F);

[Code]....

Error message: error LNK2019: unresolved external symbol "double __cdecl cv::compareHist(class cv::Mat const &,class cv::Mat const &,int)" (?compareHist@cv@@YANABVMat@1@0H@Z)

View 1 Replies View Related

C++ :: How To Run OpenCV Program

Mar 15, 2013

I am trying to run an OpenCV program from command line, but it gave error like "The program can`t start because opencv_220d.dll is missing from your computer." Try reinstalling the program to fix this problem. I am using Windows 7 & Microsoft VC++ 2010. How can I run the program?

View 3 Replies View Related

Visual C++ :: OpenCV In MFC App?

Feb 5, 2014

I have a C++ app that uses OpenCV. Currently i am statically linking the OpenCV libs into my app. This is adding an extra overhead of 6+ MB.

i would like to remove some of the features that i am not using in OpenCV. The features am using are,

Capture frames from Webcam.

Face detection.

Image formats (JPEG, PNG).

Image rotation & resizing.

Is it possible to remove other features and trim down the libs?

My C++ app is developed in Visual Studio 2012.

View 1 Replies View Related

C++ :: Cannot Load OpenCV Library

Mar 22, 2014

I am trying to run a console program but for any reason it displays an error on the cv.h line.

View 5 Replies View Related

Visual C++ :: How To Run OpenCV Program

Mar 15, 2013

I am trying to run an OpenCV program from command line, but it gave error like "The program can`t start because opencv_220d.dll is missing from your computer." Try reinstalling the program to fix this problem. I am using Windows 7 & Microsoft VC++ 2010. How can I run the program?

View 4 Replies View Related

C :: OpenCV And Detecting A Person With A Webcam

Jul 2, 2013

Code:
#include "opencv2/video/tracking.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc_c.h"

#include <stdio.h>
#include <stdlib.h>

[Code] ....

The above code is all I have so far. I got confused when I got to the part where my book on C tells me I need to use the cvCalcOpticalFlowFarneback() function to compare 2 consecutive images from the webcam and create the optical flow, and then measure movement between the frames to detect whether or not a person is moving through the room. How to do this, and the OpenCV wiki wasn't very descriptive on how to set it up for beginners. Honestly, the parameters just confused me and I didn't see a return value listed, or how you would get data from it.

View 8 Replies View Related

C++ :: OpenCV - Opening And Closing Webcam

Jan 24, 2015

I am trying to switch between 2 states, and the event that determines which state i am in is based on the key i've pressed. So in this case i want the webcam to start automatically, and when key is pressed it then turns it off. The way I've done it is like this :

bool webcam_on() {
int c = 0;
VideoCapture cap(0);
if ( !cap.isOpened() ) // if not success, exit program

[Code] .....

The problem with this method is that cin.get() blocks the video stream.. I wanted something that the webcam turned on until i press some key, which would trigger the release.. How can this be done?

View 7 Replies View Related

C++ :: How To Create Histogram From A Set Of Values In OpenCV

Mar 9, 2013

I have a text file which consist of several values. These values represent distance from origin to any point in the triangle. How can I create histogram from these values? Is there any functions in OpenCV which can create histogram from these values?

Below my sample values are given:
..........................
3.4 1.2 6.9 0.2 5.1 2.9
........................

View 2 Replies View Related

C++ :: OpenCV - Create A Program Which Would Calibrate Camera

Feb 1, 2013

I am doing a project, which requires me to create a program which would calibrate the camera. The code is below.

#include<opencvcv.h>
#include<opencvhighgui.h>
#include<stdlib.h>
#include<stdio.h>
#include<vector>
using namespace cv;
int main() {
int numBoards = 0;

[Code] ....

I am a beginner to opencv.

View 14 Replies View Related

C++ :: Split Image To 3 Channels - Opencv Error

Mar 18, 2013

I am currently planning on splitting my image into 3 channels so i can get the RGB values of an image to plot a scatter graph so i can model is using a normal distribtion calculating the covariance matrix, mean, etc. then calculate distance between the background points and the actual image to segment the image.

Now in my first task, i have wrote the following code.

VideoCapture cam(0);
//int id=0;
Mat image, Rch,Gch,Bch;
vector<Mat> rgb(3); //RGB is a vector of 3 matrices
namedWindow("window");

[Code] ....

but as soon as it reaches the split function, i step through it, it causes a unhandled exception error. access violation writing location 0xfeeefeee.

I am still new to opencv, so am not used to dealing with unhandled exception error.

I tried adding items into the vector still error, either via push_back or general assignment i.e. rgb[0] = Rch or Bch still error.

View 6 Replies View Related

Visual C++ :: Create Histogram From A Set Of Values In OpenCV?

Mar 9, 2013

I have a text file which consist of several values. These values represent distance from origin to any point in the triangle. How can I create histogram from these values? Is there any functions in OpenCV which can create histogram from these values? Below my sample values are given:

..........................

3.4 1.2 6.9 0.2 5.1 2.9

........................

View 1 Replies View Related

C :: Can't Compare 8 Bit Value With 16 Bit Value

Jun 24, 2014

Apart from compiling i am running a software to test for compliance with standards. I always get the following warnings.Implicit binary conversion from one (type) to (type). The type in general can be unsinged int, long etc. There are several cases in which this happens. Like in an if statements, i made sure that both the types are of the same type by type casting.Is it true that i cannot compare an 8 bit value with 16 bit value? I cannot compare a signed value with an unsigned value?what are the exact rules for this?

In an assignment operator i cannot assign a bigger value to the smaller value. Am i correct?Suppose if i multiply a varaible with constant then the constant should be type casted to the same value as the variable?Also if i am shifting a variable say test1 << 1. Then should 1 also need to be typecasted. How to handle situations if the variable is a complex structure or union? i am very much cofused not able to follow definite rules and mostly trying trial and error and i dont want to do that way.

View 5 Replies View Related

C++ :: STL Map Compare Operator

Jun 13, 2012

In stl map, if I insert two keys, say a and b. It looks like compare operator is called twice. First time a<b is called and second time b<a is called. Why are both a<b and b<a called?

View 6 Replies View Related

C++ :: Compare Two Strings Of Numbers

Jan 4, 2014

I am trying to figure out how to go about comparing two strings of numbers. I have two files that both contain numbers 1-50, one file has multiple repeating numbers while the other one just has 1-50.

I want to compare the files and count how many of each number a occurred and make a chart with * next to the number. First I figured I would use the strings like an array and compare them using nested loops. Then I noticed I have single and double digit numbers. The numbers in the files are printed as:

1 44 5 34 4
2 22 7 55 4
...... etc

Compared too:
1
2
3
4
5
......
50

I thought about using string stream and converting the string to int but wouldn't it just be a huge number when set to the int variable? Then I thought about a array initialized with 1-50 and compared to the file but I still have the issue with single and double digit numbers.

My question is how can I just read one number at a time, either double or single digit?

View 11 Replies View Related

C++ :: How To Compare Two Double Values

Mar 24, 2014

I want to compare two double values

double x = 3072.00000000;
double y = 3072.0000000;

when checking with if its not working

if(x==y) it not working

View 1 Replies View Related

C++ :: Compare Function On Sets

Oct 18, 2014

How can I declare a set of strings that i want to be ordered by a boolean function Comp? Like the one you would write in

sort(v.begin(), v.end(), comp);

I tried
set<string, Comp> S;
but it doesn't work

And the same question for priority queues, can you specify the function you want your elements to be sorted by?

View 4 Replies View Related

C++ :: How To Compare Similarity Of Two Vectors

Mar 8, 2013

This is possibly more of an algorithm question rather than c++ related.Suppose I have two vectors:

std::vector<double> first = {1.0,2.01,3.05,4.05};
std::vector<double> second = {1,2,3,3,4}; // very similar except no decimals and a second "3"

And now I want an algorithm that will tell me how similar these two vectors are. That is, I want to know how much of first is similar to second.

View 6 Replies View Related

C++ :: Compare Any Two Numbers Input

Jan 11, 2015

Program is about to compare any two numbers input. Then, it will display whether the number is minimum or maximum. Use switch statement.

#include <iostream>
using namespace std;
void main() {
int num1, num2;

cout << "Input 2 integers separated by a space. " << endl;
cin >> num1 >> num2;

[Code] .....

View 4 Replies View Related

C++ :: OOP Compare Member Function

Feb 10, 2015

I have an assignment in my OOP c++ class and I had to create a class called date and one of the member functions is a compare function that compares two dates that are taken in. It is suppose to be something like this:

Date d1(12,25,2003);// Dec 25, 2003
Date d2(5,18,2002);// May 18, 2002

d1.Compare(d2);// returns 1 (since d2 comes first)
d2.Compare(d1);// returns -1 (calling object is d2, comes first)

Then if d1 and d2 are equal then it returns 0.

This is what he gave us to start with the function:

int Date::Compare(const Date& d) {
}

View 11 Replies View Related

C++ :: Compare Value In Switch Statement?

Sep 23, 2013

is it possible to compare value in switch statement? i.e: a > b

View 5 Replies View Related

C++ :: Can't Compare Char Strings

Jun 13, 2013

I have two char* that have the same data in (hypothetically).

std::vector<char*> Buff;
Buff = Split(Line, '.');
char* A = "data", B;
B = Buff.at(0)

Where Split is a function that I made to split a string (Line in this case) into a char* vector, this string contains a line from a file. Line is char* too. The weird problem is when Buff data stored in its 0 position is given to B... because B is equal to A (hypothetically) but when this is compared to do certain functions they doesn't match!

Here an example:

std::vector<char*> Buff;
Buff = Split(Line, '.');
char* A = "map", B;
B = Buff.at(0) // Buff.at(0) should be "map" and is apparently "map"

[Code].....

NOTE: I didn't use switch to compare Cmd because I want it separately for easier debugging.

Is there something wrong with my codes?? or what happened here with those hex values before the string in my variables?

View 6 Replies View Related

C# :: Compare Tree Views?

Aug 7, 2014

I have two Tree views populated from XML files. I have them loaded side by side in a windows form. treeView1 and treeView2. I need to compare these two treeviews and highlight any difference in any of the nodes. I am using C#.NET Visual Studio 2012 professional.

treeView1
BIOS_DETAILS
-Manufacturer
-- Hewlett Packard

[Code].....

I need to compare these and highlight the differences in color.

View 14 Replies View Related

C# :: Compare Value From Array Against A Word?

Jul 28, 2014

I'm trying to put my array value within a conditional against a word, but what can I check that

if(char[1]= "word")
{
AGEW2.Text = string.Format("{0} "whatever" {2}", split);
}

View 5 Replies View Related

C# :: Compare One Value To A Previously Entered Value?

Oct 3, 2014

I am currently taking a C# class. Our current assignment has us entering a player name, and number of hits and displaying these in one set of labels. I have coded everything for the primary function of this program and it works. However, I also have to have a second set of labels that show the highest number of hits entered (if I enter 44, the first and second labels change to 44; if I then enter 27, the first label changes to 27 and the second stays at 44; and if i enter 55, the first label changes to 55 and the second label changes to 55) and the corresponding player name. I have tried searching and reading and I can't seem to figure out how this is done.

View 5 Replies View Related

C/C++ :: Queries Using String Compare

Oct 31, 2014

I am trying to get a list of queries to work right now. I have it so that the user will input 1 of 5 things to compare twin primes in a list. I am just trying to get the queries working fully before actually determining the twin primes that need to be output. The console input will be something like "<= 61" and will display all twin primes from 3 to 61, inclusive.

Well, I thought I had it 100%... Then I realized I have a problem, though. So, I'm reading the string in until a space so I can read in the number after that. So that works fine, but then I also want the "all" and "random" console inputs to work, but they won't unless I put a space after them, which is what I'm trying to avoid...

So, I tried just simply asking for another console input after all of my if statements for the string compare after the first console input. That obviously doesn't work either, though, because it still only wants the first "getline" where it reads until the whitespace.

How to be able to do both on the same console input... The relevant code is posted below:

cout << endl << "What do you want to know about your list of twin primes?" << endl;
string qprompt1;
string qprompt2;
getline(cin, qprompt1, ' ');
string comp1 = ">";
string comp2 = ">=";

[Code] .....

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved