Fuel Spray Angle Measurement

  • Follow


Hello,

I'm trying to automatically measure the cone angle of a fuel injector spray using the image toolbox commands in Matlab.

After doing edge detection and other post-processing I have come up with a b&w picture like this http://i12.photobucket.com/albums/a234/fred_3202/bwFinal_FuelSpray.jpg

I know need to automatically measure the approx. angle of the spray. 
What is the best way to do this ???

I was thinking about marking points where there is a transition of white to black and then plotting a line through those points. And repeat the process for the bottom half of the picture but I have no idea how to start writing the code for that or if it's even the correct way to do it.

Some help would be greatly appreciated

Thank u 
0
Reply Fred 8/4/2010 9:11:05 AM

Fred,
I think the answer depends on what angle you plan on measuring.  In other words, you want to choose a method that will produce an angle value close to what you expect.  It seems like fitting two straight lines to the image is a reasonable idea though.

"Fred Vrancken" <fred_3202@hotmail.com> wrote in message <i3bar9$a94$1@fred.mathworks.com>...
> Hello,
> 
> I'm trying to automatically measure the cone angle of a fuel injector spray using the image toolbox commands in Matlab.
> 
> After doing edge detection and other post-processing I have come up with a b&w picture like this http://i12.photobucket.com/albums/a234/fred_3202/bwFinal_FuelSpray.jpg
> 
> I know need to automatically measure the approx. angle of the spray. 
> What is the best way to do this ???
> 
> I was thinking about marking points where there is a transition of white to black and then plotting a line through those points. And repeat the process for the bottom half of the picture but I have no idea how to start writing the code for that or if it's even the correct way to do it.
> 
> Some help would be greatly appreciated
> 
> Thank u 
0
Reply Joseph 8/4/2010 5:40:22 PM


Fred:
I'd find the first and last bright pixel in each column using the
find() function.  Maybe something like (untested)
for columnNumber = 1:size(imageArray, 2)
  topRows(columnNumber) = find(imageArray(:, columnNumber)>0, 1,
'first');
  bottomRows(columnNumber) = find(imageArray(:, columnNumber)>0, 1,
'last');
end
Maybe there's a way to do it all in one line - I don't know.

Then pass in the first white row (topRows) for all the columns into
polyfit to fit a line to the upper edge of your spray.  Then do the
same with the bottom rows of your spray to get a fitted line for the
bottom edge of your spray.  Once you know the equation of the lines
for the top and bottom, you can calculate the angle and the vertical
width of the spray as a function of distance (column).
-ImageAnalyst
0
Reply ImageAnalyst 8/4/2010 6:12:47 PM

On Aug 4, 2:11=A0am, "Fred Vrancken" <fred_3...@hotmail.com> wrote:
> Hello,
>
> I'm trying to automatically measure the cone angle of a fuel injector spr=
ay using the image toolbox commands in Matlab.
>
> After doing edge detection and other post-processing I have come up with =
a b&w picture like thishttp://i12.photobucket.com/albums/a234/fred_3202/bwF=
inal_FuelSpray.jpg
>
> I know need to automatically measure the approx. angle of the spray.
> What is the best way to do this ???
>
> I was thinking about marking points where there is a transition of white =
to black and then plotting a line through those points. And repeat the proc=
ess for the bottom half of the picture but I have no idea how to start writ=
ing the code for that or if it's even the correct way to do it.
>
> Some help would be greatly appreciated
>
> Thank u

Well, what determines the angle?

Take a look at a snapshot of our program.
http://drop.io/sprayangle
The yellow lines outline where one of our algorithms determines what
the angle of the spray should be. What determines where your angle
should lie? Should it always be outside of the spray? Should the lines
that form the angle be partially within the spray?

Our program uses one of two methods of finding the spray angle. One is
as follows:
Compute the spray angle based on an average spray angle between a
starting point in the spray (expressed as a percentage of the total
spray length) and an ending point in the spray.

Another way is from a paper:
Method from Siebers SAE 1999-01-0528 for spreading angle. See appendix
A, equation 01.

-Nathan
0
Reply Nathan 8/4/2010 7:42:34 PM

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <57891caa-653c-407a-bfb8-9a34fc2231d3@i28g2000yqa.googlegroups.com>...
> Fred:
> I'd find the first and last bright pixel in each column using the
> find() function.  Maybe something like (untested)
> for columnNumber = 1:size(imageArray, 2)
>   topRows(columnNumber) = find(imageArray(:, columnNumber)>0, 1,
> 'first');
>   bottomRows(columnNumber) = find(imageArray(:, columnNumber)>0, 1,
> 'last');
> end
> Maybe there's a way to do it all in one line - I don't know.
> 
> Then pass in the first white row (topRows) for all the columns into
> polyfit to fit a line to the upper edge of your spray.  Then do the
> same with the bottom rows of your spray to get a fitted line for the
> bottom edge of your spray.  Once you know the equation of the lines
> for the top and bottom, you can calculate the angle and the vertical
> width of the spray as a function of distance (column).
> -ImageAnalyst


If I understand correctly (because i'm pretty new to matlab)
the code must look like this :

for columnNumber = 1:200(BWfinal, 2)
   topRows(columnNumber) = find(BWfinal(:, columnNumber)>0, 1,
 'first');
   bottomRows(columnNumber) = find(BWfinal(:, columnNumber)>0, 1,
 'last');
 end

BWfinal = imagearray black & white so 0 and 1's
200 is the size = max number of columns in BWfinal

However i'm not sure what the (BWfinal,2) is doing after the 1:200 statement
0
Reply Fred 8/5/2010 4:45:07 PM

On Aug 5, 12:45=A0pm, "Fred Vrancken" <fred_3...@hotmail.com> wrote:
> If I understand correctly (because i'm pretty new to matlab)
> the code must look like this :
>
> for columnNumber =3D 1:200(BWfinal, 2)
> =A0 =A0topRows(columnNumber) =3D find(BWfinal(:, columnNumber)>0, 1,
> =A0'first');
> =A0 =A0bottomRows(columnNumber) =3D find(BWfinal(:, columnNumber)>0, 1,
> =A0'last');
> =A0end
>
> BWfinal =3D imagearray black & white so 0 and 1's
> 200 is the size =3D max number of columns in BWfinal
>
> However i'm not sure what the (BWfinal,2) is doing after the 1:200 statem=
ent
-------------------------------------------------------------

size() is a function.  You do not actually replace "size" with the
actual size of your array (as in "200(BWfinal, 2)" ).  size() will
calculate the value 200 from the BWfinal array.  If you want, you can
do this instead:

[rows columns numberOfColorBands] =3D size(BWfinal)
for columnNumber =3D 1 : columns
.....
end
You might see if you can get Joseph's code - it looks like they've put
quite a bit of work into what is substantially the same thing you want
to do.  There are probably several nuances that I'm not aware of.
0
Reply imageanalyst (7596) 8/5/2010 6:03:21 PM

> size() is a function.  You do not actually replace "size" with the
> actual size of your array (as in "200(BWfinal, 2)" ).  size() will
> calculate the value 200 from the BWfinal array.  If you want, you can
> do this instead:
> 
> [rows columns numberOfColorBands] = size(BWfinal)
> for columnNumber = 1 : columns
> ....
> end
> You might see if you can get Joseph's code - it looks like they've put
> quite a bit of work into what is substantially the same thing you want
> to do.  There are probably several nuances that I'm not aware of.
----------------------------------------------------------------------------------------------------------------------

I figured out the code just after i send the message sorry about that. However when i want to use it with my b&w pic i get the following error ''??? Improper assignment with rectangular empty matrix.''

BWfinal is a 153x200 logical array

Any tips?
0
Reply Fred 8/5/2010 6:37:03 PM

Dear Nathan ,
I noticed your program. recently I did some spray visualization. I need computing method in matlab. Could you give me your program to measure spray cone angle.
I will be waiting for your reply.
Roy Mithun


Nathan <ngreco32@gmail.com> wrote in message <28847f22-6513-4363-982d-f40f217a24f7@v32g2000prd.googlegroups.com>...
> On Aug 4, 2:11 am, "Fred Vrancken" <fred_3...@hotmail.com> wrote:
> > Hello,
> >
> > I'm trying to automatically measure the cone angle of a fuel injector spray using the image toolbox commands in Matlab.
> >
> > After doing edge detection and other post-processing I have come up with a b&w picture like thishttp://i12.photobucket.com/albums/a234/fred_3202/bwFinal_FuelSpray.jpg
> >
> > I know need to automatically measure the approx. angle of the spray.
> > What is the best way to do this ???
> >
> > I was thinking about marking points where there is a transition of white to black and then plotting a line through those points. And repeat the process for the bottom half of the picture but I have no idea how to start writing the code for that or if it's even the correct way to do it.
> >
> > Some help would be greatly appreciated
> >
> > Thank u
> 
> Well, what determines the angle?
> 
> Take a look at a snapshot of our program.
> http://drop.io/sprayangle
> The yellow lines outline where one of our algorithms determines what
> the angle of the spray should be. What determines where your angle
> should lie? Should it always be outside of the spray? Should the lines
> that form the angle be partially within the spray?
> 
> Our program uses one of two methods of finding the spray angle. One is
> as follows:
> Compute the spray angle based on an average spray angle between a
> starting point in the spray (expressed as a percentage of the total
> spray length) and an ending point in the spray.
> 
> Another way is from a paper:
> Method from Siebers SAE 1999-01-0528 for spreading angle. See appendix
> A, equation 01.
> 
> -Nathan
0
Reply mithun_engr (1) 9/9/2010 3:26:05 AM

Hi,

This is my first post and I would just like to "bump" this guys question. He said a some months ago:

>"I figured out the code just after i send the message sorry about that. However >when i want to use it with my b&w pic i get the following error '??? Improper >assignment with rectangular empty matrix.'
>
>BWfinal is a 153x200 logical array
>
>Any tips?"

I am getting this same, "??? Improper assignment with rectangular empty matrix." message with his same code. Can anybody offer their advice???

Thanks!

"Fred Vrancken" <fred_3202@hotmail.com> wrote in message <i3f0cf$gmc$1@fred.mathworks.com>...
> > size() is a function.  You do not actually replace "size" with the
> > actual size of your array (as in "200(BWfinal, 2)" ).  size() will
> > calculate the value 200 from the BWfinal array.  If you want, you can
> > do this instead:
> > 
> > [rows columns numberOfColorBands] = size(BWfinal)
> > for columnNumber = 1 : columns
> > ....
> > end
> > You might see if you can get Joseph's code - it looks like they've put
> > quite a bit of work into what is substantially the same thing you want
> > to do.  There are probably several nuances that I'm not aware of.
> ----------------------------------------------------------------------------------------------------------------------
> 
> I figured out the code just after i send the message sorry about that. However when i want to use it with my b&w pic i get the following error ''??? Improper assignment with rectangular empty matrix.''
> 
> BWfinal is a 153x200 logical array
> 
> Any tips?
0
Reply Punk 12/21/2010 2:19:12 AM

8 Replies
386 Views

(page loaded in 0.483 seconds)

Similiar Articles:







7/27/2012 12:02:45 PM


Reply: