Question: Counting certain pixels

Hi
I'm doing a research about copper associated hepatitis in dogs. Now we are trying to set up a new method of diagnosis. The principle is to measure the amount of area that contains copper on a picture of liver tissue as a percentage. The tissue is stained with a chemical which results in a good contrast between copper and no-copper areas.
My question:
Does anybody know some way to count the amount of pixels(or the percentage of area) that exceeds my certain threshold of RGB colors?
Thanks!
Tjebbe Waalwijk

quick and easy method:
(1) set the color picker to point sample
(2) select the magic wand tool, chose a useful tolerance level for your purposes, deselect both anti-alia and contiguous
(2) zoom into the picture
(3) click on a "copper pixel"
(4) click on histogram panel
result: see screenshot. In my example the result would be 37646 pixels.
(don't forget to click on the exclamation mark, otherwise values are rough estimates only)
However I don't think the mere pixel count is very helpful scientifically as it may depend on how dark those pixels are vs. the size of the area, and lots of other factors right?
full size image: http://img140.imageshack.us/f/20110414040146screenhun.png/

Similar Messages

  • Automated process to crop away certain pixels

    How can I automate the process to crop away certain pixels from the edges of a batch of pictures of different dimension?
    Example:
    Picture 1 : 400 x 600px
    Picture 2 : 360 x 480px
    Picture 3 : 600 x 800px
    I want to crop away 5px from each edge of each picture which would then end up being 390x590px, 350x470px and 590x790px respectively.

    MichaelTeoh wrote:
    I want to crop away 5px from each edge of each picture which would then end up being 390x590px, 350x470px and 590x790px respectively.
    Example:
    Picture 1 : 400 x 600px    = 400:600 = 4:6 =  2:3
    Picture 2 : 360 x 480px    = 36:48 = 6:8 = 3:4
    Picture 3 : 600 x 800px   =  3:4
    So you can record the three action to center crop your images to the 2:3 and 3:4 aspect ratios  shown in your examples then use image size to size them you three example  pixel sizes then use canvas size to to trim the 5 px of the border,  just set the canvas to you three sizes 390x590px  350x470px and 590x790px do not check relative and leave the anchor point in the center.  Five pixels will be trimmed form all sides. Any image that started with the correct 2:3 or 3:4 aspect ratios will not be cropped by the first crop only the canvas size crop will trim pixels.
    To handle both Portrait and Landscape image the action would need to record a fit image step instead of the image size step a fit image step fit to longest side need to be recorded  and the canvas size would need to be recorded to trim both width and height by a relative -10px.   My  AspectRatioSelection plugin will automatically orient the aspect ratio recorded to the images orientation.

  • Want to know the PANTONE color of at a certain pixel of the image

    Dear Sir ,
    I am designing a software that will get the pantone color of certain location of the image . I will define a certain pixel location of the image , then I want the software to detect the equivalent pantone color .
    NB> the image is obtained from a scanner .
    thanks, Dr.WS Mak.

    Dear Dir ,
    Thank you so much for you interest , I really appreciate it so much .
    Regarding the Pantone color table ( conversion between Pantone and RGB system ) , I have that table in *.mdb (MicroSoft Access Database) that have each Pantone color and the corresponding RGB , CMY and HEX values .
    The problem is  : HOW to make such comparisons to get the corresponding Pantone . To make the situation easier to you , I have a certain color that is supposed to be a certain  Pantone C137 . I want to check if it is Pantone C137 or not  . I need this to be done by getting the CORRLEATION between two colors , ie the test color is 100 % of Pantone C137 , ie Iam 100% certain that the test color is the Pantone color . In the real world  , the test color may not be the same as Pantone C137 , if it is very close to the reference color , it the correlation will be 99.85 % , and so on . I will make my software make a tolerance for the test color , ie my tolerance is 2 % . ie , I will only accept colors that are 2 % different from the reference color . NB> I can get the reference color (eg in this case Pantone C137) by scanning this pantone and storing the color in the software .
    if you can supply me with a simple code that can compare 2 colors together and get the correlation between them , it will be so helpfull .
    Thanks.
    Best Regards,
    Dr.WS Mak.

  • How come a font set at a certain pixel size is not actually that size when you measure it's height? For example, a font set at size 24 pixels is actually only 16 pixels tall (cap height).

    How come a font set at a certain pixel size is not actually that size when you measure it's height? For example, a font set at size 24 pixels is actually only 16 pixels tall (cap height).

    Hello, indeed, as Semaphoric stated, the Em box is not the same as the Cap heigh...
    It is described in length in this blog post by Thomas Phinney http://www.thomasphinney.com/2011/03/point-size/
    THis article has good images also that illustrate the em square: Font Bureau Blog | The Em

  • Question Count Error

    I'm reusing a template which inlcudes questions. When I
    add/delete questions from the template, for example the question
    count of five (5) is correct when editing the file, however, when I
    export it, (SWF) the question count starts at seven (7) vice one
    (1). Anyone encountered this?

    Hi r6urbv
    Yes, this question could easily fall into a FAQ category.
    Check your movie for Click Boxes. Each Click box typically
    has coring enabled as a default. Edit the properties, click the
    Reporting tab and turn off scoring.
    Hopefully this helps... Rick

  • How to locate certain pixels and picture them in RGB image

    Dear all:
    I have a code, as the attached one in LV 8.2, and have problems for this. I hope someone can kindly help me.  I have a 2-D data set, just like the random numbers generated for a 512x500 array in the code. I need to locate all pixels with values higher than a threshold, say 0.8 in the code, and all pixels with values lower than another certain threshold, say 0.2 in the code. The purpose is to picture the array with gray level color, and give different colors for groups of higher or lower values.
    In my code, I got the following problems. First, when I count the number of pixels in a certain group, the value, for "large" and "small" indicators, are negative. What mistake did I make?
    Second, I plan to duplicate the initial array (data set) and locate all the pixels with the expected values, assigning the zero value to each of them. Then, combine three arrays into one 512x500x3. I used Build Array in the code but got 3x512x500. What mistake did I make here?
    Third, I plan to picture the data set in an intensity graph (I hope I did it right). Since the initial data is a 2-D array, it is supposed to be black-and-white in gray level, but I always got blue-and-white. Sigh, what silly mistake did I make for this?
    Fourth, as you can see that eventually I am supposed to obtain a 3-D array. Each pixel without the expected values will have 3 the same values as the initial one. Each pixel with the expected values will have 2 the same values as the initial one and 1 zero. If I can present this array in a RGB image, the pixels without the expected values are supposed to have gray color, and the pixels with the expected values are supposed to have color different than gray. Is it possible to draw such a picture in LV? And is it possible to save such a picture?
    I really appreciate for anyone who can help me figure out my mistakes and correct my code. Thank you very much in advance.
    Attachments:
    LocatePixels.vi ‏24 KB

    Hi ccyang,
    This is Stephen in Applications Engineering.  I've started taking a look at your questions and I wanted to let you know that I've found a solution to your first issue.  The 512x500 array that you created has approximately 250,000 values.  Since the random number generator is uniform, we can expect ~50,000 to be greater than 0.8.  50,000 is larger than the value that an I16 integer can hold.  An I16 integer type is the default output for the Boolean to (0,1) function you are using.  Therefore, add a "To Quad Integer" conversion function to your block diagram after the Boolean converter but before the sum.  I'll be back soon with the solutions to the other two questions.  Just wanted to let you know I was working on a solution.
    Stephen Meserve
    Applications Engineering
    National Instruments
    Stephen Meserve
    National Instruments

  • Satellite 5100 - Question about dead pixels. Is it really dead pixel problem?

    Hi,
    I've got Satellite 5100-603. There have been some dead pixels on display. I don't know is it really dead pixel problem or not because the black area seems to be behind the screen. When i move left and right sides, the black area moves left and right sides too (as if the black area is behind the screen pixels)! And i can tell that all pixels are working OK when i look from the right and left sides of the display (because the pixels that seems to be dead, changes at different looking angles).
    Are there really dead pixels or is it some other problem?
    Is there anything that i can do about it?
    For info, i am using my laptop for 2,5 years and there is no warranty of course...
    Thanks for any help..

    Hi
    to answer your question I will try to make a simple description the layout of the TFT display.
    I'll go from the front to the back.
    In the front is a tough plexi-glass like layer to protect the screen from harm and the user from glass in case the TFT should break. It is also prepared in a way that will soften the reflections from behind (that does not go for the newer SuperBright screens).
    Behind that is the 2 layers (at least 1 of glass, probably both) that hold the actual matrix of the pixels.
    Behind theese 2 are a very complex set of layers that take care of the backlight. It consists of various numbers of films that should spread the light from the singel FL-tube evenly across the complete screen. Not a easy task if you ask me!
    Sometimes, physical stress or dirt can make 'blotches' appear on the screen and they are in fact either dirt on the backmost layer or marks on the same. If there is dirt or marks on it, that will 'shadow' the light that comes out from it and show dark spots on the screen. They are quite different from defective pixels.
    The defective pixels do not change with the angle of view for example.
    I think you cannot do anything about this except changing screen. The construction is very complex and sensetive.
    BR Tom

  • Dumb Question: Count of Rows Returned?

    I am using a dbcontrol to get rows from the database. I am using the netui-repeater to display the results. The repeater datasource is "request.results".
    My question is how do I get the total number of records returned from the query?
    I know this is should be a simple thing, but I have been unable to get the number.
    Thanks...

    Suggested implementation:
    typedef void (^MSCountQueryBlock)(NSInteger resultCount,
                                     NSError *error);
    /// Sends a request to the Windows Azure Mobile Service to return the row count/// from the table that meet the conditions of the given predicate.
    -(void)countRowsWithPredicate:(NSPredicate *) predicate
          completion:(MSCountQueryBlock)completion;

  • Simple, funny but annoying question, putting a pixel

    Maybe this could be simple, funny but annoying question.
    How do you put a pixel or draw a pixel?
    Is there a method to draw a pixel directly on screen in j2SDK API?

    This is a very open ended question, do you want to draw a pixel in an image or just draw a shape on the screen?
    If you want to edit single pixels at a time then the best option is to create a BufferedImage and use the WritableRaster to edit the pixels you want by using setPixel().
    Something like the following:
    BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    WritableRaster raster = img.getRaseter();
    raster.setPixel(x_coord, y_coord, new int[]{R_val, G_val, B_val});This image can then be displayed by putting it in a JLabel (there are many other techniques but I find this the easiest method).
    JLabel l = new JLabel(new ImageIcon(img));
    JFrame jf = new JFrame();
    jf.setContentPane(l);
    jf.pack();Alternatively, you can draw shapes by using Graphics or Graphics2D objects
    e.g.
    public class MyPanel extends JPanel
      public void paintComponent(Graphics2D g)
         super.paintComponent(g);
         g.drawLine(x1,y1,x2,y2);
    }Hope this helps,
    Stef

  • Newby question: counting redelivering trials

    I use jms with MDB. I send messages successful to a queue and the MDB gets them. I put the message back
    to the queue if proccessing message did not succeed.
    My problem is, that I have to know how many times the
    message has been put to queue again, because this action should be done only ten times. The Message objects given to onMessage are readOnly - that I know.
    My question: is there a way to count the retries without creating a new Message and putting this new one(with an increased counter) to queue instead of
    original one? If mentioned idea is the only one please tell me too.

    Hi!
    I'm not quite sure, if I understood you right. Do you mean that you have to send same message again and again in the case that reciver won't get the message?
    You can use persistent messages that will stay in db if receiver is not present.
    QueueSender sender = ... //create sender
    sender.setDeliveryMode(DeliveryMode.PERSISTENT);Second quess: Your receiver is processing some task and if it fails, you want to send message again?
    Possible solution: use request-reply functionality included in poin-to-point domain. Then your sender or requestor will block until receiver will send reply back. Your sender can read the reply and if reply contains an error message, send message again and stop sending after ten times.
    Does this help you at all?
    -Raine-

  • Analyze monochrome image using histogram(count white pixels)

    Hi ,
    Am still a begginner in Java and i have a project to analze image using histogram and display the result...i've been working on different things till i reached to this code(below) which is missing the count function(my target), this code takes a .bmp image and display the histogram..but there is a problem in the result coz i don't know how to put the count function in it ...the count function counts the white pixels only through its pixels' scan and the count result is displayed on the histogram .....
    kind of:
    for(h=0,h<image size,h++)
    if{
    pixel is white then Count ++ and put number on histogram else get out of the loop ...........
    So Plz Any HELP!!!!!!!
    this is my code for editting:
    package display;
    import java.awt.BorderLayout;
    import java.awt.image.renderable.ParameterBlock;
    import javax.media.jai.Histogram;
    import javax.media.jai.JAI;
    import javax.media.jai.PlanarImage;
    import javax.swing.JFrame;
    public class DisplayHistogramApp extends JFrame
    private DisplayHistogram dh;
    public DisplayHistogramApp(String name,Histogram histo)
    setTitle("Histogram of "+name);
    getContentPane().setLayout(new BorderLayout());
    dh = new DisplayHistogram(histo,"Histogram of "+name);
    getContentPane().add(dh,BorderLayout.CENTER);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    pack();
    setVisible(true);
    public static void main(String[] args)
    PlanarImage image = JAI.create("fileload", args[0]);
    ParameterBlock pb = new ParameterBlock();
    pb.addSource(image);
    pb.add(null);
    pb.add(1);
    pb.add(1);
    pb.add(new int[]{256});
    pb.add(new double[]{0});
    pb.add(new double[]{256});
    PlanarImage temp = JAI.create("histogram", pb);
    Histogram h = (Histogram)temp.getProperty("histogram");
    new DisplayHistogramApp(args[0],h);
    Regards to All..

    HI.....I mentioned in my first post that I am a beginner in JAVA..Inaddition,this is my first project...and am still a student too !!!
    Also I wonna thank Maxideon for the help:)..I followed the steps you gave to me and i read a little about swing and took the paintComponent(...) from DisplayHistogram..probably i did same thing used(Display Histogram and DisplayHistogramApp)..And i put the hist[x] in the main...called it from ColumnHistogram as
    public ColumnHistogram(int[] hist) {
                 this.hist = hist;
           }Upon buildMainProject no errors occured..however when Run...a Disaster showup:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at mine.ColumnHistogram.paintComponent(ColumnHistogram.java:107)
    at javax.swing.JComponent.paint(JComponent.java:1027)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:564)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paintToOffscreen(JComponent.java:5129)
    at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:277)
    at javax.swing.RepaintManager.paint(RepaintManager.java:1217)
    at javax.swing.JComponent.paint(JComponent.java:1013)
    at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
    at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
    at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
    at java.awt.Container.paint(Container.java:1762)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
    at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:694)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    What might me My Mistakes!!!???
    Regards

  • How can i find out what color is a certain pixel in a picture file?

    Do any of you know if there is some command that returns the color of a pixel in RGB format or something from a picture file?

    I think the best way to find pixel RGB from a an image is to use extension of java.awt.RGBImageFilter
    Load the picture file as java.awt.Image and apply that Filter you can easily get the RGB of your desired pixel
    Replies and queries are greatly appreciated
    Ejaz Hussain
    class ColorFilter extends RGBImageFilter{
    public ColorFilter() {
    //whether or not to apply the color filtering
    canFilterIndexColorModel = true;
    public int filterRGB(int x, int y, int rgb) {
    //just store the RGB of your desired pixel at any x,y
    return rgb;

  • Unanswered Questions Count is Wrong

    Hello Sysops (hehehe). Unanswered Questions is wrong for me. Thought you might want to look into that.
    Cheers

    Hello BioRich,
    Could you explain what you mean by wrong?
    Is your situation similar to This Poster's issue?
    Or This One?
    ali b

  • Count certain rows more than once

    I have the sql below:
    select count(*), ind_encounter
    from (
    select x.sak_recip, x.dte_first_svc, x.ind_encounter
    from t_tmp x
    group by x.sak_recip, x.dte_first_svc, x.ind_encounter
    union all
    select x.sak_recip, x.dte_first_svc, x.ind_encounter
    from t_tmp x
    where x.sak_procedure in (1, 2, 3, 4) )
    group by ind_encounter
    What I need to do is count the sql in bold more than once. If one row in the table has sak_procedure = 1, I want to count that row 13 times. I know that if union 11 more sqls, I will count those 13 times.
    I would like to know if someone knows an easer way.
    thanks for your help

    try
    select count(*), ind_encounter,
             sum(cnt1) -- your counter
      from (select x.sak_recip, x.dte_first_svc, x.ind_encounter, count(*) * N cnt1
              from t_tmp x
             group by x.sak_recip, x.dte_first_svc, x.ind_encounter
            union all
            select x.sak_recip, x.dte_first_svc, x.ind_encounter, count(*) * M cnt1
              from t_tmp x
             where x.sak_procedure in (1, 2, 3, 4)
            group by x.sak_recip, x.dte_first_svc, x.ind_encounter
             group by ind_encounterEdited by: AlexAnd on Dec 4, 2011 11:21 PM

  • Presentation shows too many questions in Question count - Progress Indicator

    I just downloaded Captivate 7 and made a template for my presentation.  I then imported some Powerpoint slides into the presentation after creating a project from the template.  That all worked fine, but the template and the project list 11 questions while I actually only have 2 question slide and the results slide in the template and in the presentation.  Just wondering why that is and if there is a way to fix that.
    I do notice that I have 6 master slides also, 1 for content and 5 for question types (MCQ/T-F/etc., Matching, Hot Spot, Likert and Result.
    Any pointers on that.
    Can't wait to test out the HTML5 features and the LMS reporting features.
    Stephen

    Hello,
    Could you check Advanced Interaction (F9)? I think you have some scored objects besides the Questions. All interactive objects can be scored: click boxes, (shape) buttons, Text Entry Boxes. That view is linked with the Properties panel, if you select such a scored object, you can change its properties in the Properties panel, look for the Reporting accordion.
    Forgot to answer about the master slides. No way to escape from those 6 slides, the minimum (Blank theme has that minimum). It is one of the reasons why I don't like those damned themes. You can add master slides, you can use the main master slide for objects/background that you want to have on different child master slides, but the Question slides/Score slide always will use their dedicated master slides.
    In many cases Themes can replace templates because they also have the object styles and skin editor included (that part of themes I like a lot). Only if you want real placeholders, and perhaps variables, advanced actions you'll need a real template.
    Lilybiri

Maybe you are looking for