LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-09-2011, 04:03 PM   #1
luisfne
LQ Newbie
 
Registered: Nov 2011
Location: Brasil
Posts: 2

Rep: Reputation: Disabled
Unhappy COMPILATIONS ERROR using DEV C++ to compilate a image process program


I have a problem when I try to compilate this prog...I'm trying to process images to generate a color distortion image model ...It's just the beggining of my main program, but if I don't solve this... my program wont work...plz help me!!

ERRORs:

1)Error:
"167 C:\OCV\DistorçãoCoreBrilho.cpp conversion from `double' to non-scalar type `CvScalar' requested "

""

double normaquadframe,dotquad;
double quada,normaquadref;
double g,colordist;
int i, j;


while(1)
{
CvScalar frameM, refM;//,colordist;//colordistM,colordist,
for(int j=0;j<frame->height;j++)
for(int i=0;i<frame-> width;i++)

{

frameM = cvGet2D(frame,i,j);
refM = cvGet2D(ref,i,j);


normaquadframe=(pow(frameM.val[0],2)+pow(frameM.val[1],2)+pow(frameM.val[2],2));

normaquadref=(pow(refM.val[0],2)+pow(refM.val[1],2)+pow(refM.val[1],2));


dotquad=pow(((frameM.val[0]*refM.val[0])+(frameM.val[1]*refM.val[1])+(frameM.val[2]*refM.val[2])),2);

// normaquadframe*pow(cosf(c/(a*b),2)

quada= (dotquad/normaquadref);
g=(normaquadframe-quada);

colordist=(sqrt(g));
167 cvSet2D(colordistM,i,j,colordist);
}

2)
Error:
"166 C:\OCV\DistorçãoCoreBrilho.cpp no match for 'operator=' in 'colordist = sqrt(g)' "

" note C:\OpenCV2.2\include\opencv2\core\types_c.h:1199 candidates are: CvScalar& CvScalar:perator=(const CvScalar&) "


double normaquadframe,dotquad;//,quada;//,colordist;
double quada,normaquadref;//=0.0001, colordist=0.0001;
double g;//,colordist;
int i, j;


while(1)
{
CvScalar frameM, refM,colordist;//colordistM,colordist,
for(int j=0;j<frame->height;j++)
for(int i=0;i<frame-> width;i++)

{

frameM = cvGet2D(frame,i,j);
refM = cvGet2D(ref,i,j);


normaquadframe=(pow(frameM.val[0],2)+pow(frameM.val[1],2)+pow(frameM.val[2],2));

normaquadref=(pow(refM.val[0],2)+pow(refM.val[1],2)+pow(refM.val[1],2));


dotquad=pow(((frameM.val[0]*refM.val[0])+(frameM.val[1]*refM.val[1])+(frameM.val[2]*refM.val[2])),2);

// normaquadframe*pow(cosf(c/(a*b),2)

quada= (dotquad/normaquadref);
g=(normaquadframe-quada);

166 colordist=(sqrt(g));
cvSet2D(colordistM,i,j,colordist);
}
 
Old 11-09-2011, 09:25 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
Hi Luis,

It's impossible to read this! Could you please edit your post to use [ code ] [ /code ] tags (no spaces)? It'd be easier to help.

Best,
Jameson
 
Old 11-09-2011, 10:19 PM   #3
firstfire
Member
 
Registered: Mar 2006
Location: Ekaterinburg, Russia
Distribution: Debian, Ubuntu
Posts: 709

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
Hi.
According to this link your `colordist' (pixel color) variable should be of type CvScalar, not double. To set the actual color, you should use something like
Code:
colordist.val[0]=111;
colordist.val[1]=111; // for more than 1-channel image
colordist.val[2]=111; // ditto
You should decide how resulting pixel color (in general up to four channels per pixel) related with your scalar values like `sqrt(g)' etc and construct the pixel correspondingly.
 
Old 11-10-2011, 06:10 AM   #4
luisfne
LQ Newbie
 
Registered: Nov 2011
Location: Brasil
Posts: 2

Original Poster
Rep: Reputation: Disabled
Talking Thank you firstfire!

Quote:
Originally Posted by firstfire View Post
Hi.
According to this link your `colordist' (pixel color) variable should be of type CvScalar, not double. To set the actual color, you should use something like
Code:
colordist.val[0]=111;
colordist.val[1]=111; // for more than 1-channel image
colordist.val[2]=111; // ditto
You should decide how resulting pixel color (in general up to four channels per pixel) related with your scalar values like `sqrt(g)' etc and construct the pixel correspondingly.
This information will be helpfull to me!!! I'll try to do this code by another way ...and I'll confirm to you if worked better ..Thank you so much firstfire!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
modify target name for further compilations... ParticleHunter Linux - Software 2 03-12-2005 11:36 AM
Many Compilations/Installations Fail Puta Madre Linux - Hardware 5 01-24-2005 03:52 PM
Strange Compilations Error with gcc 3.3.2 gamehack Debian 1 01-19-2004 09:19 AM
can you have a process as a background instead of a image Bluesuperman Linux - Software 0 09-25-2003 12:30 AM
Frustrated compilations ottolinux Linux - Newbie 3 09-10-2001 07:17 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration