Why are saturation results different than Matlab's imhist() function?

We have a machine vision application where we had set some threshold levels in Matlab, and had planned on applying them to NI's IMAQ libraries. However, when trying to reproduce a set of Matlab results to verify our VB code was working, we found that we could reproduce Matlab's results on the R, G, B, and H planes, but not the S plane.
For example, if you take the 50% red image at http://www.cae.tntech.edu/~mwr/red-50.png and load it into both Vision Builder and Matlab, you get the following results:
Matlab:
rgb=imread('red-50.png');
hsv=rgb2hsv(rgb);
[hist_s,bins]=imhist(hsv(:,:,2),101);
bins(find(hist_s==max(hist_s)))
ans =
0.5000
Vision Builder 6.0.5:
Load red-50.png
Extract Col
or Planes: HSL - Saturation Plane
Histogram -> results in a peak in bin 64 on a 0-255 scale.
How many different ways are there to calculate saturation? So far, Matlab and Corel Photo-Paint agree on their calculations, and Vision Builder is the odd one.

Mike,
Thank you for posting on the forum. We spoke regarding this question, but I wanted to reply to this post with some information for other readers. You can see how we are calculating the HSL plane by examining the equations in the Vision Concepts Manual. Using the formulas, I was able to confirm that we are calculating the value for the HSL plane from the equation listed there:
S = 255(1-3min(R,G,B)/(R+G+B))
where R, G, and B in this equation are normalized. So given an RGB image (255,127,127) then we get the following values:
S = 255(1-(3*.5)/(2))
S = 63.75
I also created an image in just MS Paint with the RGB values of (255,127,127) and that gave me HSL values of (0,240,180) -- or in MS Word HSL values of (0,255,191). These latter values match
ed the HSI values returned from LabVIEW (using the IMAQ ColorHistogram VI).
Regards,
Michael
Applications Engineer
National Instruments

Similar Messages

  • Why are my icons larger than normal when I turn on phone?

    Why are the icons larger than normal when turning on phone? How can I resize them back to normal?

    Double-tap the screen with THREE fingers. Then go to Settings/General/accessibility and turn off Zoom.

  • In Pages 5, why are page thumbnails different sizes?

    So I'm using 5. And I must say I think it's brilliantly done after a long period of ******** about it. I guess I'm not asking of it anything it doesn't provide and what it does it does very well - though I'm puzzled by the behavior of selecting text via the keyboard.
    Anyhow, that's not my question. I'm working with a long text document. I notice that as I work the page thumbnails become different sizes. It's subtle but it's clearly intentional. I reckon it's trying to tell me something but I don't know what. Haven't been able to find any info in the manual and was wondering if any of you clever people here might know. Thanks.

    This is what I meant about how rude you are though.  Your answer DOESN'T EXPLAIN ANY OF THE BEHAVIOUR myself or the other person were reporting.  The only assumption that I can make is that you posted here for the sole purpose of implying that we are both mistaken or stupid. 
    How is this helpful at all? 
    How do you have 32,485 points when you are obviously more concerned with insulting people than helping them out?  It puts the lie to the whole idea of "Apple Support Communities." 
    Also, I specifically informed you that your comments were insulting and unhelpful and politely requested you not post on this thread anymore or at least until you had some kind of actual information, yet here you are.  Posting again, with no content other than the implied insult.
    I'm not stupid.  I know what a section break is, I know what a page break is.  I'm a writer who has used innumerable word processing programs over the years and have been an IT worker for 10 years now. 
    I have a Pages document.  It has no (or only one depending on your point of view), section(s).  It has page breaks only.  The pagination is set to start at "1" on the first page and proceed normally to the end of the document (300 or so pages).  I am using Pages 5.5.2 on a brand new iMac.  I have NONE of the previous or older versions/types of Pages on my computer. 
    The pages thumbnails on the side, do actually CHANGE SIZE randomly as I am editing the document.   These differing sizes are NOT CORRELATED WITH THE BEGINNING OR ENDING OF SECTIONS.  These size changes are also NOT CORRELATED WITH THE PAGE BREAKS (in case you were about to argue the similarity of page breaks and section breaks).  As I work through the document and scroll up and down editing here or there, the size of the thumbnails RANDOMLY CHANGE SIZE.  Sometimes this is correlated with me working on a section, sometimes I can work on a section and no change happens at all.  The thumbnails that change size often change back again when I scroll back to them later on. 
    So please ... Try to act like a decent human being and either help out, or go away.  STOP POSTING THAT WE ARE WRONG, when you DON'T in fact know we are wrong.  STOP INSULTING ME by assuming I am stupid. 
    Why are you even here if you don't want to actually HELP anyone? 
    To anyone else reading this:  I am having a real bad time with this fellow who is just the most insulting person I have met for a while, however many of my posts about him are being deleted.  If anyone knows (including the mods of this forum) of the proper way to REPORT or get rid of a troll/abuser like him on Apple Support Communities or a place to report his behaviour, please let me know. 

  • Why are Symmetric keys shorter than ASyemmetric keys and provide the same level of security.

    Hello
    Can someone please help me with the following question.
    Can someone please give me a brief (if possible) why Symmetric Keys which are much shorter than Asymmetric keys provide a similar level of security (e.g. take as long to crack).
    I understand RSA and can to the math with a piece of paper and the Windows advanced calculator (e.g. encrypt and decrypt a sort message using a couple of small prims likes 53 and 59).
    I also understand ( to a very basic level) AES e.g. 128bit block cypher (I believe a CBC cypher using an unpredictable IV)
    Is there a simple answer if someone says why are Symmetric keys shorted and just as secure or it is just how it is? due to the different math?
    Thank you
    AAnoterUser__
    AAnotherUser__

    Symmetric Key is used for same key for encrypsion & decryption but ASyemmetric key is used two keys (Public & private key) for
    encrysion & decryption.
    ASyemmetric
    1. If Public key is used for  encrypsion then private key is used for decryption
    2. If private key is is used for  encrypsion then public key is used for decryption.
    3. It is more secure than Syemmetric
    Regards,
    Biswajit
    MCTS, MCP 2003,MCSA 2003, MCSA:M 2003, CCNA, Enterprise Admin, ITIL F 2011
    Blog:
      Script Gallary:
      LinkedIn:
    Note: Disclaimer: This posting is provided & with no warranties or guarantees and confers no rights..

  • Why are my colors different?

    I have some objects with spot colors in a file. The document color mode is CMYK. When I copy the objects, and place them into a new CMYK file, the colors appear differently. Plus, when I convert the colors to process, the values are different than when I convert the colors to process in the original file. I have saved both files, and I did not embed color profiles in either file (I think). Can anyone tell me what is going on here? mac cs6

    If I select one of the spot colors in the original file, and go to "swatch options", it is a spot color CMYK mode. But if I select the same spot color in the new file, and go to "swatch options", the color mode is set to "book color".

  • Why are my aliases larger than 4k ?

    I just set up a whole lot of image files in a special alias folder. I expected each alias to be 4k in size. About 10% are 4k, the rest are between 44k and 56k.
    The originals are all Photoshop JPEGs, created in Photoshop 2 and Photoshop 7.
    I thought an alias was just a file pointer. Why are some of them so large? Is there any way to make them smaller? They are taking up way too much space on my USB thumb drive.
    iMac G5 17" 1.5Gb RAM   Mac OS X (10.4.5)  

    Ok Niel - so far, so good. I have done what you suggested, and yes I now have a folder of 4k aliases - so thank you for that idea.
    The one small problem is that there is no icon of the image that the alias represents, at least not until I click on the alias name in column view, when it shows up nicely. But in list view, icon view, or unselected in column view, I can't see what it is. Is there any way around this? I have tried using Get Info to paste the image into the icon field, but it won't let me do it, and I suspect that would increase the size to more than 4k. What I want is the old OS 9 system that would create a 4k alias AND give me a tiny image of the file as well.
    If I really can't do it, then I will have to live with using the filename alone, but at least I have 4k aliases.
    iMac G5 17" 1.5Gb RAM Mac OS X (10.4.7)

  • Finder: "Devices" vs. "Places."  Why are the programs different?

    I'm perpetually perplexed by the way the the same applications work differently under "Devices" and under "Places" when accessed from the "Finder." For example, often when I access a program like iPhoto from the Finder and click on it, it will appear to the extreme right on my dock, next to the stacks divider, thereby giving me 2 icons of iPhoto on my dock. Moreover, the one that appears on the far right may be of a different size and behave like a program being used for the first time. At other times, accessing the program from the Finder merely opens the one program on my Dock, as I expect it to. But must there be two appearances of the same icon, each appearing to be a discrete, separate application (as I suspect they are) rather than a mere alias of, or short cut to, the same program?
    A most recent example: I downloaded iTunes 10 (twice, for good measure). Nevertheless, I'm now looking at two different iTunes programs: iTunes 10 is under 2 of the rubrics in the "Devices" area of my Finder ("my iMac" and "Macintosh HD"); iTunes 9 remains lower down under 2 rubrics in the "Places" area (under "Applications" and under "my name" as sole user of the computer). They clearly must be separate, discrete applications, with different file sizes, though I would prefer to have only iTunes 10--and located under "A Applications" in the "Places" area of the Finder window.
    Normally, I would access applications under the "Applications" rubric that's found in "Places" on my Finder. Doing so, however, would seem to require that I trash my old iTunes (or iPhoto) and replace it by dragging down the newer version of iTunes recently installed in the "Devices" area of the Finder. Is this normal procedure? I plan to make less use of the Finder and concentrate on what's in the Dock. But when dragging an application to the Dock, is it important to select the application from the Devices area ("Macintosh HD") rather than the "Places" area ("Applications") to ensure placing the most recent version on the Dock? And is it normal to see two versions of the same application appear on the Dock after clicking on the program in the "Devices" area and the "Places" area of the Finder window?
    I'm analytically-challenged but am looking to reduce clutter without inadvertently trashing what may be substantial. I could also use any enlightenment concerning the complex and multiple locations (apparently 4) of a program/application as seen from the Finder window.

    I'm perpetually perplexed by the way the the same applications work differently under "Devices" and under "Places" when accessed from the "Finder." For example, often when I access a program like iPhoto from the Finder and click on it, it will appear to the extreme right on my dock, next to the stacks divider, thereby giving me 2 icons of iPhoto on my dock
    Sounds like you have 2 copies of iPhoto installed.
    On the dock icon, right click -> show in Finder and see where the applications are located then delete one of them
    Drag iTunes 9 to the trash to delete it.

  • Why are my calendars different on my iPhone and my iPad

    Why are my calenders on my iPhone and iPad different?  Some of the information sync'ed, but not all of it.  How can I have them match each other?  They are the same calender, the google calender.  Thanks, Mike

    Any suggestions as to why I can't see or add a phone number in iMessage on my iPad?
    I've added my mobile number to my Apple ID which I thought would flow through to iMessage

  • Why are colours very different between PSE 11 Org & Camera Raw 7.4?

    Looking at some new images in the Organizer the color is very cool compared to when I open it in the Editor & it goes to Camera Raw where it is very warm.  Same monitor, same color settings in both Org & Editor.  I can edit in Camera Raw & Editor, but why are my colors not true in Org?  Any suggestions?
    I'm running a Mac with Mavericks.

    Yes, I understand that.  If I adjust the color in only C Raw, or also go into the Editor, the changes are saved in the Org.  What surprises me is the vast difference in color temp.  I'm estimating about 500 K diff--enough that I may not have edited the color I see in C Raw--but definitely wanted to do so from what I viewed in the Org.  I don't recall this much of a difference--and the Org seems to be the one not accurately reflecting the image.

  • Why are two queries better than one

    I'm trying to help out our developers who are struggling with the performance of a very simple select statmenent that for some reason is exhibiting some very inexplicable results.
    I'll show the SQL as a single statement first.....
    select * from transaction1 t where t.hid in (select distinct h.hid from history1 h,filter1 f where h.fid = f.fid and f.match='value');
    transaction 1 has 250k records, history1 has about 100k as does filter1. We know generally the subselect will only return a total of half a dozen or less records (only 1 in our testing here).
    Running the above query takes around 7 seconds.
    Changing this to a with clause.....
    WITH a as (select distinct h.hid from history1 h,filter1 f where h.fid = f.fid and f.match='value') select * from transaction1 t where t,hid in (select a.hid from a);
    and the runtime drops to 3 seconds. But then re-running the first statement again also now takes 3 seconds (so I guess there's some caching going on there).
    Now what really puzzles is if we split this into two queries.....
    select distinct h.hid from history1 h,filter1 f where h.fid = f.fid and f.match='value';
    This takes .1 of a second,
    select * from transaction1 t where t.hid in (12345);
    And this takes .1 of a second.
    So why when run seperately are they so fast, yet combined they take so long. I'm a bit baffled by this. We've rewritten the same SQL in half a dozen different ways with the same result and also done the same thing with other tables as well. Is it an optimisation issue?

    Appologies for not following protocol, my first time posting on here.
    Oracle 10g clustered.
    We have limited access as it's a customers server, but the explain plan comes back as....
    PLAN_TABLE_OUTPUT
    Plan hash value: 898894568
    | Id  | Operation            | Name              | Rows  | Bytes | Cost (%CPU)|Time     |
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT     |                   | 49553 |    37M|  7075   (2)|00:01:25 |
    |*  1 |  HASH JOIN RIGHT SEMI|                   | 49553 |    37M|  7075   (2)|00:01:25 |
    |   2 |   VIEW               | VW_NSO_1          | 26131 |   331K|   476   (4)|00:00:06 |
    |*  3 |    HASH JOIN         |                   | 26131 |   791K|   476   (4)|00:00:06 |
    PLAN_TABLE_OUTPUT
    |*  4 |     TABLE ACCESS FULL| FILTER1           | 26131 |   484K|   246   (4)|00:00:03 |
    |   5 |     TABLE ACCESS FULL| HISTORY1          |   104K|  1225K|   227   (3)|00:00:03 |
    |   6 |   TABLE ACCESS FULL  | TRANSACTION1      |   199K|   150M|  6593   (1)|00:01:20 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
       1 - access("T"."TID"="$nso_col_1")
       3 - access("H"."HID"="F"."ID")
       4 - filter("F"."MATCH"='value')
    20 rows selectedI'll admit, I'm not completely clear on what I'm reading here, other than the fact there are some big differences in the timing values
    We don't have privaleges to run trace, so I'm a bit stuffed there as I'm on the clients site, however I will get my developers to try this on our local server.
    Edited by: user1410957 on 15-Sep-2009 06:14

  • IMovie video result different than original.

    I purchased the app iMovie as I had 2 videos that I took with my iPad4, iOS7.0.4 and I wanted to combine them into 1 video. After I did this the resulting video looked as if I had taken it from a greater distance than the original videos in my camera roll. I took my videos with my iPad of my computer monitor screen. The resulting video after combining them showed the whole monitor with space around it. I just wanted the resulting video to have the same look as my original videos in my camera roll viewer. Any suggestions on how I can acheive this?  Thank you.....

    I can only guess you have some kind of color-management problem on your system, as I just did a test and didn't see any differences between the preview display in the Merge to HDR Pro dialog and the final result.
    What color profile are you using for your input images?
    Is it the same as your default working profile?
    I shouldn't think it would matter what profiles you're using - Photoshop should handle them all properly - but clearly something's causing your saturation to be massively different, which is the kind of thing you might see if a narrow gamut image is being interpreted as though it has a wide gamut color profile (or displayed without color management on a wide gamut monitor).  I do know that HDR processing converts images to your default working profile under some conditions.
    Another possibility is that the display of the image in the HDR Pro dialog is misinterpreting (or neglecting to use) the image color profile.
    That's a very pretty sunset shot, by the way.
    -Noel

  • Why are my exports different sizes?

    When I export a photo from aperture, I am getting a different file size than what it says in aperture.  This happens with edited images or non-edited.  I've tried changing the export presents and they all give me different file sizes, which makes sense.  But I can't seem to export a photo and get it to come out the exact same size as what it says in aperture.  If I set the quality to 12 in export presets, it ends up being much larger than what it is in aperture, if it's set to 11 or lower the photo ends up being smaller than aperture's size.  What am I doing wrong?

    That's how JPG works.  The compression is redone every time the file is saved.  When you export, you create a new file.  If you create a JPG, it will be created to the compressing setting you use, but that compression setting is specific to the program using it, and will not result in a file of the same size saved by a different program.
    The only way to get the exact same file is to export the file you imported -- in Aperture, this is done as "File➞Export➞Original".
    If you are aiming for the highest quality JPG that fits within a upper limit of storage required (e.g. 5 MB), you can make small changes using "Size to" set to "Percent of Original" and then trying, for example, 90%.  For almost all uses a quality of 11 is more than sufficient.  For printing (where max IQ is primary, and file size shouldn't matter) use TIFF 16-bit.

  • Why are there 2 different customization directories seen in MDS repository

    We are upgrading from 11.5.9 of the applications to 11.5.10. We have noticed that before we apply any personalizations to 11.5.10, there are personalizations already out in the MDS repository in a customizations directory. The customizations directory is in a different location, however, than the customizations directory that is created when we create 11.5.10 personalizations. The already existing personalizations in the MDS repository have a 'customizations' directory that is immediately after the <application name> directory (ie: /oracle/apps/icx/customizations/site/0/por/rcv/webui/IcxPorRcvHomePG). The new personalizations applied to 11.5.10 have a 'customizations' directory that is right after the whole document path (ie: right after webui directory), but before the document name (ie: /oracle/apps/icx/por/rcv/webui/customizations/site/0/IcxPorRcvHomePG).
    My 2 guesses as to why these 2 differnt customization directories could exist are:
    1) the path to the customizations directory changed from 11.5.9 to 11.5.10 and the one with the customizations directory immediately after the <application name> directory is the path to old personalizations from 11.5.9
    OR
    2) Oracle puts their own customizations in and the Oracle customizations are found in the path where the customizations directory is immediately after the <application name> directory.
    Can someone please enlighten me as to why there are 2 different paths to customization documents?
    Thank you,
    Paula Jernigan

    Paula,
    I am assuming by directory you are talking about the path in MDS.
    I am pretty sure I have read that the path for customizations did change. We are using 11.5.10 so I cant be sure.
    David

  • Merge to HDR Pro: Result different than preview

    Hi all,
    at the moment I use Photomatix 3 Pro to create HDR images, but since Photoshop CS5 offers this functionality too, I wanted to try it out.
    I selected my three differently exposed images in Mini Bridge and loaded them into Photoshop via "Merge to HDR Pro...". The preview window opened and I could adjust the settings, so far so good. I adjusted the settings until the preview image met my expectations and pressed OK, but the result looked pretty different to the preview image. Especially the saturation was way too high. Converting the photos to JPEG first or using the raw files makes practically no difference.
    I followed a video tutorial, but there the preview and the result matched almost exactly.
    In a different thread I read about a similar problem, but the only solution given there was checking the 32-bit view options. I am using the 8- or 16-bit mode only, so that wasn't helpful for me.
    I hope someone can help me, otherwise I have to stick to Photomatix.
    Two pictures to illustrate my problem (this is the german version of Photoshop, click on the image to see the original size):
    This is how the preview looked right bevore clicking OK:
    And this is how the generated image looked afterwards:

    I can only guess you have some kind of color-management problem on your system, as I just did a test and didn't see any differences between the preview display in the Merge to HDR Pro dialog and the final result.
    What color profile are you using for your input images?
    Is it the same as your default working profile?
    I shouldn't think it would matter what profiles you're using - Photoshop should handle them all properly - but clearly something's causing your saturation to be massively different, which is the kind of thing you might see if a narrow gamut image is being interpreted as though it has a wide gamut color profile (or displayed without color management on a wide gamut monitor).  I do know that HDR processing converts images to your default working profile under some conditions.
    Another possibility is that the display of the image in the HDR Pro dialog is misinterpreting (or neglecting to use) the image color profile.
    That's a very pretty sunset shot, by the way.
    -Noel

  • Why are my photos different from originals in iPhoto 9.5.1?

    Hi
    I import photos from my iPhone 5S, if I then hit 'revert to original' in 'Edit' mode they look very different? Why is this?
    Is the iPhone or iPhoto adding certain qualities before I have done anything myself?
    I want to use the photos for a website and want them to look as good as possible across the web, different computers/screens/software etc
    Thanks in advance
    Daniel

    I import photos from my iPhone 5S, if I then hit 'revert to original' in 'Edit' mode they look very different? Why is this?
    Is the iPhone or iPhoto adding certain qualities before I have done anything myself?
    With iOS version are you using?  And in what way are your photos looking different?
    "Revert to original" will remove any filters added in the Camera app. iPhoto on your Mac can undo certain adjustments added on the iPhone.
    Have you enabled effects in the Camera, like Chrome or Instant?

Maybe you are looking for

  • Can anyone recommend a simple Notes/To Do List app

    Hello, I am going crazy looking for a very simple To Do List / Notes app for my iPhone that does what I want it to do. I have spent hours in the Apps store and downloaded over 12 so far, and have not found the right one. Can anyone recommend one that

  • Excution plan

    hi yesterday i have run one query its excuted normally,but today the query taking more time ,i want to check yesterday excution plan and current excution plan .How can i check before excutuion plan where it wil store ?

  • DBMS_XMLDOM.WRITETOFILE errors

    C'mon then chaps (and chapesses)... I've had DBMS_XMLDOM.WRITETOFILE working before but for some reason I just can't seem to get it to work again. (Using Oracle 10g R2) What am I doing wrong. It's bound to be something right in front of me, but I jus

  • Smart forms. How to setup logic for standard text usage.

    Hi All! Could you advise please is there a way, except abap programming, to setup in smart forms that different standard texts values (tcode so10) to be used based on different selected parameters (e.g. customers, vendors etc... ). e.g. For picking l

  • IPhoto Library Manager--File Size difference of merged library

    I just use iPhoto Library Manager to merge 2 libraries and it worked great. There is a huge difference in the size of the libraries. The original library is 17.48 GB. The merged library which had an additional 4.03 GB of pictures/events added to it i