<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827</link>
    <title>MATLAB Central Newsreader - Help with image processing</title>
    <description>Feed for thread: Help with image processing</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 03 Nov 2009 10:30:04 -0500</pubDate>
      <title>Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#691675</link>
      <author>M Ladderman</author>
      <description>Dear all,&lt;br&gt;
&lt;br&gt;
With interest I have read this newsreader and have worked through some demos of matlab. What I want to do is select automatically a fish in my image (because I want to measure its size and color later). &lt;br&gt;
&lt;br&gt;
What I get using edge and then filling in the closed spaces. I get pretty good results however not perfect. What I am thinking of now is assining a function that say capture as much (percentage wise) of the picture in a certain shape. What i mean by this because I do not get the fill fish selected that I say that it needs to fit an eggs shape between this and this pixel size to the picture and fit it to the binary mask such that it gets as much of the fish and then fill this. Thereby I select the body of the fish and exclude its caudal fin (the fin at the end of its body). In a similar way I would also like to extract my color reference card (at the left bottom of the pic.)&lt;br&gt;
&lt;br&gt;
Is this possible to do and how should I go about it? Or is there a better approach?&lt;br&gt;
&lt;br&gt;
I have made a few pictures of my progress.. there are at:&lt;br&gt;
&lt;a href=&quot;http://picasaweb.google.nl/mirresimons/Matlab#5399822443459403218&quot;&gt;http://picasaweb.google.nl/mirresimons/Matlab#5399822443459403218&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 03 Nov 2009 13:26:23 -0500</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#691707</link>
      <author>ImageAnalyst</author>
      <description>I'm not sure what code you used.  Did you try some sort of edge filter&lt;br&gt;
like Sobel, Canny, or Difference of Gaussians?  You might have to&lt;br&gt;
combine an edge detected image with other kinds of images, such as the&lt;br&gt;
intensity image or a texture image (such as a variance filter or&lt;br&gt;
something like that).  You can use imclose to do a morphological&lt;br&gt;
closing to smooth and connect ragged boundaries.&lt;br&gt;
&lt;br&gt;
You can get size if you know your field of view.  You will not be able&lt;br&gt;
to get color unless you have a standard in your field of view, such as&lt;br&gt;
the xrite Color Checker Chart.(&lt;a href=&quot;http://www.xrite.com/&quot;&gt;http://www.xrite.com/&lt;/a&gt;&lt;br&gt;
product_overview.aspx?ID=820).  This will enable you to compensate for&lt;br&gt;
changes from picture to picture in illumination level and the &quot;color&lt;br&gt;
temperature&quot; of your illumination (hopefully you know what that is).&lt;br&gt;
Otherwise you're just using arbitrary units - you're just using the&lt;br&gt;
&quot;book formulas&quot; which is no better than Photoshop.  It's totally&lt;br&gt;
arbitrary and not accurate.  That is, if you got an CIE LAB color from&lt;br&gt;
your MATLAB routine, it would not match the values that you would get&lt;br&gt;
if you measured the actual fish via a spectrophotometer or&lt;br&gt;
colorimeter.  Your &quot;color reference card&quot; doesn't appear to have any&lt;br&gt;
colors in it so the best you can do is to compensate for overall&lt;br&gt;
intensity level.  Even if it were color, there's only 3 patches and&lt;br&gt;
this is not enough to do color correction (picture-to-picture rgb&lt;br&gt;
correction) or color standardization (calibration, or rgb to CIE LAB&lt;br&gt;
conversion).&lt;br&gt;
&lt;br&gt;
You might also ask for algorithmic advice in sci.image.processing.&lt;br&gt;
Regards,&lt;br&gt;
ImageAnalyst</description>
    </item>
    <item>
      <pubDate>Tue, 03 Nov 2009 15:56:01 -0500</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#691747</link>
      <author>M Ladderman</author>
      <description>Hi thanks for your reply ImageAnalyst. Yes I am aware of the problems of measuring colour from photographs. I am intending to calibrate my camera with a colour chart, the reference I have in to correct for small changes in illumination, but I presume there are none (or the effects are negliable) because I use a controlled lighting environment and fixed camera settings.. The colourchart will be used to calibrate my CCD of the camera to be able to be able to compare my study with others.&lt;br&gt;
&lt;br&gt;
In reply to your comments on the code (this is just from a demo), but I also tried different edge detections which all 'fail' to detect enough borders to just fill my image. I will try imclose instead of imfill and see what the difference is.. the texture image or intensity image might also be a good idea. I tried applying the edge detection to my blue, red and green channel seperately that improved it a bit but not enough. &lt;br&gt;
&lt;br&gt;
However if I use imclose I might still not be able to ignore the tail so using a shape to fit the image is not something that is a good approach?? &lt;br&gt;
&lt;br&gt;
Thanks!&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;151680ce-a53e-4537-858e-4fd98565d087@s15g2000yqs.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; I'm not sure what code you used.  Did you try some sort of edge filter&lt;br&gt;
&amp;gt; like Sobel, Canny, or Difference of Gaussians?  You might have to&lt;br&gt;
&amp;gt; combine an edge detected image with other kinds of images, such as the&lt;br&gt;
&amp;gt; intensity image or a texture image (such as a variance filter or&lt;br&gt;
&amp;gt; something like that).  You can use imclose to do a morphological&lt;br&gt;
&amp;gt; closing to smooth and connect ragged boundaries.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You can get size if you know your field of view.  You will not be able&lt;br&gt;
&amp;gt; to get color unless you have a standard in your field of view, such as&lt;br&gt;
&amp;gt; the xrite Color Checker Chart.(&lt;a href=&quot;http://www.xrite.com/&quot;&gt;http://www.xrite.com/&lt;/a&gt;&lt;br&gt;
&amp;gt; product_overview.aspx?ID=820).  This will enable you to compensate for&lt;br&gt;
&amp;gt; changes from picture to picture in illumination level and the &quot;color&lt;br&gt;
&amp;gt; temperature&quot; of your illumination (hopefully you know what that is).&lt;br&gt;
&amp;gt; Otherwise you're just using arbitrary units - you're just using the&lt;br&gt;
&amp;gt; &quot;book formulas&quot; which is no better than Photoshop.  It's totally&lt;br&gt;
&amp;gt; arbitrary and not accurate.  That is, if you got an CIE LAB color from&lt;br&gt;
&amp;gt; your MATLAB routine, it would not match the values that you would get&lt;br&gt;
&amp;gt; if you measured the actual fish via a spectrophotometer or&lt;br&gt;
&amp;gt; colorimeter.  Your &quot;color reference card&quot; doesn't appear to have any&lt;br&gt;
&amp;gt; colors in it so the best you can do is to compensate for overall&lt;br&gt;
&amp;gt; intensity level.  Even if it were color, there's only 3 patches and&lt;br&gt;
&amp;gt; this is not enough to do color correction (picture-to-picture rgb&lt;br&gt;
&amp;gt; correction) or color standardization (calibration, or rgb to CIE LAB&lt;br&gt;
&amp;gt; conversion).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You might also ask for algorithmic advice in sci.image.processing.&lt;br&gt;
&amp;gt; Regards,&lt;br&gt;
&amp;gt; ImageAnalyst</description>
    </item>
    <item>
      <pubDate>Tue, 03 Nov 2009 16:25:31 -0500</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#691752</link>
      <author>Ashish Uthama</author>
      <description>On Tue, 03 Nov 2009 10:56:01 -0500, M Ladderman &amp;lt;mirresimons@gmail.com&amp;gt;  &lt;br&gt;
wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; Hi thanks for your reply ImageAnalyst. Yes I am aware of the problems of  &lt;br&gt;
&amp;gt; measuring colour from photographs. I am intending to calibrate my camera  &lt;br&gt;
&amp;gt; with a colour chart, the reference I have in to correct for small  &lt;br&gt;
&amp;gt; changes in illumination, but I presume there are none (or the effects  &lt;br&gt;
&amp;gt; are negliable) because I use a controlled lighting environment and fixed  &lt;br&gt;
&amp;gt; camera settings.. The colourchart will be used to calibrate my CCD of  &lt;br&gt;
&amp;gt; the camera to be able to be able to compare my study with others.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; In reply to your comments on the code (this is just from a demo), but I  &lt;br&gt;
&amp;gt; also tried different edge detections which all 'fail' to detect enough  &lt;br&gt;
&amp;gt; borders to just fill my image. I will try imclose instead of imfill and  &lt;br&gt;
&amp;gt; see what the difference is.. the texture image or intensity image might  &lt;br&gt;
&amp;gt; also be a good idea. I tried applying the edge detection to my blue, red  &lt;br&gt;
&amp;gt; and green channel seperately that improved it a bit but not enough.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; However if I use imclose I might still not be able to ignore the tail so  &lt;br&gt;
&amp;gt; using a shape to fit the image is not something that is a good approach??&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks!&lt;br&gt;
&lt;br&gt;
A couple of questions on the setup. Would the fish always be in the same  &lt;br&gt;
angle, and always on a background of ice?&lt;br&gt;
&lt;br&gt;
&quot;because I use a controlled lighting environment&quot;&lt;br&gt;
&lt;br&gt;
Does this mean you can change the camera angle and lighting? If so, then  &lt;br&gt;
you could experiment with the best setup which gives you maximum contrast  &lt;br&gt;
to segment the fish. If possible a light source shined on to the ice block  &lt;br&gt;
&amp;nbsp;from below/side the surface might work as a backlight and clearly  &lt;br&gt;
highlight the fish. You might then even be able to get away with simple  &lt;br&gt;
thresholding.&lt;br&gt;
Though, of course, it might not be ideal for color measurements. Maybe you  &lt;br&gt;
could take two pictures with the same setup/one with backlight to aid  &lt;br&gt;
segmentation and another with controlled light from the top for color  &lt;br&gt;
measurements?&lt;br&gt;
&lt;br&gt;
I would also imagine the camera has to be exactly overhead to give you  &lt;br&gt;
accurate measurements of the size (or at least 'size' in that angle).</description>
    </item>
    <item>
      <pubDate>Tue, 03 Nov 2009 16:34:47 -0500</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#691757</link>
      <author>ImageAnalyst</author>
      <description>Ashish brings up an excellent point.  Why is the fish on ice?  That&lt;br&gt;
just makes it more difficult.  Why not just use a background that will&lt;br&gt;
enable you to pick out the fish better, such as a black ceramic tile,&lt;br&gt;
or a hot pink powder coated aluminum plate, or some other contrasty&lt;br&gt;
color?  There's no need for ice since presumably the fish is only&lt;br&gt;
going to be there for a very short time, just long enough to take the&lt;br&gt;
picture.</description>
    </item>
    <item>
      <pubDate>Tue, 03 Nov 2009 19:42:02 -0500</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#691816</link>
      <author>M Ladderman</author>
      <description>Hi guys,&lt;br&gt;
&lt;br&gt;
The fish is not on ice it is in a small tank with water and what you think is ice is whitish foam.. I could have used black foam but then I think I would have had the same problem with the top of the fish not having a clear 'edge'. I could use different colours however... I do not want reflexion from this. I have now also posted a colour image so that my setup is more clear maybe..&lt;br&gt;
&lt;br&gt;
Any more suggestions on coding I could use are very welcome.. &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;0e74e8f2-0156-4017-9652-c7d9310f174f@d34g2000vbm.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; Ashish brings up an excellent point.  Why is the fish on ice?  That&lt;br&gt;
&amp;gt; just makes it more difficult.  Why not just use a background that will&lt;br&gt;
&amp;gt; enable you to pick out the fish better, such as a black ceramic tile,&lt;br&gt;
&amp;gt; or a hot pink powder coated aluminum plate, or some other contrasty&lt;br&gt;
&amp;gt; color?  There's no need for ice since presumably the fish is only&lt;br&gt;
&amp;gt; going to be there for a very short time, just long enough to take the&lt;br&gt;
&amp;gt; picture.</description>
    </item>
    <item>
      <pubDate>Thu, 05 Nov 2009 15:00:04 -0500</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#692417</link>
      <author>M Ladderman</author>
      <description>Hi after tweaking the settings of my edge detection and using imclose I get pretty close in selecting my fish. However now I have the problem that I do not want to select its tail fin, so the part of the fish on the rightest part of the photograph. So coming back to my point, is there an &quot;easy&quot; way to fit a drop shape (which is pretty much what the fish body looks like) to the binary mask and select only those pixels? I find it hard to think of how to do this. Thanks&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;M Ladderman&quot; &amp;lt;mirresimons@gmail.com&amp;gt; wrote in message &amp;lt;hcq12a$cv$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi guys,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The fish is not on ice it is in a small tank with water and what you think is ice is whitish foam.. I could have used black foam but then I think I would have had the same problem with the top of the fish not having a clear 'edge'. I could use different colours however... I do not want reflexion from this. I have now also posted a colour image so that my setup is more clear maybe..&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Any more suggestions on coding I could use are very welcome.. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;0e74e8f2-0156-4017-9652-c7d9310f174f@d34g2000vbm.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Ashish brings up an excellent point.  Why is the fish on ice?  That&lt;br&gt;
&amp;gt; &amp;gt; just makes it more difficult.  Why not just use a background that will&lt;br&gt;
&amp;gt; &amp;gt; enable you to pick out the fish better, such as a black ceramic tile,&lt;br&gt;
&amp;gt; &amp;gt; or a hot pink powder coated aluminum plate, or some other contrasty&lt;br&gt;
&amp;gt; &amp;gt; color?  There's no need for ice since presumably the fish is only&lt;br&gt;
&amp;gt; &amp;gt; going to be there for a very short time, just long enough to take the&lt;br&gt;
&amp;gt; &amp;gt; picture.</description>
    </item>
    <item>
      <pubDate>Thu, 05 Nov 2009 15:04:10 -0500</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#692421</link>
      <author>ImageAnalyst</author>
      <description>Can you just find the bounding box and then use imcrop to take, say,&lt;br&gt;
only the left most 80% of the mask?</description>
    </item>
    <item>
      <pubDate>Thu, 05 Nov 2009 15:26:01 -0500</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#692434</link>
      <author>M Ladderman</author>
      <description>Hi I think this will not yield the results I want because&lt;br&gt;
1. the tail size/body size are variable between fish&lt;br&gt;
2. the edge detection does not always select the whole tailfin becuase it is kinda see through and therefore this will result in cutting of too much&lt;br&gt;
&lt;br&gt;
Hope I make sense, thanks for your feedback!&lt;br&gt;
&lt;br&gt;
But your suggestion made me think of something else, I could select the fish remove slices starting from the right untill the amount of selected pixels that is removed increase or so (that is when the body thinkens again), does this make sense?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;998250e5-dd27-4263-81a5-f6d189f72cce@v30g2000yqm.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; Can you just find the bounding box and then use imcrop to take, say,&lt;br&gt;
&amp;gt; only the left most 80% of the mask?</description>
    </item>
    <item>
      <pubDate>Thu, 05 Nov 2009 15:34:53 -0500</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#692438</link>
      <author>ImageAnalyst</author>
      <description>That might work - just look for the top-most and bottom-most pixel in&lt;br&gt;
each column.&lt;br&gt;
Set some limits to avoid possible noise near the edges (where the tail&lt;br&gt;
thins out), like say you go from the left (nose of the fish) to 97% of&lt;br&gt;
the way to the right, skipping the last 3% or so.&lt;br&gt;
Then scan it from the right and see where the top-to-bottom distance&lt;br&gt;
dips down, which hopefully happens where the tail connects to the&lt;br&gt;
body.&lt;br&gt;
Why don't you post your code?</description>
    </item>
    <item>
      <pubDate>Thu, 05 Nov 2009 16:27:03 -0500</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#692448</link>
      <author>Dave Robinson</author>
      <description>&quot;M Ladderman&quot; &amp;lt;mirresimons@gmail.com&amp;gt; wrote in message &amp;lt;hcuqq9$psh$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&lt;br&gt;
snip&lt;br&gt;
&amp;gt;&quot; But your suggestion made me think of something else, I could select the fish remove slices starting from the right &quot;&lt;br&gt;
&lt;br&gt;
But this technique has the problem that it will almost certainly kill the fish ;-)&lt;br&gt;
&lt;br&gt;
I must be in a playful mood - don't know why.&lt;br&gt;
&lt;br&gt;
Dave Robinson</description>
    </item>
    <item>
      <pubDate>Thu, 05 Nov 2009 19:48:36 -0500</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#692514</link>
      <author>Ashish Uthama</author>
      <description>On Thu, 05 Nov 2009 10:00:04 -0500, M Ladderman &amp;lt;mirresimons@gmail.com&amp;gt;  &lt;br&gt;
wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; Hi after tweaking the settings of my edge detection and using imclose I  &lt;br&gt;
&amp;gt; get pretty close in selecting my fish. However now I have the problem  &lt;br&gt;
&amp;gt; that I do not want to select its tail fin, so the part of the fish on  &lt;br&gt;
&amp;gt; the rightest part of the photograph. So coming back to my point, is  &lt;br&gt;
&amp;gt; there an &quot;easy&quot; way to fit a drop shape (which is pretty much what the  &lt;br&gt;
&amp;gt; fish body looks like) to the binary mask and select only those pixels? I  &lt;br&gt;
&amp;gt; find it hard to think of how to do this. Thanks&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &quot;M Ladderman&quot; &amp;lt;mirresimons@gmail.com&amp;gt; wrote in message  &lt;br&gt;
&amp;gt; &amp;lt;hcq12a$cv$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; Hi guys,&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; The fish is not on ice it is in a small tank with water and what you  &lt;br&gt;
&amp;gt;&amp;gt; think is ice is whitish foam.. I could have used black foam but then I  &lt;br&gt;
&amp;gt;&amp;gt; think I would have had the same problem with the top of the fish not  &lt;br&gt;
&amp;gt;&amp;gt; having a clear 'edge'. I could use different colours however... I do  &lt;br&gt;
&amp;gt;&amp;gt; not want reflexion from this. I have now also posted a colour image so  &lt;br&gt;
&amp;gt;&amp;gt; that my setup is more clear maybe..&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Any more suggestions on coding I could use are very welcome..&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
You might be able to use ideas like active contours (others might  &lt;br&gt;
clarify), where you could start out with an average 'drop shape' and then  &lt;br&gt;
use gradient maps to fit this shape to the particular fish.&lt;br&gt;
&lt;br&gt;
However, doing a better job at the image acquisition stage would be so  &lt;br&gt;
much easier :)&lt;br&gt;
&lt;br&gt;
For example, with the current image.. simple thresholding would give you a  &lt;br&gt;
decent input for your image processing pipeline:&lt;br&gt;
&lt;br&gt;
in=imread('in.jpg');&lt;br&gt;
hsv=rgb2hsv(in);&lt;br&gt;
v=hsv(:,:,3);&lt;br&gt;
imtool(v); %use the contrast button to find a good range&lt;br&gt;
%Fish = .24,.5 range&lt;br&gt;
v(v&amp;gt;.24 &amp; v&amp;lt;.5)=0;&lt;br&gt;
imtool(v)&lt;br&gt;
&lt;br&gt;
If you can ensure that the fish is placed at the center of a uniformly  &lt;br&gt;
white background, you will most likely get much better results. Noting  &lt;br&gt;
that the fins are translucent, you might even be able to get rid of them  &lt;br&gt;
using the same logic of thresholding.</description>
    </item>
    <item>
      <pubDate>Wed, 14 Apr 2010 11:32:04 -0400</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#736010</link>
      <author>M Ladderman</author>
      <description>Hi all,&lt;br&gt;
&lt;br&gt;
Sorry to have to ask for your help again, I thought making the mask from the connected nodes I get from us his code I can create the mask I need. However this is not the case. I just want to fill the area that is enclosed by the lines drawn between the nodes and use that as a binary mask, but I cant find a way to do this :(&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Ashish Uthama&quot; &amp;lt;first.last@mathworks.com&amp;gt; wrote in message &amp;lt;op.u2xtbaqya5ziv5@uthamaa.dhcp.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; On Thu, 05 Nov 2009 10:00:04 -0500, M Ladderman &amp;lt;mirresimons@gmail.com&amp;gt;  &lt;br&gt;
&amp;gt; wrote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Hi after tweaking the settings of my edge detection and using imclose I  &lt;br&gt;
&amp;gt; &amp;gt; get pretty close in selecting my fish. However now I have the problem  &lt;br&gt;
&amp;gt; &amp;gt; that I do not want to select its tail fin, so the part of the fish on  &lt;br&gt;
&amp;gt; &amp;gt; the rightest part of the photograph. So coming back to my point, is  &lt;br&gt;
&amp;gt; &amp;gt; there an &quot;easy&quot; way to fit a drop shape (which is pretty much what the  &lt;br&gt;
&amp;gt; &amp;gt; fish body looks like) to the binary mask and select only those pixels? I  &lt;br&gt;
&amp;gt; &amp;gt; find it hard to think of how to do this. Thanks&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &quot;M Ladderman&quot; &amp;lt;mirresimons@gmail.com&amp;gt; wrote in message  &lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;hcq12a$cv$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Hi guys,&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; The fish is not on ice it is in a small tank with water and what you  &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; think is ice is whitish foam.. I could have used black foam but then I  &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; think I would have had the same problem with the top of the fish not  &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; having a clear 'edge'. I could use different colours however... I do  &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; not want reflexion from this. I have now also posted a colour image so  &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; that my setup is more clear maybe..&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Any more suggestions on coding I could use are very welcome..&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You might be able to use ideas like active contours (others might  &lt;br&gt;
&amp;gt; clarify), where you could start out with an average 'drop shape' and then  &lt;br&gt;
&amp;gt; use gradient maps to fit this shape to the particular fish.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; However, doing a better job at the image acquisition stage would be so  &lt;br&gt;
&amp;gt; much easier :)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; For example, with the current image.. simple thresholding would give you a  &lt;br&gt;
&amp;gt; decent input for your image processing pipeline:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; in=imread('in.jpg');&lt;br&gt;
&amp;gt; hsv=rgb2hsv(in);&lt;br&gt;
&amp;gt; v=hsv(:,:,3);&lt;br&gt;
&amp;gt; imtool(v); %use the contrast button to find a good range&lt;br&gt;
&amp;gt; %Fish = .24,.5 range&lt;br&gt;
&amp;gt; v(v&amp;gt;.24 &amp; v&amp;lt;.5)=0;&lt;br&gt;
&amp;gt; imtool(v)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If you can ensure that the fish is placed at the center of a uniformly  &lt;br&gt;
&amp;gt; white background, you will most likely get much better results. Noting  &lt;br&gt;
&amp;gt; that the fins are translucent, you might even be able to get rid of them  &lt;br&gt;
&amp;gt; using the same logic of thresholding.</description>
    </item>
    <item>
      <pubDate>Wed, 14 Apr 2010 11:39:04 -0400</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#736012</link>
      <author>M Ladderman</author>
      <description>sorry this had to go into another thread&lt;br&gt;
&lt;br&gt;
&quot;M Ladderman&quot; &amp;lt;mirresimons@gmail.com&amp;gt; wrote in message &amp;lt;hq493k$hpm$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Sorry to have to ask for your help again, I thought making the mask from the connected nodes I get from us his code I can create the mask I need. However this is not the case. I just want to fill the area that is enclosed by the lines drawn between the nodes and use that as a binary mask, but I cant find a way to do this :(&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Ashish Uthama&quot; &amp;lt;first.last@mathworks.com&amp;gt; wrote in message &amp;lt;op.u2xtbaqya5ziv5@uthamaa.dhcp.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; On Thu, 05 Nov 2009 10:00:04 -0500, M Ladderman &amp;lt;mirresimons@gmail.com&amp;gt;  &lt;br&gt;
&amp;gt; &amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi after tweaking the settings of my edge detection and using imclose I  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; get pretty close in selecting my fish. However now I have the problem  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; that I do not want to select its tail fin, so the part of the fish on  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; the rightest part of the photograph. So coming back to my point, is  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; there an &quot;easy&quot; way to fit a drop shape (which is pretty much what the  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; fish body looks like) to the binary mask and select only those pixels? I  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; find it hard to think of how to do this. Thanks&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &quot;M Ladderman&quot; &amp;lt;mirresimons@gmail.com&amp;gt; wrote in message  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;lt;hcq12a$cv$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; Hi guys,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; The fish is not on ice it is in a small tank with water and what you  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; think is ice is whitish foam.. I could have used black foam but then I  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; think I would have had the same problem with the top of the fish not  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; having a clear 'edge'. I could use different colours however... I do  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; not want reflexion from this. I have now also posted a colour image so  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; that my setup is more clear maybe..&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; Any more suggestions on coding I could use are very welcome..&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; You might be able to use ideas like active contours (others might  &lt;br&gt;
&amp;gt; &amp;gt; clarify), where you could start out with an average 'drop shape' and then  &lt;br&gt;
&amp;gt; &amp;gt; use gradient maps to fit this shape to the particular fish.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; However, doing a better job at the image acquisition stage would be so  &lt;br&gt;
&amp;gt; &amp;gt; much easier :)&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; For example, with the current image.. simple thresholding would give you a  &lt;br&gt;
&amp;gt; &amp;gt; decent input for your image processing pipeline:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; in=imread('in.jpg');&lt;br&gt;
&amp;gt; &amp;gt; hsv=rgb2hsv(in);&lt;br&gt;
&amp;gt; &amp;gt; v=hsv(:,:,3);&lt;br&gt;
&amp;gt; &amp;gt; imtool(v); %use the contrast button to find a good range&lt;br&gt;
&amp;gt; &amp;gt; %Fish = .24,.5 range&lt;br&gt;
&amp;gt; &amp;gt; v(v&amp;gt;.24 &amp; v&amp;lt;.5)=0;&lt;br&gt;
&amp;gt; &amp;gt; imtool(v)&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; If you can ensure that the fish is placed at the center of a uniformly  &lt;br&gt;
&amp;gt; &amp;gt; white background, you will most likely get much better results. Noting  &lt;br&gt;
&amp;gt; &amp;gt; that the fins are translucent, you might even be able to get rid of them  &lt;br&gt;
&amp;gt; &amp;gt; using the same logic of thresholding.</description>
    </item>
    <item>
      <pubDate>Tue, 27 Apr 2010 11:12:04 -0400</pubDate>
      <title>Re: Help with image processing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264827#739759</link>
      <author>M Ladderman</author>
      <description>imline() will do the trick with .createMask , be sure that you have image processing toolbox ver 6.0&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;M Ladderman&quot; &amp;lt;mirresimons@gmail.com&amp;gt; wrote in message &amp;lt;hq49go$ncv$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; sorry this had to go into another thread&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;M Ladderman&quot; &amp;lt;mirresimons@gmail.com&amp;gt; wrote in message &amp;lt;hq493k$hpm$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hi all,&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Sorry to have to ask for your help again, I thought making the mask from the connected nodes I get from us his code I can create the mask I need. However this is not the case. I just want to fill the area that is enclosed by the lines drawn between the nodes and use that as a binary mask, but I cant find a way to do this :(&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thanks&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &quot;Ashish Uthama&quot; &amp;lt;first.last@mathworks.com&amp;gt; wrote in message &amp;lt;op.u2xtbaqya5ziv5@uthamaa.dhcp.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; On Thu, 05 Nov 2009 10:00:04 -0500, M Ladderman &amp;lt;mirresimons@gmail.com&amp;gt;  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Hi after tweaking the settings of my edge detection and using imclose I  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; get pretty close in selecting my fish. However now I have the problem  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; that I do not want to select its tail fin, so the part of the fish on  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; the rightest part of the photograph. So coming back to my point, is  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; there an &quot;easy&quot; way to fit a drop shape (which is pretty much what the  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; fish body looks like) to the binary mask and select only those pixels? I  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; find it hard to think of how to do this. Thanks&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &quot;M Ladderman&quot; &amp;lt;mirresimons@gmail.com&amp;gt; wrote in message  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;lt;hcq12a$cv$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; Hi guys,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; The fish is not on ice it is in a small tank with water and what you  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; think is ice is whitish foam.. I could have used black foam but then I  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; think I would have had the same problem with the top of the fish not  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; having a clear 'edge'. I could use different colours however... I do  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; not want reflexion from this. I have now also posted a colour image so  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; that my setup is more clear maybe..&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;gt; Any more suggestions on coding I could use are very welcome..&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; You might be able to use ideas like active contours (others might  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; clarify), where you could start out with an average 'drop shape' and then  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; use gradient maps to fit this shape to the particular fish.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; However, doing a better job at the image acquisition stage would be so  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; much easier :)&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; For example, with the current image.. simple thresholding would give you a  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; decent input for your image processing pipeline:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; in=imread('in.jpg');&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; hsv=rgb2hsv(in);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; v=hsv(:,:,3);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; imtool(v); %use the contrast button to find a good range&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; %Fish = .24,.5 range&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; v(v&amp;gt;.24 &amp; v&amp;lt;.5)=0;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; imtool(v)&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; If you can ensure that the fish is placed at the center of a uniformly  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; white background, you will most likely get much better results. Noting  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; that the fins are translucent, you might even be able to get rid of them  &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; using the same logic of thresholding.</description>
    </item>
  </channel>
</rss>

