Data Equalizing problem?

[color=red][code]//Filtering*********************************************************
int a,b;
float temp;

for(i=1;i<img.h-1;i++){
		for(j=1;j<img.w-1;j++){
				temp= Y[i-1][j-1];

				//temp=(float)Y[i][j];
			printf("\nNew Value Y = %f",temp); //this is here!!!!!!!!!!!!!!!!!!!!!!!!!!!!
		}
	}

//********************************************************************[/code]

at this section when I added a “printf(”\nNew Value Y = %f",temp);" code compiling well but when I start running, application isn’t running!
Why I can’t see the “temp” value? However temp and Y[][] are float type.

Full code file attached below

Try putting the \n at the end of the string. printf is a buffered operation. What I don’t understand though is only the last printf would not be output.

And why all these -1 all over the place, much more efficient if you set i=0 and j=0?

Plus if img.h or img.w are 0 you’d end up with a loop that would last for a VERY long time as it would compare it against -1.

What were img.h and img.w?

Looking at your actual code I see these are read in from the image file and printed out earlier in your program. So what was printed out?

It’s possible that one or both for-loops never ran if img.h/img.w < 1.

Tim

img.h and img.w are image pixels count horizontal and vertical.

img.h and img.w are true because code compiling well without which I said"printf" This project isn’t have a only attached file, another header file is placed in my project.

i=0 and j=0 I changed this and many another probabilty I tried but I can’t.

if want to poject full I can Attach here for you.

do I?

Ok I printed to momentics output with this code

[color=red][code]//Filtering*********************************************************
int a,b;
float temp;

for(i=1;i<img.h-1;i++){
for(j=1;j<img.w-1;j++){
temp= Y[i-1][j-1];

           //temp=(float)Y[i][j]; 
        //printf("\nNew Value Y = %f",temp); //this is here!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     } 
  } 

//********************************************************************[/code]

Momentics output:

[color=green]Welcome to the QNX Momentics IDE
gf_dev_attach() SUCCESS
Display Number = 1
Bayrak (flags) = 0
Driver Name = vesa - unaccelerated driver for VESA 2.00 compliant adapters
Vendor ID = 21299
Device ID = 34833
Index = 0
//***********************************
gf_display_attach() SUCCESS
Layers = 1
Main Layer index = 0
X Resolution = 800
Y Resolution = 600
Display Format = 5152
Refresh = 60

Changing Display Format = 4120
gf_layer_attach() SUCCESS
Layer is already in use
Creating Layer Surface SUCCESS
Context Surface Create SUCCESS
image library attach SUCCESS
Image flags = 30
Image Width = 20
Image Height = 20
Stride = 60
Bosluk = 0
Yatay = 60
Image *.bmp Data per pixels:
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||
000||00255||02550||25500||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||255255255||000||

Success RGB to YCbCr

but when below code running:

[color=red][code]//Filtering*********************************************************
int a,b;
float temp;

for(i=1;i<img.h-1;i++){
for(j=1;j<img.w-1;j++){
temp= Y[i-1][j-1];

           //temp=(float)Y[i][j]; 
        printf("\nNew Value Y = %f",temp); //this is here!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     } 
  } 

//********************************************************************[/code]

[color=green]Welcome to the QNX Momentics IDE
gf_dev_attach() SUCCESS
Display Number = 1
Bayrak (flags) = 0
Driver Name = vesa - unaccelerated driver for VESA 2.00 compliant adapters
Vendor ID = 21299
Device ID = 34833
Index = 0
//***********************************
gf_display_attach() SUCCESS
Layers = 1
Main Layer index = 0
X Resolution = 800
Y Resolution = 600
Display Format = 5152
Refresh = 60

Changing Display Format = 4120
gf_layer_attach() SUCCESS
Layer is already in use
Creating Layer Surface SUCCESS
Context Surface Create SUCCESS

Code is not continued from here.

Use the debugger and step through the code. You should also loose the habit of putting a \n at the beggining of string, put it at the end…

You said “img.h and img.w are true because code compiling well” I’m not sure what you mean, the value that img.h and img.w have have nothing to do with compilation

mario, I put it in the end"\n"; but any changed

in the debugger screen stepped to "img_load_file"and exit when clicked one more . Step didn’t continued from here,

In the source I notice float YCbCr[240][320][3] which is almost 1Meg, just for one variable. Pretty sure you are busting the stack, try making these variable static, or allocate them dynamicaly.

:smiley::D:D thanks thanks thanks mario, I have said to you are the master:D

My pleasure, but I sure don’t feel like a master, this is just a result of doing this for ~25 years ;-)

I am in three months :laughing:
Now I am reading the ımage from pic file for edge detection and estimating motion.
next time at this project I will have to be read data from camera or web cam.
when this time will come I wil need this ~25 years exprience:D

thanks again

I would have started there ( the camera stuff ) because it’s the most challenging. As far as I know there is no build-in support for USB camera, never used that. Only used GigE Camera.

this is my works results: Edge Detection SUCCESSFULLY

thanks to my friends I’ve got job done.
Now going to motion estimating from squence.

8)

Looking at the application I really don’t see why you would use AG and not just Photon. My understanding is that AG is for people that want to take over and do their own UI, or for very limited resource stuff.