Question on image analysis.

Hi,
I looked into tutorials on Java2D which teaches me on transforming images.
But I want to analyse images (in common formats like JPEG). For example, I
want to get, say, % of area in yellow color, % in red, green etc. Something
like that. I presume this would require to read the image line by line,
pixel by pixel and get the attributes (color) of each pixel. Is it the
correct direction for me to study tutorials on iostream (to read the image
file)?
Any guidelines and reference for me?
thanks in advance,
jackling.

I haven't kept up with the new fangled java image stuff, but the way I used to play with pixels was as follows:
pixelArray = new int[width * height];
try{
       pixelGrab = new PixelGrabber(rawImage,0,0,width,height,pixelArray,0,width);
            if(pixelGrab.grabPixels() && ((pixelGrab.getStatus() & ImageObserver.ALLBITS) != 0)){
            } else {
                //throw some kind of exception
        } catch(InterruptedException e) {
            System.out.println("MapInteraction::ripImage ~ failed to grab pixels from image");
    }then you can do manipulations using the ARGB channels for each individual pixel. The array that is generated holds scan lines of the original image in sequence, so therefore pixel 1,1 (from top left, starting @ 0,0) would be @ pixelArray[width*1 + 1].
Example of bit analysis using bitwise operators:
if ( (pixelArray[y*width + x] & 0x00FF0000) == 0x00FF0000 ) {
Make sure your in 32-bit colour resolution when you do the ripping. I've had issues in the past when I was doing analysis expecting 32-bit mode and forgetting to set it!!

Similar Messages

  • Image analysis with PS CS3 EE

    First off, I need to apologize if I am not very clear on this issue Im fairly math challenged and know enough about Excel to fill out a time sheet and make an invoice. If this kind of thing is up your alley, you are just what were looking for.
    We are attempting to use the image analysis tools in CS3 EE and Microsoft Excel to determine a number of things in order for a set of photo images to meet a given set of requirements. Most of this has to do with examining histograms and determining things like average pixel levels for each of RGB channels, % of pixels in a given range, and percentage of the image that is clipped. This analysis would be done on a random sample of files in order to show the client that the images meet their standards.
    Some starting questions:
    From what I see of the CS3 analysis tool, it seems to zero in on the gray channel information (perhaps this was developed for the medical diagnostic community) and Im wondering if you can export the same information (Gray Value Minimum-Maximum-Mean) for the R, G and B channels.
    Does anyone already have the Excel formulas for extracting this information for the Histogram.csv that is generated by the analysis features?
    This ones a bit murky - is there any method to calculate the numeric value of Contrast (the difference between the histogram reading at .01 and 99% and have that as exportable data?
    This one is more like a feature request (or is there another plug-in or other software to do this):
    Is it possible to view all three channels (RGB) with the same detailed histogram information as the main view, without having to toggle between the various bands?
    Anyway, I know this long and I appreciate your time. I will follow this post closely and if you think you can help Id be happy to go off forum with this.
    Thanks! TLL

    I'm envisioning doing this in AppleScript, and am assuming a histogram in JS is the same...
    >% of pixels in a given range
    Divide 256 by however many "range segments" you need. For simplicity, let's say 3: highlight, midtone, and shadow ranges. So (roughly) levels 0-85 are shadows, 86-171 are midtones, and 172-255 are highlights. You would iterate through each range of the histogram counting the number of pixels for that range. Divide each count by the total number of pixels.
    >percentage of the image that is clipped.
    The amount of clipping can be determined by how many pixels are dedicated to levels 0 and 255 of the histogram. If those levels have a high number of pixels, then you have clipping. You have to define for yourself what "high number" means, but in a "perfect" photo, you won't have pixels at levels 0 or 255 (pure white and pure black).
    Carl.

  • Image analysis

    Hi, I would like to know if the Cisco IronPort email security supports the Image analysis, If yes what is there any license required? Thank you

    Yes, its under "Security Services>Image Analysis"
    Its does require a feature key.
    Check with your reseller for pricing... they might be able to get you a demo key so you can see if it catches what you want it to catch...

  • Intermedia Image Analysis cant find DLL

    Win2k, Oracle 8.1.6EE. Fresh installations.
    With a new installation of Oracle, create a SHARED database using connection pooling etc. On another identical machine also create a standard default database from the CD.
    On both the standard default database and the shared one, can set the properties of images in ORDVIR objects.
    Only on the default can I analyse the images. On the shared I get the following error:
    err:ORA-06520: PL/SQL: Error loading external library
    ORA-06522: Unable to load
    DLL at 10000100
    I've not changed the SQLNET, TNSNAMES or LISTENER since the setup did it for me as it looks OK, and as I say - works for setting the properties, just not the image analysis.
    Any ideas?
    Here are the files:
    # SQLNET.ORA Network Configuration File: C:\Oracle\Ora81\network\admin\sqlnet.ora
    # Generated by Oracle configuration tools.
    NAMES.DEFAULT_DOMAIN = web.cre8tiv.com
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES)
    # LISTENER.ORA Network Configuration File: C:\Oracle\Ora81\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    LIVELISTENER1 =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rioja)(PORT = 1521))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    SID_LIST_LIVELISTENER1 =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\Oracle\Ora81)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = islive1.web.cre8tiv.com)
    (ORACLE_HOME = C:\Oracle\Ora81)
    (SID_NAME = islive1)
    # TNSNAMES.ORA Network Configuration File: C:\Oracle\Ora81\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    ISLIVE1.WEB.CRE8TIV.COM =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rioja)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = islive1.web.cre8tiv.com)
    (INSTANCE_NAME = islive1)
    EXTPROC_CONNECTION_DATA.WEB.CRE8TIV.COM =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    Thanks, Jason.

    Thanks - this does appear to be the problem.
    I can reproduce this affect on any clean machine with a fresh install so there is obviously an Oracle bug here.
    Running the command
    select FILE_SPEC from all_libraries where library_name = 'ORDVIRLIBS';
    gives the output
    C:\Oracle\Ora81\lib\libordvir8.so
    for any non-default installation of a database created using the DBCA which uses InterMedia&Virage.
    The file libordvir8.so doesn't exist.
    It should have been oraordvir8.dll in the bin directory which does exist.
    Thanks,
    Jason.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by lguros():
    You may want to do a
    select library_name from all_libraries where library_name = 'ORDIMLIBS';
    and
    select library_name from all_libraries where library_name = 'ORDVIRLIBS';
    and make sure the FILE_SPEC field is valid and points to a correct shared object or DLL.
    If you DB location was moved, these will no longer be valid.<HR></BLOCKQUOTE>
    null

  • GUI Tool for Image Analysis (delimited ascii file)

    i've created a Java GUI Tool for Image Analysis. It does length calculation and locate the coordinate of centroid of an image...the problem now is how do i save the results in a delimited ascii file??

    Create a FileOutputStream, use that to construct a PrintWriter, then use the PrintWriter as you use System.out. Print out the data, then append the delimiter manually after each set of data.
    To get the file, the simplest ways would be to hard code an output file name or at least have a text field so the user can enter it. If you want it to look more professional, use a JFileChooser.
    I hope this helps!
    -JBoeing

  • Speeding up image analysis,

    I am using a VI to analyse an AVI file showing liquid particle flow
    I want to acheive this in real time, by using the video capture card, however the system is far too slow to acheive this
    I am using colour matching, and doing some binary operations to identify particles from their background.
    im using a pentium 4 3ghz, with gig of ram, but this still runs slow
    how can i speed up the vi?
    also, i would like to use an overlay function to show the particles in colour, by removing the background using binary operations, i.e. seperating the particles from their background in binary, then retriving the colour image and only displaying pixels that are set to logic one

    What are the specs of your video capture card? Could it be too slow for realtime acquisition and transfer to memory and thus the bottleneck?
    Is color needed, can you use colored filters, enhanced lighting, or use narrow band light sources to increase the S/N ratio so software has to do less processing?
    Can you do an ROI so that you do not need to process the entire image frame?
    Do you have enough pixels/particle for sufficient resolution.
    Are you using NI Vision Builder? If so, you can benchmark the execution time of each individual vision function. It is an awesome package to do vision prototyping, fooling around, and generating LV code.
    Machine vision is a science and an art with a good measure of experience and luck thrown in.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

  • Follow up question about image not looking good in canvas-Shane?

    I guess this is a follow up question for Shane....
    You wrote this in response to someone a year ago which helped me out.
    Shane's Stock Answer #49 - Why is the quality different between what I see in the Viewer and what I see in the Canvas?
    Well... the viewer is just that-- a viewer. It will display anything that fcp will recognize as usable video or graphics. The canvas is a viewer too, but at the pixel dimension specified by the settings of your project and sequence.
    For example, if your graphic or footage is much higher resolution than your 720x480 DV sequence, FCP is interpolating down your file to fit the settings of the sequence. Usually this makes it look not so hot. DV is a 5:1 compression working with a 4:1:1 color depth. Your pristine picture images and graphics are being crushed.
    Same with picture files. HIgh res pics now adopt the sequence settings and will render to those specs, and most likely they are not as high quality.
    So, based on your answer, I made an HDV sequence, dropped my DVCPro50-NTSC footage and my tiffs into the sequence and now the stills look great. Is this an okay workaround or do you have another suggestion? I'm worried about this HD sequence taking too long to make a compressed QT from in the end.
    Thanks!

    Photo JPEG is a good option.  But this all depends on what your final output will be.  If you are going to make a DVD, then that is SD, so using an HD sequence setting makes no sense.  Photo JPEG is good, but not realtime in FCP.  DV50 or ProRes NTSC are good options.
    Unless you are making an HD master...in which case ProRes 422 for HD is good

  • Help with image analysis Photoshop CS4 Extended

    Hi there - I recently went to the Birmingham NEC photo expo and saw a guy there giving a CS4 extended demo.  He showed how at the click of a button a folder of new photos were reduced to a smaller bunch of just the most tack-sharp ones.  I can't find out how to do this with my CS4 Extended - can anyone help - or am I just imagining it all  :-)))

    Sounds interesting.
    Did he do that in Photoshop itself or Bridge or Lightroom?
    Anyway, I suspect one could maybe achieve something like this in Photoshop with some fairly heavy Scripting, but I suspect the Script would have to actually open the images for analysis …

  • Question: Saving Image Files In The Repository

    Good Morning all,
    (Running CR2008)
    I have a few image files that I have saved in the Crystal Repository. It works nicely and I've tested it pretty thoroughly to make sure that connected images update across the board. It's a convenient little feature.
    Here's my question ... when you save an image file to the repository, it automatically converts the image file to a Bitmap file type. Bitmaps greatly increase the size of whatever .rpt file uses the iimage. My standard .rpt files go from about 240K to 3.4 megs. This isn't really the biggest deal in the world, but I was wondering if there is a setting that I can check that will have the repository files automatically save in JPEG format, or just keep thier original format (JPEG in this case).
    Any thoughts? Or are we stuck with the Bitmap format? If so, this might be a good subject for a 'feature request' post.
    Thanx in advance for any help.
    -TS
    Edited to add: Sorry about the double-post. I have no idea why that keeps happening. -TS
    Edited by: Tom Salvato on Jan 19, 2010 2:45 PM

    Stuck with BMP

  • Image Analysis Threshold won't work in program program freezes

    I am a new user to labview and I probably have an error in my code but the only problem is that there are no error messages I get from my code and it runs up to a point at which the program freezes and I can't click any buttons on the Front Panel. Basically everything works up to when I want to choose the Threshold of my image at this stage it creates an image of the values in the threshold buttons but I can't adjust the values anymore to find out the best values.
    I should say that I have tried my Threshold code on its own and it seems to work fine so I am really confused as to what is getting muddled up!
    Any help on what might be wrong would be helpful. I have added the VI and an image that I am analyzing.
    The process currently goes as follows, you load the image, then choose a colour plane (usually green) that gets extracted. Then you draw a line on the border of the object and it rotates the image to make it straight and then you choose a ROI and it cuts the main object out. Finally at the point when you should be choosing a Threshold it hangs.
    Thanks for any help!
    Solved!
    Go to Solution.
    Attachments:
    Image adjustment version 4a.vi ‏143 KB
    Sample 2.jpg ‏2359 KB

    Hi,
    The root of your problem is in how you have used multiple event structures. Typically, a program should just have one event structure, which handles all events during the program. The vision functions were all working correctly!
    From looking at what you are trying to do, I think it would be worth using a well known architecture called the state machine with events. I'll attach some code framework to show you what it might look like for you, you can adapt it to suit your program. I hope its enough for you to get an idea of what I'm trying to show you, it doesn't have any code in it yet, but I think it gets the idea across, and if you combine it with the link below on state machines, it may help you to set out your code in a better architecture.
    A few links you may find helpful:
    Event programming: http://www.ni.com/white-paper/3331/en
    Caveats for using events: http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/caveatsrecmndtnsevnts/
    State machine: http://www.ni.com/white-paper/2926/en
    let me know if you have any more questions.
    Ian S
    Applications Engineer CLD
    National Instruments UK&Ireland
    Attachments:
    Event state machine example.vi ‏14 KB

  • Question about image quality! *please help*

    Hello everyone!
    I'm actually a beginner at FCP, so sorry if this question sounds kinda dumb:
    I just shot a video in a DVX100, and imported it onto FCP. When I play the video
    on the viewer, the quality of the image looks just fine. When I put it on the timeline
    for editing however, the image quality drops quite a bit. How can I match viewer settings
    with sequence settings?
    Thanks a lot!
    Stef

    Step 1 would be to ensure the sequence settings match the source video settings. If the sequence is set to a lower quality size/codec than the original video, it will be reduced in quality in the timeline.
    What sequence settings are you using?

  • Sony TG5V vs Sanyo Xacti HD1010: A QUESTION ABOUT IMAGE STABILIZATION

    i have decided to return my new Sony TG5V handycam since discovering that it does not have an external mic jack for interviews that I plan on doing. The return will not be a problem, but my new question is this:
    I did some preliminary research last night and found that the Sanyo Xacti HD1010 is very similar to the Sony TG5V, and it/the Xacti HD1010 does indeed have an external mic jack, so that solves the microphone requirement.
    Reviews have said, however, that the Sanyo HA1010 has poor IS (Image Stabilization) and that in fact, the Sony TG5V has a much better IS. I even saw some comparisons, and it is obvious that the Sony stabilizes better.
    HOWEVER: *Since I am going to edit with iMovie '09, which has a fine Image Stabilizer/Non Shake feature, would that make up for the bad shake in the raw footage?* More precisely: Would the same footage I shoot come out just as smooth with the Sanyo Xacti HD1010 with poor IS as it would come out with my Sonya TG5V and the iMovie '09 Image Stabiizer, working double time, so to speak?
    And also: I am still looking for a small, lightweight videocam that I can carry in my purse. I do not need or want a larger one. I have a larger Sony that I never use. I welcome any suggestions.
    Thank you.
    ~L

    I just bought an Xacti HD2000, convinced by what now seems to be pure "hype" about much more rapid transfer and editing in iMovie but don't see any improvement over my Canon HG20 which ricords in AVCHD. In any case, iFrame is 30fps. Sanyo made a big pitch about Xacti, iFrame and the Mac but turns out all the software and the manuals are about Windows. My requests for assistance of Sanyo got zero results, after the automated response. If you want I'll sell you my Xacti.

  • Question re: Image Files

    OK, probably a simple question (and one that I can probably
    figure out on my own, by testing it), but when selecting an image
    file from an outside directory, does RH generate a copy of that
    file in the working directory for the project? For example,
    "image.jpg" currently resides in "C:\images", while my RH project
    exists in "C:\RHProject"... When I select image.jpg from C:\images,
    is a copy of it generated in C:\RHProject (and the image reference
    for it set accordingly)?
    I ask because, I currently have a "C:\images" directory,
    where I've been saving all of my generated images and accessing
    this directory from RH. I just today was cruising around the file
    system, and I noticed some of the image files in the RH project
    directory, as well... but not all of them. The thing is, my project
    is huge, and I have hundreds of images. I don't specifically
    remember which images are used and which are trash (i.e., whether
    or not I re-worked or replaced some of them). Anyway, I really
    don't want to have to perform a manual search between each
    directory to verify... So, theoretically if all valid images are
    copied to the RH working directory, I can just delete the images in
    my "C:\images" folder.
    Thanks for any feedback
    - Chris

    First, yes RH does copy all the images to within the project.
    Second, if you are in any doubt, rename c:\images to
    something like c:\zz_images. Drops it to the bottom of your folder
    list but keeps it while you check.
    Third. Go to Tools | Reports | Images and it will show you
    all the images used. Go to Tools | Reports | Used Files and it will
    show you all the files used. You can audit one to the other to
    prove they are all in the project. Easier though is that after
    renaming c:\images, look through the images folder in Project
    Manager and just make sure there are no red Xs. (There won't be)

  • Adobe Forms - FormCalc Scripting Question for Image Control

    Hi All,
    I have three images on my master page. I have a hidden text field. Based on a certain value within this text field I need to turn off Imagefield B and ImageField C and Leave ImageField A visible.
    I know this can be done via FormCalc scripting.
    My Questions:
    Which event shoudl I put the script in? I was thinking the textfield initialize event.
    What would be the EXACT syntax to turn turn image fields on or off?
    Please inform if know.
    Regards,
    Salil

    I solved it now, just changing the FormCalc expression.
    Instead of using the expression:
    this.value.image.href = xfa.resolveNode(this.value.image.href).value;
    I used this:
    this.value.image.href = xfa.record.Images.URL;
    The URL value of Image Field, in this case is:
    <b>$record.Images[*].URL</b>
    And, to finish, I needed to add a Text Field bounded to  <b>$record.Imagens[*].URL</b>, case else the image doesn't appear.
    That's it!

  • Some question about image component

    Hi,
    I encounter two questions when using image component and can't solve it myself after reading online document.
    1. How can I get image source at runtime? I find image.source return an Object class, but not the source image path.
    2. How to ensure image loading image correctly? In my itemRenderer, I set image source with this
    source="{appURL}+{data.picname}"
    I am sure there's no problem with the path, but it shows a broken image. What's the right way?
    Thanks,

    Try adding the images to the container dynamically
    var img : Image = new Image();
    img.load("{appURL}+{data.picname}")
    img.addEventListener(Event.COMPLETE,imageLoaded);
    private function imageLoaded(event:Event):void
                  var img : Image = event.currentTarget as Image;
                   // now add the img to the container
    cheers
    Varun Rathore
    http://www.vrathore.blogspot.com

Maybe you are looking for