RGB to HSI conversion is one of the methods for image enhancement. Let us first discuss about RGB and HSI models and then using simple formulas just see how this conversion happens.
We have studied about RGB Color model in one of the posts earlier.Let us revise the RGB once again only the part that is important for HSI conversion.
In the RGB model, an image consists of three independent image planes, one in each of the primary colours: red, green and blue. Specifying a particular colour is by specifying the amount of each of the primary components present. Figure shows the geometry of the RGB colour model for specifying colours using a Cartesian coordinate system. The greyscale spectrum, i.e. those colours made from equal amounts of each primary, lies on the line joining the black and white vertices.
In HSI model, color can be specified by three attributes/quantities namely hue, saturation and intensity.
Hue is a color attribute which is used to describe a pure form of color (may be pure yellow, red or orange).
Saturation is a measure of degree to which a pure color is diluted by white light.
Intensity is the information of colors in the image.
All in one, we can say that HSI model is in close relation with the color perception of human beings.
Conversion formula:
In the image below, see for the rgb_to_hsi conversion formula and also find hsi_to_rgb conversion formula in the next image.
MATLAB Program:
Now let us create a simple program which asks for an image location (use inverted quotes for location) and then gives us back the converted HSI image. Here I am only giving the program code built into a function for rgb_to_hsi conversion. Try yourself to build a code for hsi_to_rgb conversion of image using the formula given.
function rgb_to_hsi()
x = input('Enter the loaction of RGB Color image: ');
rgb = imread(x);figure;
imshow(rgb);title('RGB image');
%Represent the RGB image in [0 1] range
I = double(rgb)/255;
R = I(:,:,1);
G = I(:,:,2);
B = I(:,:,3);
%Hue
numi = 1/2*((R-G)+(R+B));
denom = ((R-G).^2+((R-B).*(G-B))).^0.5;
%To avoid divide by zero exception add a small number in the denominator
H = acosd((numi./(denom+0.000001)));
%If B>G then H = 360 - Theta
H(B>G)=360-H(B>G);
%Normalise to the range [0 1]
H = H/360;
%Saturation
S = 1- (3./(sum(I,3)+0.000001)).*min(I,[],3);
%Intensity
I = sum(I,3)./3;
%HSI
HSI = zeros(size(rgb));
HSI(:,:,1)=H;
HSI(:,:,2)=S;
HSI(:,:,3)=I;
figure, imshow(HSI);title('HSI Image');
Thats enough for RGB and HSI. To know more about that just search on google for Munsell Color System. It will get you to deeper concepts and similar algorithms.
We have studied about RGB Color model in one of the posts earlier.Let us revise the RGB once again only the part that is important for HSI conversion.
In the RGB model, an image consists of three independent image planes, one in each of the primary colours: red, green and blue. Specifying a particular colour is by specifying the amount of each of the primary components present. Figure shows the geometry of the RGB colour model for specifying colours using a Cartesian coordinate system. The greyscale spectrum, i.e. those colours made from equal amounts of each primary, lies on the line joining the black and white vertices.
In HSI model, color can be specified by three attributes/quantities namely hue, saturation and intensity.
Hue is a color attribute which is used to describe a pure form of color (may be pure yellow, red or orange).
Saturation is a measure of degree to which a pure color is diluted by white light.
Intensity is the information of colors in the image.
All in one, we can say that HSI model is in close relation with the color perception of human beings.
Conversion formula:
In the image below, see for the rgb_to_hsi conversion formula and also find hsi_to_rgb conversion formula in the next image.
MATLAB Program:
Now let us create a simple program which asks for an image location (use inverted quotes for location) and then gives us back the converted HSI image. Here I am only giving the program code built into a function for rgb_to_hsi conversion. Try yourself to build a code for hsi_to_rgb conversion of image using the formula given.
function rgb_to_hsi()
x = input('Enter the loaction of RGB Color image: ');
rgb = imread(x);figure;
imshow(rgb);title('RGB image');
%Represent the RGB image in [0 1] range
I = double(rgb)/255;
R = I(:,:,1);
G = I(:,:,2);
B = I(:,:,3);
%Hue
numi = 1/2*((R-G)+(R+B));
denom = ((R-G).^2+((R-B).*(G-B))).^0.5;
%To avoid divide by zero exception add a small number in the denominator
H = acosd((numi./(denom+0.000001)));
%If B>G then H = 360 - Theta
H(B>G)=360-H(B>G);
%Normalise to the range [0 1]
H = H/360;
%Saturation
S = 1- (3./(sum(I,3)+0.000001)).*min(I,[],3);
%Intensity
I = sum(I,3)./3;
%HSI
HSI = zeros(size(rgb));
HSI(:,:,1)=H;
HSI(:,:,2)=S;
HSI(:,:,3)=I;
figure, imshow(HSI);title('HSI Image');
Thats enough for RGB and HSI. To know more about that just search on google for Munsell Color System. It will get you to deeper concepts and similar algorithms.
With the various software program and purposes that we've as we speak when it come to on-line information, it can be crucial as properly to discover a file format that makes our information simple to handle however not simple to change. If you want to learn more about this topic please visit https://onlineconvertfree.com/convert-format/m4a-to-mp3/
ReplyDeletei was lost with no hope for my wife was cheating and had always got away with it because i did not know how or always too scared to pin anything on her. with the help a friend IN PERSON OF PAIGE who recommended me to who help hack her phone, email, chat, sms and expose her for a cheater she is. I just want to say a big thank you to HACKINTECHNOLOGY@GMAIL.COM . am sure someone out there is looking for how to solve his relationship problems, you can also contact him for all sorts of hacking job..he is fast and reliable. you could also text +1 669 225 2253
ReplyDeleteIt’s good to take risk sometimes. I’ve realized that people who do great exploits are people who take risk. Nothing good comes or happens easily. You may be battling with your bad credit, negative items and different bills but if care is not taken depression might set in. I want to introduce CREDIT TRINITY CARE to you guys and trust me, he’s gonna help you fix your credit ASAP. He’ll delete all the negatives and boast your credit score. He boasted my credit score from 400 to 790+ within few days. I read about him on credit blog and discovered that he’s not one of those usual names, so I contacted him via creditscoretrinity@gmail.com I’m forever grateful to CREDIT TRINITY CARE. I wish I can say everything here which is not possible but all I know is that he can be trusted
ReplyDeleteHello Friends, My name is Leo Marcos I live Colorado with my family. I'm a Truck driver and am always busy on the road. I want to appreciate TROVIAN CREDIT REPAIR for their monumental help recently on my bad credit I got to tell you this. My score was 510 I wanted to buy a house but I knew my credit was not up to standard to get a home. So I made a personal research along which i came across a review about TROVIAN on how they fixed a Man's credit and increased his score so I contacted them immediately they deleted my old accounts and increased my score to 803 which i was so surprised now I’m able to buy a house. I really appreciate their good work and i promised about telling everyone out there what they did on my report. They are very good and understanding expert you can easily reach them on TROVIANCREDITREPAIR@GMAIL.COM +1 (424) 307 4562
ReplyDeleteFew years ago, I had been dating a guy who I thought was very responsible. One day his truck broke down, and he didn’t have the money to fix it. So I decided to co-sign on a Midas credit card with him, as he couldn’t get it himself. He broke up with me a month later, and as much as I thought he would do the responsible thing, all of a sudden my score started dropping. He hadn’t paid anything on the card over 8 months. I called the company to closed the card from further charges, before he would ruined my life and that of my credit score more than what he has done I was so confused because I could not use my card all I was doing was paying debt not until I came in contact with TROVIANCREDITREPAIR@GMAIL.COM CALL +1 (424) 307 4562 they helped me cleared all the debts on my card and raised my score to a high 800, thanks for lifting me back to life.
ReplyDeleteMost times when i see people complain of what they go through due to their bad credit profile I will sit back and give thanks to TROVIAN, have been going through a bad report those days and I totally understood how bad the situations was and on bearable for me to get my own apartment and bank also denied me access on getting a credit card, my best wasn’t working until i came across TROVIAN CREDIT REPAIR and he helped me erase all the bad items he also helped me get a credit card have been aspiring for a long time also raise my score to 810. Now am in my own apartment am so happy. You can reach him if you want to fix your credit report through his email TROVIANCREDITREPAIR@GMAIL.COM TEXT +1(424) 307 4562
ReplyDeleteWords can’t just express how excited I am right now , KNIGHTHOODBOT@GMAIL.COM is indeed a lifesaver.. I nearly Lost all my Crypto to fake investment platform in 2020 , it all started when a colleague of mine introduced me to the platform that she has been earning from during the pandemic and I thought I should give it a try also since she has been earning from their for quite sometime now but that was one of my biggest mistake , I ended up investing a total of 262k in USDT and waited for my profit which appeared on my portfolio on the website but cannot withdraw , that was frustrating and left me with no option but to hire a hacker after 2 months of waiting for the feds to help but nothing came out of their investigation , I don’t really know what I could have done if I hadn’t came across KNIGHTHOODBOT At GMAIL DOT COM . I can assure you that he is indeed the best recovery hacker out there .
ReplyDeleteI can actually say that there is no better credit repair hacker out there than CLASSICREPAIR4U@GMAIL.COM , I knew this after he took down 13 inquiries and a total debt of 320k that I had on my credit report , this has been bothering me for a very long time , I nearly gave up along the line while trying to get it fixed but I believed that there’d be light at the end of the tunnel ,so I kept my hopes high, I’d really say that I was fortunate enough to know about classicrepair team ‘cause I don’t know what my situation would have been by now if not for the team , So folks make the right choice today and contact the team just like I did . I’m glad to share this with you guys .
ReplyDeleteWe invested 204 ETH in order to receive an extra 45% return on our investment. We consulted a business that had experience in getting people the up-to-date information they needed to make the best investment decisions. They helped us by telling us how to get into the Alcohol Industry in Canada and what would be the best equipment to use to start distilling. We are happy with the 45% ROI we received and would write a new big contract with them if we were to invest again.
ReplyDeleteThe best thing that happened to me this new year is coming across an article about Wardrivers cyber, a professional hacker and private investigator. I had invested $67,000 into a cryptocurrency platform that turned out to be a scam and I had no idea how to get back my money until I contacted Wardrivers cyber, they were able to recover everything from these scammers without breaking a sweat. I’m truly grateful and I’m sharing this out there with everyone. You might have been involved in a romance scam, or fake cryptocurrency investment, and you wish to get back your money, then you need to contact Wardrivers cyber too. Don’t let anyone get away with your hard-earned money. This is their email address: ( Wardriverscyberservice@techie. com )
ReplyDeleteIt's been a crazy year for me, unfortunate happenings beyond me made score fall to 622, I needed a loan few months ago for my failing business which could'nt be approved because of my credit score. A colleague linked me up with Clever Hacker, after contacting him he didn't just raise my score to a golden and remove my eviction. Thanks to him I got my loan approved contact cleverhacker |.| hack |@| gmail |.| com
ReplyDeleteWHATSAAP +<1>859.743.5022
ReplyDelete{cybertechwizard @ cyberservices DOT come}I recently had a harrowing experience where I was scammed out of a significant amount of money, and Cyber Tech Wizard Tool played a pivotal role in helping me recover from this disaster. Here's my story and how Cyber Tech Wizard Tool became my savior.It all started when I came across an online broker offering incredible rates for Bitcoin transactions. As an experienced investor, I knew the importance of due diligence, so I meticulously researched the broker, looking at their website, reviews, and even contacting their supposed customer support. Everything seemed legitimate, and the broker's rates were too good to overlook. Convinced, I decided to transfer $200,000 worth of Bitcoin to this broker.However, things took a dark turn soon after the transfer. My attempts to withdraw funds were met with delays and excuses. My anxiety grew, and within a few hours, I realized I had fallen victim to a scam. The broker was unlicensed, and my hard-earned money was gone. Panic set in, and I knew I needed immediate action.Within 24 hours of the scam, I reached out to Cyber Tech Wizard Tool, a name I had heard in various forums for their expertise in digital asset recovery. From the moment I contacted their team, I felt a glimmer of hope. They were professional, empathetic, and incredibly knowledgeable about the intricacies of cryptocurrency scams.The Cyber Tech Wizard Tool team quickly assessed my situation, gathering all necessary information about the transaction and the fraudulent broker. Their deep understanding of blockchain technology and cybersecurity was evident as they meticulously traced the transaction. They reassured me that they would do everything possible to recover my funds.The recovery process was complex and required patience, but the team kept me informed at every step. They provided regular updates and maintained transparency throughout, which helped alleviate my stress. After several weeks of persistent efforts, the Cyber Tech Wizard Tool team successfully retrieved a significant portion of my lost Bitcoin.In conclusion, Cyber Tech Wizard Tool is more than just a recovery tool; they are a lifeline for those who have been scammed. Their expertise, dedication, and unwavering support turned a potential financial catastrophe into a manageable setback. I am incredibly grateful to them for their help and cannot recommend their services enough. If you ever find yourself in a similar situation, don't hesitate to contact Cyber Tech Wizard Tool – they are the real deal.