Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Image Processing in ARM

Status
Not open for further replies.

sadeghkarimi

Newbie level 2
Joined
Sep 29, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,296
Hello everybody
Could you please F1 Me??!
I want to process an image in Keil using ARM Cortex M-3 (LPC1768). I want to move a window(vector) over my image and compute sth using those pixels in the Window;
The Vector is : [-1 0 1] , Means that minus last and first pixels and put it in the middle.
The compiler doesn’t allow me to access pixels. Also my image is in vector form. I need Sth like this :

For (i=0,i<1240,i++){
Pic(i)=image(i+1)-image(i-10);
}

Before performing such an action also I want to zero pad my image for margins.
But vector Analysis in Keil doesn’t allow me to do such an easy process.
So what( the h… ) should I do ? Please Help me?
 

Hello,

To help you, we need to know in which format is stored the image in memory ( RGB 565/888 or YCrCb or other), the pixel order (X->Y or Y->X) and so on.
 

Hello alex,
Thanks for replying.
The format is RGB 565 and camera sensor is Ov7670

Thanks in advance
 

Hello,

Assuming that your camera driver store the image in a unsigned short array you can use a function similar to:


Code:
void make_filtered_image( unsigned short *source_array, //pointer to source array
                 unsigned short *dest_array,     //pointer to dest array
                 unsigned short x_size,             //x size in pixel
                 unsigned short y_size)            //y size in pixel

{
  unsigned short x,y,s0,s1,s2;
  int r0,g0,b0,r1,g1,b1,r2,g2,b2;

  for (y=0;y<y_size;y++)	//y loop
  {
    s0=0;s1=*source_array++;	//init s0 s1
    for (x=0;x<x_size;x++)	//x loop 
   {
      if (x<x_size)		//if no last x pixel 
        s2=*source_array++;	//   get s2
      else			//else s2=0
        s2=0;
		
      r0=s0&0xF800;		//split RGB components
      g0=s0&0x7e0;
      b0=s0&0x1f;
		
      r2=s2&0xF800;
      g2=s2&0x7e0;
      b2=s2&0x1f;

      r1=r2-r0;		//apply filter -1 0 +1
      if (r1<0) r1=0;		//clip 
 
      g1=g2-g0;		//apply filter -1 0 +1
      if (g1<0) g1=0;		//clip 

      b1=b2-b0;		//apply filter -1 0 +1
      if (b1<0) b1=0;		//clip 

      *dest_array++=(unsigned short)(r1|g1|b1);
      s0=s1;
      s1=s2;
    }
  }
}		
			
[/FONT]
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top