<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lou Marvin Caraig on Medium]]></title>
        <description><![CDATA[Stories by Lou Marvin Caraig on Medium]]></description>
        <link>https://medium.com/@lmcaraig?source=rss-246c0c9321d3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TMpPwwDKIKcH8-GkTIjoEQ@2x.jpeg</url>
            <title>Stories by Lou Marvin Caraig on Medium</title>
            <link>https://medium.com/@lmcaraig?source=rss-246c0c9321d3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 14:30:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lmcaraig/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Product Update:  “It’s yet another boring job board” ]]></title>
            <link>https://medium.com/@lmcaraig/product-update-its-yet-another-boring-job-board-e3e7a2b0a778?source=rss-246c0c9321d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3e7a2b0a778</guid>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Lou Marvin Caraig]]></dc:creator>
            <pubDate>Mon, 29 Apr 2024 08:24:34 GMT</pubDate>
            <atom:updated>2024-04-29T08:26:24.446Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gAU5ZO6wAGYFu5xuOpEW-w.png" /></figure><p>Imagine this:</p><p>You find the job post describing your dream job. 🤩</p><p>What’s next? You send your CV. 📄</p><p>In the past years, I reviewed hundreds of CVs. I need to admit that engineers are not the best persons to draft them. 😅 But often, the quality of the CV didn’t do justice to the candidate’s skillset and experience.</p><p>For this reason, I added a CV analysis and reviewer in <a href="https://nextcommit.careers/">NextCommit</a>! 🚀</p><p>Check it out! Happy job hunt! 🍀</p><p>All feedback is welcome and appreciated! ✍ ❤️</p><iframe src="https://cdn.embedly.com/widgets/media.html?type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=twitter&amp;url=https%3A//twitter.com/LMCaraig/status/1784859474580165088&amp;image=" width="500" height="281" frameborder="0" scrolling="no"><a href="https://medium.com/media/e4696507d09e92ade004337f48a62cfb/href">https://medium.com/media/e4696507d09e92ade004337f48a62cfb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3e7a2b0a778" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Product Update: ✨ More Login Options! ]]></title>
            <link>https://medium.com/@lmcaraig/product-update-more-login-options-f1352b9dcb9a?source=rss-246c0c9321d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1352b9dcb9a</guid>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Lou Marvin Caraig]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 08:08:16 GMT</pubDate>
            <atom:updated>2024-04-04T08:08:16.939Z</atom:updated>
            <content:encoded><![CDATA[<p>As a platform tailored for Software Engineers and tech professionals, I assumed GitHub would be the go-to for logins at <a href="https://nextcommit.careers/">NextCommit</a>. But, I learned that’s not always the case thanks to this feedback from a potential user. ❤️</p><p>The initial authentication version was a very lightweight in-house solution. But the wind changed once I wanted to integrate other social logins: poor documentation, bugs during the integration, etc. 😡</p><p>I made a mistake. 🤦‍♂️</p><p>Authentication is not something to be taken lightly. I scrapped everything and re-implemented it from scratch by relying on <a href="https://clerk.com/">Clerk</a> to provide a more seamless and secure experience. 🔐</p><p>So <a href="https://nextcommit.careers/">NextCommit</a> now offers login with GitHub, with LinkedIn, and with the good old email + password for an even more accessible platform. ✨</p><p>Check it out! Happy job hunt! 🍀</p><p>All feedback is welcome and appreciated! ✍ ❤️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*38AV_tJQPtr_zt06SMVFUA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1352b9dcb9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Product Update: ✨ “Pin it, don’t just dream it!” ]]></title>
            <link>https://medium.com/@lmcaraig/nextcommit-product-update-d93390c5d793?source=rss-246c0c9321d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d93390c5d793</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[careers]]></category>
            <dc:creator><![CDATA[Lou Marvin Caraig]]></dc:creator>
            <pubDate>Mon, 01 Apr 2024 18:11:05 GMT</pubDate>
            <atom:updated>2024-04-01T18:21:55.656Z</atom:updated>
            <content:encoded><![CDATA[<p>After the redesign and a (too) brief break in sunny Fuerteventura, here we go with another update for <a href="https://nextcommit.careers/">NextCommit</a>! 🤩</p><p>In today’s fast-paced job market, staying organized and on top of opportunities is key. That’s why I added a new bookmarking feature that lets you save job listings that catch your eye, allowing you to easily revisit them when you’re ready to apply. 💪</p><p>Whether you’re passively exploring new roles or actively seeking your next big opportunity, this feature is designed to make your job search smoother and more efficient. 🚀</p><p>Check it out! Happy job hunt! 🍀</p><p>All feedback is welcome and appreciated! ✍ ❤️</p><h3>Lou Marvin Caraig on Twitter: &quot;✨ &quot;Pin it, don&#39;t just dream it!&quot; 📍Here we go with another update for NextCommit! 🤩A new bookmarking feature that lets you save job listings, allowing you to easily revisit them when you&#39;re ready to apply. 💪#careers #tech #remotework #indiehacker #buildinpublic pic.twitter.com/dIUKlfief5 / Twitter&quot;</h3><p>✨ &quot;Pin it, don&#39;t just dream it!&quot; 📍Here we go with another update for NextCommit! 🤩A new bookmarking feature that lets you save job listings, allowing you to easily revisit them when you&#39;re ready to apply. 💪#careers #tech #remotework #indiehacker #buildinpublic pic.twitter.com/dIUKlfief5</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d93390c5d793" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Product Update: ✨ Redesigned & Reimagined ]]></title>
            <link>https://medium.com/@lmcaraig/nextcommit-product-update-redesigned-reimagined-4ebd31b83af7?source=rss-246c0c9321d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ebd31b83af7</guid>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Lou Marvin Caraig]]></dc:creator>
            <pubDate>Mon, 01 Apr 2024 18:00:23 GMT</pubDate>
            <atom:updated>2024-04-01T18:22:57.456Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ll admit, I’ve been always very bad with UI/UX 😂. But a few weeks ago I came across a great book (“Refactoring UI” by <a href="https://www.linkedin.com/in/ACoAAAp0FEEB8li-sl1BCFvQ66aZWMhxGrYw338">Adam Wathan</a>). Its tagline resonated deeply with me:</p><blockquote>“I know this looks terrible, but I have no idea why.”</blockquote><p>And I thought: “That’s exactly me!” 🤯 😂</p><p>For those wondering, “What’s <a href="https://nextcommit.careers/">NextCommit</a>?” — it’s a job board tailored for remote tech positions. This idea was born from my own struggles in finding remote roles and, later, seeking remote talent.</p><p>The first time I looked for a remote position I used a Trello board to track all the applications and it required me to reach out to 30+ companies before landing one! I ended up joining <a href="https://www.linkedin.com/company/source-d/">source{d}</a> as a Mid Software Engineer 🎉 (even if I applied as a Senior 😅, but I realized why once I started, but this is another story).</p><p>The hope is for <a href="https://nextcommit.careers/">NextCommit</a> to become a reference for connecting great companies with great talents and, in general, great people committing (see the pun? 😜) together to build something great!</p><p>So what now?</p><ul><li>🤩 Check out the full redesign,</li><li>🤖 Experience the AI-driven job discovery,</li><li>🎯 Enjoy the refined search filters.</li></ul><p>All feedback is welcome and appreciated! ✍ ❤️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*R2VqMELoBgYBj7fL_bdfzA.jpeg" /><figcaption>Screenshot of NextCommit</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ebd31b83af7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Understanding Remote Work Culture: What to Expect in a Remote Tech Job]]></title>
            <link>https://medium.com/@lmcaraig/understanding-remote-work-culture-what-to-expect-in-a-remote-tech-job-9b47cf103eb2?source=rss-246c0c9321d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b47cf103eb2</guid>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[work-culture]]></category>
            <category><![CDATA[culture]]></category>
            <dc:creator><![CDATA[Lou Marvin Caraig]]></dc:creator>
            <pubDate>Mon, 01 Apr 2024 16:31:16 GMT</pubDate>
            <atom:updated>2024-04-01T16:31:16.573Z</atom:updated>
            <content:encoded><![CDATA[<h4>Get an insider’s perspective on remote tech jobs! Benefits, challenges, and key aspects of remote work culture in tech.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BH_SoFWh1kxRmTFb" /><figcaption>Photo by <a href="https://unsplash.com/@cwmonty?utm_source=medium&amp;utm_medium=referral">Chris Montgomery</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hello there, tech enthusiasts! 👋</p><p>Are you intrigued by the concept of remote work? As a seasoned remote worker with a decade of experience in Software Engineering, I’m excited to share what you can expect when you step into the world of remote tech jobs. But if you’re looking for some tips to find your dream remote tech job have a look <a href="https://medium.com/nextcommit-blog/work-from-anywhere-a-guide-to-finding-your-dream-remote-tech-job-2450ff054106">here</a>.</p><h3>🏠 Embracing the Freedom</h3><p>Freedom is the cornerstone of remote work. You’re no longer tethered to a specific location; your workspace can be your comfy home office, a bustling coffee shop, or even a beachfront villa (just a heads-up though, sand in the laptop isn’t covered by the warranty!). 🏖️ The opportunity to design your workspace to your liking is truly empowering. The only unique requirement is having an internet connection!</p><p>I still remember the days when I used to arrive at the office already stressed due to commuting during rush hour. When I summed up the time wasted weekly on commuting, it was depressing to think about how that time could have been better spent: enjoying time with friends and family, pursuing hobbies, or exercising.</p><p>However, this freedom isn’t without responsibilities. Without the structure of a traditional office environment, effectively managing your time becomes crucial. You have to strike a balance between enjoying your newfound autonomy and meeting your professional obligations. Remember, your commitment to your work shouldn’t waver, regardless of where you are.</p><h3>📅 Flexible Schedules</h3><p>One of the most appealing aspects of remote work is flexible scheduling. Many remote tech companies understand that employees have diverse work rhythms and allow them to set their own work hours. Are you a night owl who codes best at midnight? Or a morning lark who loves to debug with the sunrise? Remote work can accommodate your peak productivity hours. ⏰</p><p>Not only can you accommodate your work rhythm, but you can also schedule around other commitments: taking children to and from school, running errands, etc.</p><p>However, flexibility isn’t synonymous with a lack of structure. You still need to ensure your schedule aligns with team meetings, collaborative work sessions, and deadlines. It’s about finding the routine that suits you best while still meeting the needs of your team and the projects you’re working on.</p><p>While your company might have its own project management tools to sync with the team, feel free to use additional tools to keep track of whatever you need to stay organized.</p><p>I personally use Google Calendar to organize my day and even edit it during the day to reflect on how I’ve actually spent my time (this could probably be the topic of another blog post). Here’s a screenshot of a week when I was working at Athenian as Head of Engineering. I must admit that I’m a hardcore user in this case and that being in a leadership position required an even higher level of care when it comes to staying organized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oxd0r3MNLeldiwjy4L1Dug.png" /><figcaption>My Google Calendar when working at Athenian</figcaption></figure><p>This doesn’t mean that you should do the same! You just need to find what works for you!</p><h3>🤝 Communication is Key</h3><p>In the world of remote work, communication isn’t just important — it’s vital. The absence of physical proximity means you can’t just walk over to a colleague’s desk for a quick chat. As a remote employee, you’ll rely heavily on written communication, video calls, and collaboration tools like Slack or Microsoft Teams. 📬</p><p>Being clear, concise, and responsive in your communication is of utmost importance. Misunderstandings and miscommunications can easily occur when you’re not face-to-face, so it’s crucial to double-check your messages for clarity. Also, don’t hesitate to reach out and ask questions when you’re unsure about something — it’s always better to ask than to assume!</p><p>My CEO at Athenian, <a href="https://twitter.com/eisokant">Eiso Kant</a>, once told me:</p><blockquote>If the person you’re talking with misunderstands you, it’s not their fault for misinterpreting you, but it’s your fault for not ensuring that you communicated it in the way you intended to be interpreted.</blockquote><h3>🎯 Outcome over Presence</h3><p>In a remote work culture, it’s the results that count, not the hours you spend in front of your computer. This shift from presence to performance can be incredibly liberating. You’re valued for the quality of your work and the impact you make, not for clocking time. 🚀</p><p>Have you ever sat at your desk just watching the clock? I have, and it was a waste of time for both me and the company. It was a lose-lose scenario.</p><p>This results-oriented culture also means that self-discipline and accountability are paramount. You need to keep yourself motivated, manage your tasks efficiently, and meet your deadlines without someone looking over your shoulder. It’s a fantastic opportunity to cultivate your self-management skills. However, it’s worth noting that it’s not for everyone. I also know people who prefer an on-site job or working remotely but not from home.</p><h3>💡 Continuous Learning and Development</h3><p>The tech industry is a rapidly evolving landscape. To keep up, remote tech companies often prioritize employee learning and development. You’ll likely have access to a variety of resources such as online courses, webinars, podcasts, or even stipends for professional development. 📚</p><p>This focus on continual learning also means that you’re expected to stay updated with the latest tech trends, programming languages, or methodologies. It’s an exciting challenge that can help you grow both professionally and personally. It’s also worth noting that being a lifelong learner is crucial regardless of whether you’re working remotely or in an office.</p><h3>🌍 Navigating Time Zones</h3><p>Working with colleagues scattered across the globe is a fascinating aspect of remote work. It provides a rich diversity of perspectives, but it can also be tricky to coordinate and ensure that the whole team is aligned. This is where a few smart strategies come into play. 🌐</p><ul><li><strong>Create crystal clear agendas</strong>: Whenever you schedule a meeting, ensure that everyone involved has access to the agenda beforehand so that people can come prepared. This should include topics, action items, talking points, and assigned tasks with clear meeting objectives. This will boost the productivity and efficiency of the meeting.</li><li><strong>Embrace asynchronous “meetings”</strong>: Traditional meetings can be challenging when the team is spread across different time zones. I personally worked in a team with 10 people from Mexico to Kazakhstan, and yes, it was not easy. This is where asynchronous meetings come in. Communication doesn’t happen in real-time and doesn’t require an immediate response. You can send out a recorded video of a topic using Loom, or audio using Slack, or even a simple Google document or Notion page where the discussion can happen asynchronously. This allows people to stay aligned without the need to synchronize schedules.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j5QdDdLcE10w0qNdUD2toA.png" /><figcaption>A quick recording of myself using Loom to share with the team</figcaption></figure><h3>👥 Building Relationships and Networking</h3><p>Despite the physical distance, building relationships and networking remain an integral part of remote work. In a remote setting, you may not be able to have water cooler chats or lunch outings with colleagues, but that doesn’t mean social interactions are off the table. Virtual coffee breaks, team-building activities, and even company-wide retreats during the year are some ways companies foster connections among employees. Some remote teams schedule regular virtual meetups or “happy hours” where the focus is on social interaction, not work. Slack channels dedicated to non-work topics can also help employees bond over shared interests. While socializing might look a little different in a remote setting, it is no less significant. These activities, coupled with company-wide retreats, provide opportunities to build relationships, foster collaboration, and strengthen the team’s bond. 🤝</p><h3>🌈 The Role of Diversity and Inclusion</h3><p>Remote work naturally fosters diversity as it brings together individuals from different parts of the world, different cultures, and different walks of life. This diversity brings a wealth of ideas, perspectives, and approaches to problem-solving. In a remote team, you might find yourself collaborating with a developer in Berlin, a designer in Tokyo, and a project manager in Buenos Aires. This global collaboration not only enriches the work experience but also leads to innovative solutions. However, diversity alone isn’t enough; inclusion ensures that everyone’s voices are heard and valued, creating a supportive and enriching work environment. Companies must actively cultivate an inclusive culture where differences are celebrated and everyone feels they belong. 🌎</p><h3>🎢 The Ups and Downs</h3><p>Like any work model, remote work comes with its own set of challenges. From occasional loneliness to blurring work-life boundaries, remote work isn’t always a walk in the park. Working from home might mean you miss out on the camaraderie of an office environment. Or, without the physical separation of home and office, you might find it hard to switch off work mode. However, with the right mindset and strategies, these challenges can be effectively managed. For instance, regular virtual social events can help combat feelings of isolation, while setting clear boundaries for work hours can prevent burnout. It’s all about finding what works best for you and continually adapting as your needs change. 💪</p><h3>🏁 The Takeaway</h3><p>Stepping into the world of remote tech jobs can be both exciting and daunting. But armed with an understanding of the remote work culture, you’re ready to embrace this new way of working. Remember, it’s all about flexibility, communication, self-discipline, continuous learning, and most importantly, balance.</p><p>And when you’re ready to dive in, remember that <a href="https://nextcommit.careers/">NextCommit</a> is your ultimate companion in your remote job hunt. It discovers new job posts every day, which you can filter by category (Backend, Frontend, Mobile, DevOps, Machine Learning, etc.) and by country to ease your search. Happy remote job hunting! 🚀</p><p>Happy job hunting! 🍀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b47cf103eb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Work from Anywhere: A Guide to Finding Your Dream Remote Tech Job]]></title>
            <link>https://medium.com/@lmcaraig/work-from-anywhere-a-guide-to-finding-your-dream-remote-tech-job-2450ff054106?source=rss-246c0c9321d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2450ff054106</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[job-hunting]]></category>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[gui̇de]]></category>
            <dc:creator><![CDATA[Lou Marvin Caraig]]></dc:creator>
            <pubDate>Mon, 01 Apr 2024 16:15:10 GMT</pubDate>
            <atom:updated>2024-04-01T16:38:56.249Z</atom:updated>
            <content:encoded><![CDATA[<h4>Discover the world of remote work with our comprehensive guide to finding your dream remote tech job.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vtxGQ4Jld437BZJ-" /><figcaption>Photo by <a href="https://unsplash.com/@belart84?utm_source=medium&amp;utm_medium=referral">Artem Beliaikin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hey there, tech enthusiasts!</p><p>🙋‍♂️ Picture this: You’re lounging on a beach in Bali, sipping a cocktail, feet in the sand, laptop by your side, and the gentle breeze rustling the palm trees. Sounds like a dream, right? Welcome to the world of remote work, where this could be your office. Although, let me be honest — I’ve yet to swap my home office for a beach cabana! 😄🏝️💻</p><p>Navigating the vast sea of remote job possibilities might feel overwhelming. That’s why I’m here to guide you through the process of finding your dream remote tech job. With 10 years of experience in software engineering, 4 years in leading engineering teams remotely, and countless video calls taken in my comfy slippers, I’m excited to share my insights with you. So, let’s dive into this exciting journey. 🚀</p><h3>📍 Understanding Remote Work</h3><p>Before diving into the ‘how-to’ of finding remote jobs, let’s first define what we’re talking about. Remote work, also known as telecommuting, allows professionals to work outside of a traditional office environment. It’s all about embracing the concept that work doesn’t need to be done in a specific place to be executed successfully. 🏡💻</p><p>If you would like to better understand the remote work culture have a look <a href="https://medium.com/nextcommit-blog/understanding-remote-work-culture-what-to-expect-in-a-remote-tech-job-9b47cf103eb2">here</a>.</p><h3>🌐 The Benefits of Remote Tech Jobs</h3><p>Working remotely in tech has its unique set of perks. Here are some reasons why it’s an excellent choice:</p><p>1. <strong>Flexibility</strong>: One of the most significant benefits of remote work is the flexibility it offers. You can work from anywhere, anytime. All you need is a stable internet connection and a device to work on. 🌴👩‍💻<br>2. <strong>Wide array of opportunities</strong>: The tech industry is vast, and so are the opportunities in it. From software engineering, data engineering, machine learning, DevOps, and more, there’s always a demand for tech skills. 🌟<br>3.<strong> Better work-life balance</strong>: Remote work can lead to a better balance between your personal and professional life. No commute time means more time for yourself and your loved ones. 🎉<br>4. <strong>Global exposure</strong>: Working remotely often means working with a diverse and international team. This can open up doors for learning about different cultures and perspectives. 🌎</p><h3>🔍 How to Find the Best Remote Tech Jobs</h3><p>Now, onto the main event: how to find these dreamy remote tech jobs. Here are some steps to guide you:</p><p>1. <strong>Identify your interest and skillset</strong>: Start by taking stock of your skills and interests. Are you into backend, frontend, mobile development, machine learning, or something else? This will help narrow down your job search. 👀📝<br>2. <strong>Leverage job post aggregators</strong>: Websites like <a href="https://nextcommit.careers/">NextCommit</a> are a goldmine. They aggregate job postings from different sources, allowing you to find a wide variety of remote tech job listings in one place. <a href="https://nextcommit.careers/">NextCommit</a> lets you filter by category and country, making your job search a breeze. 🎯<br>3. <strong>Prepare for the interview</strong>: Remember, remote job interviews can be different from traditional ones. As someone who has interviewed numerous candidates, I can tell you that demonstrating your ability to work independently and communicate effectively is key. 🗣️💡<br>4. <strong>Follow up</strong>: After applying or interviewing, be sure to follow up. This shows your interest and initiative. 📬👍</p><h3>🎯 Acing the Remote Job Interview</h3><p>Securing your dream remote tech job involves a balance of showcasing your hard skills, demonstrating your remote work readiness, and showing off your soft skills during the interview process. Here are some tips to help you shine:</p><p>1. <strong>Highlight your technical expertise</strong>: This is your chance to show off your hard skills. Whether you’re a backend wizard, a machine learning guru, or a DevOps expert, make sure to provide concrete examples of your accomplishments in your field. Don’t shy away from getting technical — after all, you’re applying for a tech job! 👨‍💻👩‍💻<br>2. <strong>Prepare your tech</strong>: Ensure your tech setup is reliable. Check your internet connection, your camera, and your microphone ahead of time to avoid technical issues during the interview. 💻🎧<br>3. <strong>Showcase your remote work skills</strong>: Highlight experiences that demonstrate your ability to work independently and manage your time effectively. Communication is particularly crucial in a remote setting. 🏠🔧<br>4. <strong>Research the company</strong>: Knowing the company’s culture, mission, and values can give you a competitive edge. This information can guide your answers and show your genuine interest in the role and the company. 📚💡<br>5. <strong>Ask insightful questions</strong>: Remember, an interview is a two-way street. Asking questions shows your interest in the role and helps you determine if the company and the role are the right fit for you. 🛣️🔄<br>6. <strong>Follow up</strong>: A thank you note after the interview shows your appreciation for their time. This small gesture can leave a lasting positive impression. 💌👍</p><p>Armed with these tips, you’re well on your way to acing your remote job interview. Remember, your hard skills get you in the door, but your communication skills and other soft skills will help you excel in a remote work environment. You’ve got this! 💪🚀</p><p>Now, let’s move on to the next exciting phase: landing the job and making the most of it.</p><h3>💼 Landing Your Dream Remote Job</h3><p>Congratulations! You’ve impressed your potential employer and landed the job. Now, it’s time to set yourself up for success in your new remote tech role. Here’s how:</p><p>1. <strong>Set up your workspace</strong>: A comfortable and functional workspace can significantly enhance your productivity. Invest in a good chair, a desk, and the tools you need, such as a reliable laptop, a good pair of headphones, and depending on your role, any other specific hardware or software you might need. Remember, each role may require different tools. In some cases, your new employer may even provide you with some of the necessary hardware. 🪑💻🎧<br>2. <strong>Communicate effectively</strong>: Communication is even more critical when working remotely. Familiarize yourself with the communication tools your new company uses, be it Slack, Microsoft Teams, or Google Hangouts, and make sure you’re clear, concise, and responsive. Remember, the tools you use will depend on your company’s preferences, but effective communication is always key. 📨📞<br>3. <strong>Stay organized</strong>: With flexibility comes responsibility. Keeping yourself organized will help you meet deadlines and stay on top of your work. While your company might have its own project management tools, feel free to use additional tools like Trello, Asana, or Google Calendar to manage your tasks and time effectively. 🗂️📆<br>4. <strong>Keep learning</strong>: The tech industry is always evolving, and staying up-to-date with the latest trends and technologies is crucial, regardless of whether you’re working remotely or in-office. Be a lifelong learner and continue to grow your skills to thrive in your role. 🎓💡</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qQMwRmggFgJK79B5-digvg.jpeg" /><figcaption>This is how my workspace looks like</figcaption></figure><h3>🎉 Celebrate Your Success</h3><p>So, there you have it, folks! Your comprehensive guide to landing your dream remote tech job. From identifying your interests, navigating job posts, acing interviews, to landing the job, you’re now equipped with the tools you need to kickstart your remote tech career. 🎊🙌</p><p>But remember, the journey doesn’t end when you land the job. It’s about continual growth, learning, and adapting to new challenges that come your way. And with your skills, resilience, and determination, I’m confident that you’ll excel in your new remote tech role. 💪🚀</p><p>If <strong>NextCommit</strong> has been a part of your successful remote job hunt, we’d love to hear your story! Don’t forget to spread the word and share your success on social media. Your story could inspire others to take the leap into the exciting world of remote tech jobs. 🗣️🌐</p><p>Ready to embark on your remote job hunt? Head over to <strong>NextCommit</strong> to start searching for your dream remote tech job today! Let’s change the world, one commit at a time. You’ve got this! 🌐🔍</p><p>Happy job hunting! 🍀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2450ff054106" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding image histograms with OpenCV]]></title>
            <link>https://medium.com/@lmcaraig/understanding-image-histograms-with-opencv-667572a25c1f?source=rss-246c0c9321d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/667572a25c1f</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[opencv]]></category>
            <dc:creator><![CDATA[Lou Marvin Caraig]]></dc:creator>
            <pubDate>Thu, 28 Dec 2017 02:18:45 GMT</pubDate>
            <atom:updated>2018-02-10T21:45:03.188Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<p>In this post I want to explore what is an image histogram, how it is useful to understand an image and how it can be calculated using <a href="https://opencv.org/">OpenCV</a> which is <em>de facto</em> the standard tool for <strong>computer vision</strong>. In this post I’m going to use OpenCV 3 with Python 3.6.</p><h3>What is an image histogram?</h3><p>An <strong>histogram</strong> is a graph or a plot that represents the distribution of the pixel intensities in an image. In this post we’re going to focus on the RGB color space (see <a href="http://lmcaraig.com/color-quantization-using-k-means/">here</a> if you want an explanation about the difference between some color spaces such as RGB and Lab), hence the intensity of a pixel is in the range [0, 255]. When plotting the histogram we have the pixel intensity in the X-axis and the frequency in the Y-axis. As any other histogram we can decide how many bins to use.</p><p>A histogram can be calculated both for the grayscale image and for the colored image. In the first case we have a single channel, hence a single histogram. In the second case we have three channels, hence three histograms.</p><p>Calculating the histogram of an image is very useful as it gives an intuition regarding some properties of the image such as the <strong>tonal range</strong>, the <strong>contrast</strong> and the <strong>brightness</strong>.</p><h3>Calculating the histogram</h3><p>Let’s now see how we can calculate the histogram of any given image using OpenCV and display them using matplotlib.</p><p>OpenCV provides the function cv2.calcHist to calculate the histogram of an image. The signature is the following:</p><pre>cv2.calcHist(images, channels, mask, bins, ranges)</pre><p>where: <br> 1. images - is the image we want to calculate the histogram of wrapped as a list, so if our image is in variable image we will pass [image], <br> 2. channels - is the the index of the channels to consider wrapped as a list ([0] for grayscale images as there&#39;s only one channel and [0], [1] or [2] for color images if we want to consider the channel green, blue or red respectively), <br> 3. mask - is a mask to be applied on the image if we want to consider only a specific region (we&#39;re gonna ignore this in this post), <br> 4. bins - is a list containing the number of bins to use for each channel, <br> 5. ranges - is the range of the possibile pixel values which is [0, 256] in case of RGB color space (where 256 is not inclusive).</p><p>The returned value hist is a numpy.ndarray with shape (n_bins, 1) where hist[i][0] is the number of pixels having an intensity value in the range of the <em>i</em>-th bin.</p><p>We can simplify this interface by wrapping it with a function that in addition to calculate the histogram it also draws it (at the moment we’re going to fix the number of bins to 256):</p><pre>import cv2 from matplotlib<br>import pyplot as plt</pre><pre>def draw_image_histogram(image, channels, color=&#39;k&#39;):<br>    hist = cv2.calcHist([image], channels, None, [256], [0, 256])<br>    plt.plot(hist, color=color)<br>    plt.xlim([0, 256])</pre><p>where image can be loaded using cv2.imread(&#39;path/to/image&#39;).</p><p>Let’s now see the histograms of these three sample images:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FLIAdoC5iXKzlhJY.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O0A9ZnbdNRm1kzzt.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vAiG9Man6QzLu0C2.jpg" /></figure><h3>Grayscale histogram</h3><p>Let’s start by considering the histogram of the grayscale version of the above sample images. We can write the following helper function to display using matplotlib the histogram of the grayscale version of an image:</p><pre>import cv2 from matplotlib<br>import pyplot as plt</pre><pre>def show_grayscale_histogram(image):<br>    grayscale_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)<br>    draw_image_histogram(grayscale_image, [0])<br>    plt.show()</pre><p>If we execute this function for the sample images we obtain the following histograms:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*gFBLkOcn9a2LKYV-.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*F2Je2EhR0ODAr-gf.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*6vn_DUhJFnlkIBaD.png" /></figure><p>Let’s now analyze this plots and see what kind of informations we can extract from them. From the first one we can infer that the all the pixels of the corresponding image have low intensity as their almost all in the [0, 60] range approximately. From the second one we can see that the distribution of the pixel intensities is still more skewed over the darker side as the median value is around 80, but the variance is much larger. Then from the last one we can infer that the corresponding image is much lighter overall, but also have some dark regions.</p><p>I think that even if the histograms weren’t given in the same order of the sample images, anyone could be able to guess which histogram belongs to each image by simply doing the above analysis.</p><p>Here are the grayscale images with the corresponding histograms:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*LPIsX43invEMlSb_.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*is-DanL_pZgQlyZu.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Utiq8N_7puKzsYtB.png" /></figure><h3>Color histogram</h3><p>Let’s now move onto the histograms of the colored sample images. Even in this case we can write the following helper function to display using matplotlib the histogram an image:</p><pre>import cv2<br>from matplotlib import pyplot as plt</pre><pre>def show_color_histogram(image):<br>    for i, col in enumerate([&#39;b&#39;, &#39;g&#39;, &#39;r&#39;]):<br>        draw_image_histogram(image, [i], color=col)<br>    plt.show()</pre><p>If we execute this function for the sample images we obtain the following histograms:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*lpNcQsAS5C5fHr5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*gxhXkLc2z-izyUjd.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*xchA7ypUWLan3AvU.png" /></figure><p>The plots are in the same order of the sample images. As we could have expected from the first plot we can see that all the channels have low intensities corresponding to very dark red, green and blue. We also have to consider that the color black, which is given by (0, 0, 0) in RGB, is abundant in the corresponding image and that may explain why all the channels have peaks in the lower part of the X axis. Anyway this can&#39;t be much appreciated in with type of visualization given that we&#39;re plotting the three channels independently from each other. Later we will see how we can observe the distribution of the combination of the channels&#39; values by using <strong>multi-dimensional histograms</strong>.</p><p>From the second plot we can observe that there’s a dark red peak that may correspond to the rocks and the mountains while both the green and the blue channel have a wider range of values. From the last plot, if we exclude the peaks of all the channels in the interval [0, 30], we can observe the opposite of what we saw in the first plot. All the three channels have high intensities and if we consider that (255, 255, 255) in RGB corresponds to white, then by looking at the image it&#39;s clear why the histogram has this distribution.</p><p>Here are the sample images with the corresponding histograms:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*F5t2PVRyJOVq5iDo.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*08PTQdGVgizUadYN.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ZosFljWNkADZPwux.png" /></figure><h3>Multi-dimensional histogram</h3><p>As anticipated above we’re now going to take a look at multi-dimensional histograms.</p><h4>2D histogram</h4><p>The idea is that instead of examining each channel separately we analyze them together in groups of 2 (RG, GB, BR) or all together. In the case of 2D histograms the resulting plot will have the pixel intensities of a channel on the X-axis, the pixel intensities of another channel on the Y-axis, and the frequency is given by the color of the plot. Let’s look at an example as it is easier to show it than explaining it.</p><p>Here’s the code that plots each 2D color histograms one for each pair combinations.</p><pre>import cv2<br>from matplotlib import pyplot as plt<br>from matplotlib import ticker</pre><pre>def show_image_histogram_2d(image, bins=32, tick_spacing=5):<br>    fig, axes = plt.subplots(1, 3, figsize=(12, 5))<br>    channels_mapping = {0: &#39;B&#39;, 1: &#39;G&#39;, 2: &#39;R&#39;}<br>    for i, channels in enumerate([[0, 1], [0, 2], [1, 2]]):<br>        hist = cv2.calcHist(<br>            [image], channels, None, [bins] * 2, [0, 256] * 2)</pre><pre>        channel_x = channels_mapping[channels[0]]<br>        channel_y = channels_mapping[channels[1]]</pre><pre>        ax = axes[i]<br>        ax.set_xlim([0, bins - 1])<br>        ax.set_ylim([0, bins - 1])</pre><pre>        ax.set_xlabel(f&#39;Channel {channel_x}&#39;)<br>        ax.set_ylabel(f&#39;Channel {channel_y}&#39;)<br>        ax.set_title(f&#39;2D Color Histogram for {channel_x} and &#39;<br>                     f&#39;{channel_y}&#39;)</pre><pre>        ax.yaxis.set_major_locator(<br>            ticker.MultipleLocator(tick_spacing))<br>        ax.xaxis.set_major_locator(<br>            ticker.MultipleLocator(tick_spacing))</pre><pre>        im = ax.imshow(hist)</pre><pre>    fig.colorbar(im, ax=axes.ravel().tolist(),<br>                 orientation=&#39;orizontal&#39;)<br>    fig.suptitle(f&#39;2D Color Histograms with {bins} bins&#39;, <br>                 fontsize=16)<br>    plt.show()</pre><p>Let’s now take a look on what this functions does. Most of the code is just to have a nicer plot, actually the logic is really simple. On <em>line 4</em> we initialize the figure by configuring 3 subplots all in the same row. Each subplot will contain a 2D histogram. On <em>line 7</em> we simply define the mapping between the channel index and the corresponding channel name. Keep in mind that the color space of the images loaded using OpenCV is BGR and not RGB, that&#39;s why index 0 correspond to B and not R and so on.</p><p>On <em>line 8</em> we start to loop over each pair combinations of channels. The first combination is [0, 1] which correspond to the pair BG, the second one is [0, 2] which correspond to the pair BR, the third one is [1, 2] which correspond to the pair GR.</p><p>On <em>line 9</em> we can see that we call the same function cv2.calcHist that we used for 1D histograms. In order to consider 2D histogram the channels attribute now contains two values instead of a single one, the bins attribute defines how many bins to use for each channel and the value of ranges attribute must be repeated ([0, 256] becomes [0, 256, 0, 256]). The returned value hist is a numpy.ndarray with shape (bins, bins) where hist[i][j] is the number of pixels having an intensity value in the range of the <em>i</em>-th bin for the channel in the X-axis and in the range of the <em>j</em>-th bin for the channel in the Y-axis.</p><p>On <em>lines 12–24</em> we simply set the axis limits, tick spacing and the labels to show and on <em>line 26</em> we draw the plot. After the for-loop on <em>lines 28–30</em> we add the an horizontal colorbar and we finally show the plot.</p><p>Here’s the generated plot for the sample image with mid tones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0wgeXjm0Hq8q0hXj.png" /></figure><p>You may have noticed that we used only 32 bins instead of 256 as previously. That&#39;s because using 256 bins means having 256 * 256 = 65536 separate pixel counts which is not very practical and also a waste of resource. Here&#39;s the 2D color histogram for the same sample image using 256 bins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uoqo2mRg-mdPpW1g.png" /></figure><h4>3D histogram</h4><p>We can easily extend what we’ve done for the 2D histogram to calculate 3D histogram. Essentially the call to cv2.calcHist becomes as follows:</p><pre>cv2.calcHist([image], [0, 1, 2], None, [bins] * 3, [0, 256] * 3)</pre><p>Even in this case the returned value hist is a numpy.ndarray with shape (bins, bins, bins). Unfortunately we cannot visualize this histogram.</p><h3>Histogram equalization</h3><p>The <strong>histogram equalization</strong> process is an image processing method to adjust the contrast of an image by modifying the image’s histogram. The intuition behind this process is that histograms with large peaks correspond to images with low contrast where the background and the foreground are both dark or both light. Hence histogram equalization stretches the peak across the whole range of values leading to an improvement in the global contrast of an image.</p><p>It is usually applied to grayscale images and it tends to produce unrealistic effects, but it is highly used where a high contrast is needed such as in medical or satellite images.</p><p>OpenCV provides the function cv2.equalizeHist to equalize the histogram of an image. The signature is the following:</p><pre>cv2.equalizeHist(image)</pre><p>where: <br> 1. image - is the grayscale image that we want to equalize (we&#39;re going to see later how we can extend to colored image).</p><p>This function returns the image with the equalized histogram.</p><h3>Theory and derivation of the formula</h3><p>If you’re not interested in the theoretical part feel free to skip this section and its subsection. We’re now going to show which formula is being applied when doing histogram equalization and how to derive it.</p><p>Let <em>n</em> be the number of pixels of the given image and <em>[p₀,pk] </em>the range of the gray levels. Let’s also define the histogram of this image as <em>H(p)</em> where <em>H(pᵢ)</em> is the number of pixels having gray level <em>pᵢ</em>. Our goal is to have an histogram <em>G(q)</em>, where <em>G</em> is defined similarly to <em>H</em>, which is uniform over all the levels in the range <em>[q₀,qk]</em>. Hence we need to find a monotonic transformation function <em>q=𝓣(p)</em>.</p><p>Given that the total sum of bins doesn’t change and thanks to the monotonicity we can imply:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*4GZfYGk6aPcY73NAJS4a-Q.png" /></figure><p>Additionally given that <em>G</em> is uniform, we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/208/1*r21zOyxwXPFm-gRtF9zwLg.png" /></figure><p>Since the exactly uniform histogram can be obtained only in the continuous space, let’s change the first formula as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*4dB-kJtovImw2wPYdoGKgQ.png" /></figure><p>We can now proceed in obtaining the function <em>𝓣</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*_6qTLCHUcCLcj6tRONhZaw.png" /></figure><p>We have found our function <em>𝓣</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*aWjnJt9VP6DuPxNZu-1cIA.png" /></figure><p>In the discrete space this corresponds to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*y_6gVeTcpQNT15OUPFGGiA.png" /></figure><p>This may seem a complicated formula, but essentially the function <em>𝓣</em> is simply a lookup table: if in the original histogram the bin count at level <em>p</em> is equal to <em>v</em>, then in the equalized histogram that bin is “moved” at level <em>q</em>. This mechanism is applied to all levels <em>p</em>.</p><h4>Example</h4><p>Let’s see how the histogram equalization works by doing it “by hand” on a very simple fake image. Let our sample grayscale image be defined as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*HvRYSjrTfyEPlLdQDjieEQ.png" /></figure><p>We want to equalize the image so that the whole range [0, 255] is used. Hence we have <em>q₀=0, qk=255, p₀=0 </em>and<em> n=16</em>. We can then calculate the following table:</p><pre>┌─────┬──────┬──────────────┐<br>│ p   │ H(p) │ <em>∑ H(i)</em> │ q   │<br>├─────┼──────┼────────┼─────┤<br>│ 0   │ 3    │ 3      │ 48  │<br>│ 32  │ 6    │ 9      │ 143 │<br>│ 64  │ 2    │ 11     │ 175 │<br>│ 96  │ 1    │ 12     │ 191 │<br>│ 128 │ 3    │ 15     │ 239 │<br>│ 255 │ 1    │ 16     │ 255 │<br>└─────┴──────┴────────┴─────┘</pre><p>where <em>q</em> is simply:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*aNKs2BNukL4WU8wytqfKVw.png" /></figure><p>We can now plot both the original and the equalized histogram. We can notice that cumulative equalized histogram is very close to the optimal one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g-j80lIJY88sIhhL.png" /></figure><h3>Histogram equalization for grayscale images</h3><p>Let’s now see how we can easily equalize a grayscale image and show it. Here’s the code:</p><pre>import cv2<br>from matplotlib import pyplot as plt</pre><pre>def show_grayscale_equalized(image):<br>    grayscale_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)<br>    eq_grayscale_image = cv2.equalizeHist(grayscale_image)<br>    plt.imshow(eq_grayscale_image, cmap=&#39;gray&#39;)<br>    plt.show()</pre><p>And here’s the comparison between the original grayscale sample image and the equalized one:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MzxBZQE-aMXZDjXI.png" /></figure><p>As we can see the global contrast has been improved by the equalization process and the histogram has been stretched.</p><h3>Histogram equalization for colored images</h3><p>It’s possible to extend the histogram equalization and apply it to colored images. The most naive approach consits in applying the same process to all the three RGB channels separately and rejoining them together. The problem is that this process changes the the relative distributions of the color and may consequently yield to dramatic changes in the image&#39;s color balance. Here&#39;s the code:</p><pre>import cv2<br>from matplotlib import pyplot as plt</pre><pre>def show_rgb_equalized(image):<br>    channels = cv2.split(image)<br>    eq_channels = []<br>    for ch, color in zip(channels, [&#39;B&#39;, &#39;G&#39;, &#39;R&#39;]):<br>        eq_channels.append(cv2.equalizeHist(ch))</pre><pre>    eq_image = cv2.merge(eq_channels)<br>    eq_image = cv2.cvtColor(eq_image, cv2.COLOR_BGR2RGB)<br>    plt.imshow(eq_image)<br>    plt.show()</pre><p>And here’s the result of applying the algorithm to a colored sample image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PJtFuOtylCEX84HO.png" /></figure><p>An alternative is to first convert the image to the HSL or HSV color space and then apply the histogram equalization only on the lightness or value channel by leaving the hue and the saturation of the image unchanged. Here&#39;s the code that applies the histogram equalization on the value channel of the HSV color space:</p><pre>import cv2<br>from matplotlib import pyplot as plt</pre><pre>def show_hsv_equalized(image):<br>    H, S, V = cv2.split(cv2.cvtColor(image, cv2.COLOR_BGR2HSV))<br>    eq_V = cv2.equalizeHist(V)<br>    eq_image = cv2.cvtColor(cv2.merge([H, S, eq_V]),<br>                            cv2.COLOR_HSV2RGB)<br>    plt.imshow(eq_image)<br>    plt.show()</pre><p>And here’s the result of applying the algorithm on the same sample image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*my2hLCXEhd-6ZldB.png" /></figure><h3>Conclusions</h3><p>In this post we saw how to extract and visualize the histogram of an image, both grayscale and colored, and what kind of intuitions we can infer from that. We also discussed how histogram equalization works and how it can be extended to colored images.</p><p>There are also other algorithms for histogram equalization that are more robust that haven’t been considered here such as AHE (<strong>Adaptive Histogram Equalization</strong>) and CLAHE (<strong>Contrast Limited Adaptive Histogram Equalization</strong>).</p><p>Image histograms are simple, but largely used in image processing. One interesting application is the usage of image histograms to build an image search engine based on the similarity between them such explained in <a href="https://www.pyimagesearch.com/2014/12/01/complete-guide-building-image-search-engine-python-opencv/">this</a> blog post.</p><p><em>Originally published at </em><a href="http://lmcaraig.com/image-histograms-histograms-equalization-and-histograms-comparison/"><em>lmcaraig.com</em></a><em> on December 28, 2017.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=667572a25c1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Color quantization using k-means]]></title>
            <link>https://medium.com/@lmcaraig/color-quantization-using-k-means-1967fe1acc16?source=rss-246c0c9321d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1967fe1acc16</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-mining]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Lou Marvin Caraig]]></dc:creator>
            <pubDate>Sat, 04 Feb 2017 23:55:00 GMT</pubDate>
            <atom:updated>2018-02-10T21:44:40.626Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<p>In this article I’d like to talk about color quantization and how the k-means clustering algorithm can be used to perform it and how it performs compared to simpler methods. The snippets presented here are written in Python and come from <a href="https://github.com/se7entyse7en/image-quantizer">this project</a>.</p><h3>What is color quantization?</h3><p><strong>Color quantization</strong> is the process of reducing the number of distinct colors used in an image. The main reason we may want to perform this kind of compression is to enable the rendering of an image in devices supporting only a limited number of colors (usually due to memory limitations).</p><p>Obviously all compressions come with a cost. In this case the resulting image may differ too much from the original one. Hence the goal of the color quantization is to obtain a compressed image <em>as similar as possibile</em> to the original one. The key factor for achieving this is the selection of the <strong>color palette</strong> by choosing the colors that most <em>summarizes</em> the original image.</p><p>The most common techniques reduce the problem of color quantization into a <strong>clustering problem</strong> of points where each point represents the color of a pixel. It consists in creating the palette by selecting a representative point for each cluster. After that the compression simply remaps all the colors into their cluster representative. As you may guess the resulting palette highly depends on the color space and distance metric used.</p><p>Before digging into the palette selection in more detail here’s a simple and brief introduction about color spaces and color difference. The idea is to give a grasp on some concepts that are necessary to understand what comes next without being too much detailed as a more detailed explanation is out of the scope of this post. Feel free to skip these parts if you already know what they’re talking about.</p><h3>Color spaces and color difference</h3><p>As previously anticipated a color can be represented as a point in an <em>n</em>-dimensional space called <strong>color space</strong>. Most commonly the space is 3-dimensional and the coordinates in that space can be used to encode a color.</p><p>There are many color spaces for different purposes and with different <em>gamut</em> (range of colors), and in each of them it is possibile to define a distance metric that quantifies the <strong>color difference</strong>. The most common and easiest distance metric used is the <em>Euclidean distance</em> which is used in RGB and Lab color spaces.</p><h4>RGB color space</h4><p>The <strong>RGB</strong> (abbreviation of red-green-blue) color space is by far the most common and used color space. The idea is that it is possibile to create colors by combining red, green and blue. A color in RGB is usually encoded as a 3-tuple of 8 bits each, hence each dimension takes a value within the range [0, 255] where 0 stands for absence of color while 255 stands for <em>full presence</em> of color.</p><p>As previously said in RGB we can use the Euclidean distance to calculate the difference between two colors:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*1iKF8D_c7qKFznkySuuxPg.png" /></figure><p>One caveat of using the Euclidean distance in the RGB color space is that it isn’t uniform with the difference perceived by the eye. In other words two pairs of colors might be perceived not equally different even if they have the same Euclidean distance. If we denote with d’ the perceived difference and we calculate the difference between the pairs of colors <em>(R₁,G₁,B₁)</em>, <em>(R₂,G₂,B₂) </em>and <em>(R₁,G₁,B₁)</em>, <em>(R₃,G₃,B₃) </em>we might have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*MfaXkaRLiMtI6IVB3A93QQ.png" /></figure><p>This is due to the fact the the human eye is more sensitive to certain colors than others.</p><h4>Lab color space</h4><p>The <strong>Lab</strong> color space, more formally <em>L*a*b*</em>, includes all perceivable colors meaning that its gamut is a superset of the gamut of the RGB color space, and has the intent of being perceptually uniform and hence to solve the problem that affects the RGB color space when using the Euclidean distance. In the case of Lab this distance is known as CIE76 and it is denoted with <em>ΔE*₇₆</em>(CIE stands for <em>International Commission on Illumination</em>):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*xtqz1yYcsM4Yi9-2xDV8_A.png" /></figure><p>The <em>L*</em> dimension represent the lightness of the color and its value is in [0, 100] where the higher the lighter. <em>a*</em> and <em>b*</em> are color-opponent dimensions where <em>a*</em> represent green at negative values and red at positive ones, while <em>b*</em> represent blue at negative values and yellow at positive ones. For both <em>a*</em> and <em>b*</em> the value of 0 represent a neutral gray and their range depends on the Lab implementation, but it is usally [-100, 100] or [-128, 127].</p><h4>Other color spaces</h4><p>There are many other color spaces and even if they’re not going to be used in the next sections to perform color quantization, it worth mentioning the <em>L*C*h*</em> color space that has been introduced in order to fix some problems that occur when using <em>ΔE*₇₆</em>. For this reason the CIE defined the <em>ΔE*₉₄ </em>and then the <em>ΔE*₀₀</em> both defined in the <em>L*C*h*</em> color space. Anyway both distances are not based on the simple Euclidean distance.</p><h3>Palette selection</h3><p>We can now start performing color quantization and see how the output changes depending on the color space used, the method adopted to create the palette, and the size of the palette we want to build.</p><p>To compare the different cases we’re going to use the image of <a href="https://en.wikipedia.org/wiki/Lenna">Lenna</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*JEEXXzjnjPfQ9wTr.png" /></figure><h3>Random selection</h3><p>The easiest method to select the colors that will be part of the palette is to choose them completely random. After having built the palette each color is remapped to the nearest color that is part of that selection. As you may guess using RGB or Lab space doesn’t make any difference and the only thing that affects the final output is the number of colors to use. If with this selection strategy it seems that one color space seems to behave better than the other one, keep in mind that given the randomness of the selection it can be just a case.</p><p>In the following figure it’s visually explained the whole process in case of RGB space where the final palette is composed by three colors (for Lab space is completely analogous). For simplicity in this example the blue channel is fixed to the value of 0, hence we can consider only the R and the G dimensions. All the pixels of the image are represented with the RGB encoding and then mapped into the RGB space. Then 3 random colors are selected to be part of the palette. Finally all the colors are remapped to the nearest selected color according to the Euclidean distance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SWog1z6tdVyAG0Zu.PNG" /></figure><h4>Using random selection in RGB space</h4><p>Here there are the output images generated by randomly selecting the colors in RGB color space. Their palettes are composed by 8, 16, 32 and 64 colors respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*wxkVXOBRtnNxttUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*Z-gAc9Nezkq1aFTO.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*TT0aCHTHcGbFyaij.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*FRwbkkjLKa-SmECa.png" /></figure><h4>Using random selection in Lab space</h4><p>Here instead there are the output images generated by randomly selecting the colors in Lab color space. Also in this case their palettes are composed by 8, 16, 32 and 64 colors respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*ZeLyWfVzu4ZHBucB.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*tP_6UH-TMqq0bqj0.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*Agzy0uwJZVAB1AwD.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*HHaV_ARuqLvHboFQ.png" /></figure><h4>The code</h4><p>The implementation of the color quantization via random palette selection is very easy. In the following snippet both the input variable raster and the output variable quantized_raster are numpy.ndarrays which correspond to the raster of the original image and the raster of the quantized image. They can be both be encoded with RGB or Lab (the output raster has the same encoding of the input) and have shape (width, height, 3).</p><pre>import numpy as np</pre><pre>from sklearn.metrics import pairwise_distances_argmin<br>from sklearn.utils import shuffle</pre><pre>def quantize(raster, n_colors):<br>    width, height, depth = raster.shape<br>    reshaped_raster = np.reshape(<br>        raster, (width * height, depth))</pre><pre>    palette = shuffle(reshaped_raster)[:n_colors]<br>    labels = pairwise_distances_argmin(<br>        reshaped_raster, palette)</pre><pre>    quantized_raster = np.reshape(<br>        palette[labels], (width, height, palette.shape[1]))</pre><pre>    return quantized_raster</pre><p>The raster of an image can be retrieved by passing the path of the file to scipy :</p><pre>import scipy.misc</pre><pre>raster = scipy.misc.imread(image_filename)</pre><p>The output of scipy.misc.imread is a numpy.ndarray with shape (width, height, 3) and values RGB encoded. Hence in order to perform the quantization in Lab space we first need to convert RGB to Lab. Thanks to skimage it is possibile to convert from RGB to Lab and viceversa:</p><pre>from skimage import color</pre><pre>lab_raster = color.rgb2lab(rgb_raster)<br>rgb_raster = color.lab2rgb(lab_raster) * 255).astype(&#39;uint8&#39;)</pre><p>Finally to visualize the result of the color quantization we can use matplotlib:</p><pre>import matplotlib.pyplot as plt</pre><pre>plt.imshow(rgb_raster / 255.0)<br>plt.draw()<br>plt.show()</pre><p>Note that the imshow function works only with RGB values normalized in the [0, 1] interval, that&#39;s why we need to divide by 255.</p><h3>Selection with k-means</h3><p>As anticipated at the beginning of the post one common approach to perform color quantization is to use a clustering algorithm. In this case we’re going to use <strong>k-means</strong> that minimizes the within-cluster sum of squared distances between the centroid and the other points of the cluster. Given that the distance used by the k-means clustering algorithm is the Euclidean distance, it is a natural fit for being applied for color quantization with both RGB and Lab space. For the purpose of this post I’m going to assume that you know how k-means works.</p><p>The procedure consists in applying the k-means algorithm with a number of centroids that is equal to the number of colors we want the palette to be composed of. Then we use the resulting centroids as the colors that will be part of the palette. After that, each color is remapped to the nearest one among those in the palette as in the random selection. Given the nature of k-means, the nearest color corresponds exactly to the centroid representing the cluster the color is part of.</p><p>It is important to notice that n pixels of an image having the same color consist in n overlapping points in the color space and not in a single point. Actually in case of random selection it makes no difference, but it does a lot of difference when applying the k-means algorithm.</p><p>Remember that the Euclidean distance in Lab space is uniform with the difference perceived by the eye. Hence with this kind of selection we can expect that using the Lab space should have a visually better result than RGB.</p><p>Similarly to the other figure in the following one it’s visually explained the whole process in case of RGB space, but using the k-means algorithm. Even in this example the final palette is composed by three colors and the blue channel is fixed to the value of 0 for simplicity. All the pixels of the image are represented with the RGB encoding and then mapped into the RGB space as in the case of the random selection. Then the k-means algorithm is applied and the centroids of the cluster are selected to be part of the palette. Finally, as in the random palette selection, all the colors are remapped to the nearest selected color according to the Euclidean distance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Yd3nL5NN-amDfaZq.PNG" /></figure><h4>Using k-means in RGB space</h4><p>Here there are the output images generated using k-means in RGB color space. Their palettes are composed by 8, 16, 32 and 64 colors respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*vkZ1CyMVUR3WoLJh.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*D7opnzS7DL2lk-Bv.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*DcGjdDeeomHgl-XA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*CN4cZ07uhjFJ4Lts.png" /></figure><h4>Using k-means in Lab space</h4><p>Here instead there are the output images generated using k-means in Lab color space. Also in this case their palettes are composed by 8, 16, 32 and 64 colors respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*w0UzwqqWhLNf-ZzG.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*uSgeWcDdQ5iql1q9.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*PuWQowfMoQdxjdVF.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*p5ScJhCtuCDKHUB8.png" /></figure><h4>The code</h4><p>Here’s the code to perform the color quantization through k-means. The following function has the same signature of the one used for random selection, and what have been already discussed regarding raster loading, color space conversion, and result visualization still applies.</p><pre>import numpy as np</pre><pre>from sklearn import cluster</pre><pre>def quantize(raster, n_colors):<br>    width, height, depth = raster.shape<br>    reshaped_raster = np.reshape(raster, (width * height, depth))<br>    <br>    model = cluster.KMeans(n_clusters=n_colors)<br>    labels = model.fit_predict(reshaped_raster)<br>    palette = model.cluster_centers_<br>    <br>    quantized_raster = np.reshape( palette[labels], (width, height, palette.shape[1]))</pre><pre>    return quantized_raster</pre><h3>Conclusions</h3><p>We can visibly notice that the usage of k-means outperforms the usage of simple random selection. Infact the images obtained with random selection with 64 colors are very similar to those obtained with k-means with 32 colors independently from the color space used. The drawback of using k-means is that it is obviously much slower especially if the training is performed with all the pixels of the original image. This can be mitigated by using only a random sample of the pixels.</p><p>On the other hand at first glance the results of k-means in RGB space and k-means in Lab space are similar. Anyway by taking a closer look at each couple of images, in some cases it is possible to notice some details that make us say that one is better than the other. In general for this particular image the face seems to be clearer and more defined when using RGB and this can be noticed especially in the first two couple of images. However using Lab space seems to render the reflection in the mirror and the hat better, and it also recalls the brightness of the original image. Overall I wouldn’t say that when using k-means a color space is a better choice than the other, at least not for this particular image.</p><p><em>Originally published at </em><a href="http://lmcaraig.com/color-quantization-using-k-means/"><em>lmcaraig.com</em></a><em> on February 4, 2017.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1967fe1acc16" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>