<?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 Shaho Alaee on Medium]]></title>
        <description><![CDATA[Stories by Shaho Alaee on Medium]]></description>
        <link>https://medium.com/@sdalaee?source=rss-5c119e2cbb77------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ijNrCltTgPcM6TypzSYu-g.jpeg</url>
            <title>Stories by Shaho Alaee on Medium</title>
            <link>https://medium.com/@sdalaee?source=rss-5c119e2cbb77------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 07:16:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sdalaee/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[Computational Photography Series — Image Stitching]]></title>
            <link>https://medium.com/@sdalaee/computational-photography-image-stitching-dbb137867aa5?source=rss-5c119e2cbb77------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbb137867aa5</guid>
            <category><![CDATA[computational-photography]]></category>
            <category><![CDATA[image-stitching]]></category>
            <dc:creator><![CDATA[Shaho Alaee]]></dc:creator>
            <pubDate>Mon, 16 May 2022 13:33:32 GMT</pubDate>
            <atom:updated>2022-05-16T15:00:32.249Z</atom:updated>
            <content:encoded><![CDATA[<h3>Computational Photography Series — Image Stitching</h3><p>Shaho Alaee</p><h3>Overview</h3><p>The goal of this project is to create a single photo by stitching together images using computation. Taking images from a previous trip, I aimed to create a combined image by registering, warping, resampling, and compositing them. This will some image geometry and homographies, which is the algebraic workhorse to warp images.</p><h3><strong>The Pictures</strong></h3><p>The photo samples I chose for this project are from a trip to South Beach, Florida. All photos were taken with the GoPro Hero 9 and were extracted from a video. The set of photos have unique features and are very clear when next to each other. Homography should be rather straight forward. The one thing to note is that I was holding the camera and moving while taking the video so the axis isn’t perfect. The two photos selected were about 120 frames apart and resized to 30% of the original.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iIPEYsVV4Pi0Q-UHxv96ww.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0UP90qRsmiXjeSjeHp7ufw.jpeg" /></figure><h3>Feature Detection</h3><p>The first step is to find features in the images that are unique and representative in both of the images. Using the SIFT feature detector, the following features were extracted. The number of key-points extracted was set to 50. I tried larger and slightly smaller numbers however it didn’t change the output much.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*6gR7N_YNJ7cG0Ho4Haju-g.jpeg" /><figcaption>Features in sample photo (n =50)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*f--hQINm59sTbcbsljTLig.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*l1vIY8KmqGPXGXj2AT0THg.gif" /><figcaption>Features in full video as GIF (n = 10), <strong>Left</strong>: Grayscale, <strong>Right</strong>: Color</figcaption></figure><h3>Feature Matching</h3><p>Here you can see the mapping between key-points found in the first and second images. This was calculated using the Brute-Force Matcher (BF Matcher). BF matcher takes the descriptor of one feature in the first set and is matched with all other features in second set using a distance calculation., then the closest is returned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6_fOR_9wQUf722a4DgDRtA.png" /><figcaption>Original images</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*m2zGRLPwSc2ZlgwCwJPZ2A.png" /><figcaption>Cropped images to see matchings better</figcaption></figure><h3>Warping and Blending</h3><p>The affine projection was used to match up the images. To maximize the area of the resulting image, I didn’t crop based on the smallest sized part. This resulted in the binocular view. It looks interesting however I could have cropped the image after the fact or found the height of the based on the smallest area where the black pixels end and the image starts, then set the output size as such. The blending used was by taking the average along the stitched line. It is hard to notice the imperfections in the result for a couple of reasons. First, the sky and water are very similar so without thorough examination, the imperfections are less visible. Also, there is not to many objects along the stitched line where other obvious errors could be seen. I initially thought that the wake from the boat would be more disruptive as it was traveling very fast between images resulting in a large difference, however it wasn’t too bad.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D_1Xe3dnp5F5pqGWiNmaUQ.jpeg" /></figure><h3>Bells &amp; Whistles</h3><p>The video I used here was also captured in the South Beach, Florida. The difference is that these were from a time-lapse video with photos taken every few seconds. The surrounding stones provide good stability in the scene, however one video is facing slightly more north and the other, more south. The video was created by cropping one video into two parts: a left and a right with overlap in the middle. I did this so I could keep the theme of Florida and use existing footage I captured myself. I converted the video into a series of images, then created loops of the existing code (similar to how the gifs of the original South Beach, Florida videos were created). I then created a loop on the stitching function, and created a final video. Note, these had to be converted to gifs for them to post here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*KDpET6XBQTO8ShQ9JyRCGA.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*63gAgYUJbMaFQ8mJayqRZQ.gif" /><figcaption><strong>Left</strong>: Left percentage of original time-lapse video, Right: <strong>Right </strong>percentage of original time-lapse video</figcaption></figure><p>By creating a video of the matches between the two images, we can see the majority of points make sense, but this isn’t without error. Keep in mind, 100 features were used. Decreasing this value could have reduced outliers such as the small shade structure seen in the right image or increasing the threshold hold to be stricter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*SbyEDHsiDGY-1-0I3mgn8Q.gif" /><figcaption>Drawn matches image by image as GIF</figcaption></figure><p>Given that the plan was rather stable and my crop was almost exact, warping wasn’t as necessary. What you can see though is that across the top of the stitched photo below are some black pixels. This could be due to the fact that is not aligned exactly however the average blend and the type of scene help hide imperfections.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7jfgXzigmSfuSLelvBvkLg.jpeg" /><figcaption>Image mosaic</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*hUOZbYeDTbMdjkO110t4TQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*x2d1lG5rb-Op5HJiZ2gmoA.gif" /><figcaption><strong>Left:</strong> Original video as GIF <strong>Right:</strong> Video Mosaic as GIF</figcaption></figure><h3><strong>Conclusion</strong></h3><p>Extracting photos from videos is a cool way to work on video related computer vision projects. Essentially applying loops to a sequence can result in the video analysis. I was able to extract and demonstrate the components of stitching images together through feature detection, feature matching, warping and blending, and applying it to a video. I am excited to test this further by taking two separate videos simultaneously from different types of cameras and see if the the stitching can produce good results.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbb137867aa5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Computational Photography Series — Photographic Mosaic]]></title>
            <link>https://medium.com/@sdalaee/computational-photography-series-photographic-mosaic-5de29f348c0e?source=rss-5c119e2cbb77------2</link>
            <guid isPermaLink="false">https://medium.com/p/5de29f348c0e</guid>
            <category><![CDATA[computational-photography]]></category>
            <category><![CDATA[photo-mosaic]]></category>
            <dc:creator><![CDATA[Shaho Alaee]]></dc:creator>
            <pubDate>Mon, 16 May 2022 13:17:17 GMT</pubDate>
            <atom:updated>2022-05-16T13:17:17.279Z</atom:updated>
            <content:encoded><![CDATA[<h3>Computational Photography Series — Photographic Mosaic</h3><p><a href="https://en.wikipedia.org/wiki/Photographic_mosaic">Photographic Mosaics</a> (or photomosaics) are larger pictures made up of many smaller photos. The smaller pictures are organized in such a way that the larger picture is visible. Different approaches can be used to obtain this outcome but they are all based on a database of images organized in such a way that color and shape of the desired output image is visible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*hheNQ17F-l4huYBR.jpg" /><figcaption>Example photomosaic: <a href="https://www.picturemosaics.com/blog/top-three-donts-photo-mosaic-design/">https://www.picturemosaics.com/blog/top-three-donts-photo-mosaic-design/</a></figcaption></figure><p>I decided to build my own photomosaic using 11,239 images captured from a stationary, public web camera. This camera is on a mountain in South Tirol, Italy at the Speikboden recreational peak. The aim was to take images captured from the year 2020, and use them to create one of the other images. Here is a sample of some photos over the 9 month span of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*WWHgZq2NhYPYWz1vDukz-A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*yXxZHuoMUaVKF8htrepfjA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*-gtvc5iR-6Qb5Hu1mQlXPg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*RGlJYswP53_yd9NyNNuWKw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*OhNpBkLMv2URGbmLySgYZg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*hMOeV2x4hehyond8dDDioA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*2Ze7JOzdx_6xKY6ZfJQIow.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*EJstsn31KQ2C09_xg_ai7w.jpeg" /></figure><h3>Building a Photomosaic</h3><p>Many approaches exist to achieve high-quality photomosaics. For best quality, using many photos from the database is key. The more photos you start with, the better, the more detailed the target output can be. In the results section, you will see the difference between using all of the photos (11,239) to choose from, or just the first 3,000. I would argue that if your sampling of images is very diverse, you can build a great photomosaic with less. My first iteration of using only set of 3,000 images were not representative of the over dataset as the images are in order by datetime. I.e., the photos were heavily skewed with majority photos with snow as the dataset started in January.</p><p>If the dataset is small, you could of course repeat many images. In a perfect use case, the image database would not just be large in quantity, but also diverse. Multiple photos that are simple, i.e., close up of a face or something specific in the scene like the ocean, represented by many different colors will produce the best photomosaic. In my case, all of my photos are essentially the same except the time the photo was taken. This creates diversity in color but not across a large spectrum. As you can imagine, an outdoor camera located in the Alps will capture four main colors: white from the snow, green from the grass, variations in blue from the sky, and black depending on the time of day. This was okay given that my target output was one of the images in the dataset, meaning I had many images that had all the colors necessary for this photomosaic.</p><p>In addition to a large image database, the amount of smaller images used also increases the quality. Meaning, if the photomosaic is made up of 100x100 smaller photos, one made up of 1000x1000 could look better as more detail is captured. This is demonstrated in the results.</p><h3><strong>My Approach</strong></h3><p>Using the target photo, I needed to find the hue of each pixel and store it. This served as the blueprint. I iterated through the pixels and for each one I randomly selected an image with the closest average hue and that became the image for that pixel. Using an array of all images as an index, I would drop an image if it was used so there wouldn’t be a repeated image in the photomosaic. This worked because I was always selecting the closest match. As photos were used, it doesn’t guarantee that the best image was always used in the right place.</p><h3>Outputs</h3><p>To make this work, I needed to choose a target photo as my goal. I randomly selected a photo with lots of snow and one with lots of grass. The approach for both was the same. Take my database of images and build these two as outputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*thxKMYboj8fcpRZB34v0gQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*I_rCddRQgNhTC5BN_EvXJQ.jpeg" /></figure><p>After enhancing the image database with more photos of different times of the year, the results improved. Given my initial use of only 3,000 images (predominantly white due to snow), the detail in darker areas of the target output was not as good. The images included night shots as well, so I did have some to choose from, but not enough. The middle images demonstrate this issue. Whereas using the full 11k+, I was able to get more detailed in the picture which can be seen on the images on the right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*fK39TQk06n1M49vz3Gn9WA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*I_rCddRQgNhTC5BN_EvXJQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*Eq7_PbOdkWP81q_mAZl6WA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*0wcho4_jBZCSx-hqY5kh5w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*thxKMYboj8fcpRZB34v0gQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*W32ySN8vHDVAeGTcRpHYJg.jpeg" /><figcaption><strong>Left:</strong> Target <strong>Center:</strong> 3,000 image database with photomosaic made up of 1,994 images <strong>Right:</strong> 11,000 image database with photomosaic made up of 2,304 images</figcaption></figure><h3>Conclusion</h3><p>The images on the right is comprised of more images, which aids in greater detail. Not only were more images available to choose from diverse colors, more images were used to create the target leading to more detail in the photo.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5de29f348c0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Computational Photography Series — Three Frames One Image]]></title>
            <link>https://medium.com/@sdalaee/computational-photography-series-three-frames-one-image-44955378b660?source=rss-5c119e2cbb77------2</link>
            <guid isPermaLink="false">https://medium.com/p/44955378b660</guid>
            <category><![CDATA[computational-photography]]></category>
            <dc:creator><![CDATA[Shaho Alaee]]></dc:creator>
            <pubDate>Mon, 16 May 2022 13:09:14 GMT</pubDate>
            <atom:updated>2022-05-16T13:09:14.063Z</atom:updated>
            <content:encoded><![CDATA[<h3>Computational Photography Series — Three Frames One Image</h3><p>Computational photography is the ability to enhance or extend photography through the digital medium. This blog documents the process of applying computational techniques based on Alexei A. Efros’ Computational Photography course project in which we align images from the <a href="https://www.loc.gov/exhibits/empire/gorskii.html">Prokudin-Gorskii collection</a> for one final color image based on his color photography. His approach was to take 3 different photos each using a different filter (red, green, blue) resulting in separate, monochromatic glass plates. These plates overlaid produced a final color image.</p><h3>Project Requirements</h3><p>Take the digitized Prokudin-Gorskii glass plate images and automatically produce a color image with as few visual artifacts as possible. First, extract the three color channel images and align them so that they form a single RGB color image. The high-resolution images are quite large so the final result will need to have a fast and efficient aligning algorithm. Another requirement is to implement a single-scale and multi-scale aligning algorithm that searches over a user-specified window of displacements. Then, include an additional feature beyond this functionality. In this case, I will be detecting edges within the photographs. As a final test, try the algorithm on other images from the <a href="http://www.loc.gov/pictures/search/?q=Prokudin+negative&amp;sp=2&amp;st=grid">Prokudin-Gorskii collection</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*vzXVjZmAyuc1xf5njnsNag.jpeg" /><figcaption>Figure 1. example photo from the Prokudin-Gorskii collection</figcaption></figure><h3>Images</h3><p>The images dataset has low and high resolution examples. The low are typically around 300x400 pixels and high around 3000x4000. Figure 1 is a low resolution example of the types of photos found in the dataset.</p><p>The original photo is one image comprised of three separate channels. To preprocess, it is necessary to automatically split this into three individual, monochromatic plates assigned to the appropriate color channel. The assumption is that each plate is exactly one-third of the total image size in the order of blue (B), green (G), and red (R).</p><h3>The Goal</h3><p>The goal of this project is to take a raw image from the Prokudin-Gorskii collection (example below, Figure 2), split it into thirds, overlay the 3 images on top of each other using automatic alignment, and displaying the color photo. Figure 2 is an example of the end result desired.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*kUTLO9dMZZkchokEzN7Mcw.jpeg" /><figcaption>Figure 2. desired outcome</figcaption></figure><h3>Aligning Photos Using a Simple Alignment Approach</h3><p>An easy approach to this problem is to just overlay all three images on top of one another, hoping that they are already exactly aligned. Some images look better than others, however none are really great. This is because of the human error of the glass plates not being exactly in the same place (i.e. the photos are more left, right, up, down, than the others) and assuming each photo is exactly a third of the original image. Figure 3 shows four different photos using this approach from the collection. They are mostly blurry due to the misalignment, however some or better/worse than others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*Vcv6d_TWLC7MJfYocAaBQA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*KwJWxKDFlhxsULCmGlofjA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*WNlLbukpquQlvFwQwrMU9Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*cvTGU0MqzJ1wJR6a6rFR-g.jpeg" /><figcaption>Figure 3. simple align by overlaying 3 images on top of each other without any matching</figcaption></figure><h3>Template Matching</h3><p>Template matching is an approach that takes a sub section of pixels (i.e., a template) for what is to be searched across other images. The idea is that that using that as a window to slide over other images in search of an image patch (i.e., a sub-section of pixels in another photo) that is identical (realistically, very close to) would prove as a good alignment tool. Said another way, imagine I take a cropped part of the Emir photo and wanted to align all three channels based on a unique feature found across all images. I could take his face (template example below, Figure 4), and search for these pixel values across the three channels. To do this, I would need to measure the similarity between the template and the image patches from the photos. The sum of squared difference (SSD), sum of absolute difference (SAD), or normalized cross correlation (NCC) are all approaches to measure similarity by finding the areas with the lowest score.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/35/1*13U3dddLw-uFr2jdbbFbfg.jpeg" /><figcaption>Figure 4. Template example</figcaption></figure><h4>Normalized Cross Correlation (NCC)</h4><p>For this project, I am using NCC. By taking the template in which I am searching (Emir’s face) and searching for that image patch in other images, I get the following bounded areas located that had the lowest score. It is important to note that a threshold could be applied to reduce the amount of areas found. Meaning, setting the threshold too high would only return exact matches and setting it too low would return incorrect matches. To get the following result, I had to set the threshold to 60% match to find the face across all channels as they slightly change in detail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*yvztsWK9snm66JRSY3_mTg.png" /><figcaption>Figure 5. Using NCC, a template, and searching for the image patch in other images</figcaption></figure><h3>Searching</h3><p>Now that we have a way to match different color channels based on a feature, we need to establish how we actually search for the template in other images. Smaller photos can afford to use the brute-force search where every part of the image is searched, and the lowest score is then taken. As images grow in size however, this would be inefficient. Two other methods that aim for efficiency are the iterative search, and the image pyramid. The iterative search slides over areas that yield the best results. If the iteration stops improving then the slide of the window is greater so that it can begin the search in a new area without do so on every single image patch. The last search method is the image pyramid. The intuition behind this approach is reducing the size of the image, then searching for matches, informs us of the best region to begin the search in the larger image. This reduces the overall search time and number of calculations.</p><h4>Using the Image Pyramid</h4><p>When working with larger images, there are more things to consider such as processing speed and accuracy. Using the simple alignment approach exaggerates errors when misaligned which explains why photos may look worse, the larger they are. Speeding up the processing time by NOT doing an exhaustive search when aligning the photos is also important. The approach is the same, however we work towards reducing the image size so that it isn’t as computationally expensive. The thought is that in a reduced image, finding where the photos align is useful as it points us in the right direction as the photo gets bigger to where to look. To do this, we use the image pyramid approach. This means, that the image goes through down-sampling so that finding the alignment on the smaller sets, makes it easier to find a good location to start on the larger images. Figure 6 demonstrates the abstraction levels from a larger image (bottom) through the sub-sampled smaller image (top).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*pPHKfhXakSfr2JaP2uXIRA.png" /><figcaption>Figure 6. the high-level abstraction of <a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fwww.geeksforgeeks.org%2Fimage-pyramid-using-opencv-python%2F&amp;psig=AOvVaw2DgqVzVpZfQWeOuJwjDnFF&amp;ust=1643123624317000&amp;source=images&amp;cd=vfe&amp;ved=2ahUKEwiU4O7Q1sr1AhVTFM0KHWeBCssQr4kDegUIARDlAQ">image pyramids</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*ikM0JeNAxc1E8cWuxYE4BA.jpeg" /><figcaption>Original image</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/125/1*y91alVMygk-TjB5NuII92w.jpeg" /><figcaption>Pyramid 1 level down</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/63/1*mT0sxumSxaLW3ueo1bx5Ng.jpeg" /><figcaption>Pyramid 2 levels down</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/32/1*jB5jf_nywC5ua5mHGfTLBQ.jpeg" /><figcaption>Pyramid 3 levels down</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/16/1*lBlzPJxMsBcZMUWBmkSagg.jpeg" /><figcaption>Pyramid 4 levels down</figcaption></figure><p>Because the images keep getting smaller at a rate of half the size per row and column per level, we lose a lot of information. If we were to enhance each image and try to move back to the original quality, that information in not recoverable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*ikM0JeNAxc1E8cWuxYE4BA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/125/1*y91alVMygk-TjB5NuII92w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/63/1*mT0sxumSxaLW3ueo1bx5Ng.jpeg" /><figcaption>Figure 7. enhancing images that have already lost information</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*kfrnvM0-k6bFYy1NGsE1Fg.jpeg" /><figcaption>Figure 11. combined images after using image pyramid</figcaption></figure><p>Two of the photos seem to align, whereas the third is off. This was obvious when using template matching as I had to decrease the threshold to 60% to find the template on the red channel. It seems that this causing an alignment issue. To overcome this, I used edge detection and alignment which is covered in the next section.</p><h3>Detecting Edges</h3><p>When images have different brightness levels across the three channels, images start to look off. One way to remove brightness levels as a variable across the different channels is to detect edges. This then can be used to for alignment.</p><p>But why would this work better? Digital brightness levels don’t have a good way to show the intensity of brightness. Meaning, as brightness continues to increase in the physical world, the digital image will eventually cap at a pixel value but as long as the photo isn’t too overexposed then removing the brightness as a factor is possible by using edges. If the image is overexposed, it may be difficult to find all the edges. Figure 12 is an example of an overexposed image where it could be hard to find all edges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x8Re2eSVnVm2PeZ02ApcXA.jpeg" /><figcaption>Figure 12. example of an overexposed image</figcaption></figure><p>Luckily, the photos we are working with, don’t seem to have the overexposure problem. So how are edges even detected? Mathematically, edges correspond to the discontinuity of pixel values with respect to pixel coordinates. This means, we must search neighboring pixels for changes. To do this, we use the three separate color channel images of Emir (Figure 13). There are different approaches to find edges, however I will use the Canny Edge Detection method to convert them into edges (Figure 14). This approach is based on John Canny and his approach to computational edge detection (John Canny. <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.420.3300&amp;amp;rep=rep1&amp;amp;type=pdf">A computational approach to edge detection</a>. <em>Pattern Analysis and Machine Intelligence, IEEE Transactions on</em>, (6):679–698, 1986.)</p><p>This entails <a href="https://en.wikipedia.org/wiki/Canny_edge_detector">five steps</a>:</p><ol><li>Apply Gaussian filter (smooth the image to reduce noise)</li><li>Find intensity gradients</li><li>Apply gradient magnitude</li><li>Apply double threshold</li><li>Track edges by hysteresis</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*ikM0JeNAxc1E8cWuxYE4BA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*jqe7O1GRTtH5LrhZgey3fw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*e_minXD3sTuJM-aThit1Lg.jpeg" /><figcaption>Figure 13. original photos in BGR order</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*RPnFxFq8sdI3bLVuZ0MQAg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*U741qNghS2XNKI7s8c10Mg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*sTX-sVkg9egSd7RWNq7f4A.jpeg" /><figcaption>Figure 14. edges in BGR order</figcaption></figure><p>As you can see, while the images of the edges are still not 100% accurate, the images are NOT affected by brightness. Using edges for alignment, help the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*kUTLO9dMZZkchokEzN7Mcw.jpeg" /></figure><h3>Conclusion</h3><p>Taking the photos from the Prokudin-Gorskii collection and aligning the three distinct channels for one colored image takes a bit more work than just overlaying the three as even thirds. Using template matching was the appropriate approach, however doing that on the channels has limitations especially when the brightness intensity was very different. Using edge detection and applying the approach to that reduces that complexity and led to better results.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44955378b660" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CV Series 4— Image Formation Part 3 (Theory)]]></title>
            <link>https://medium.com/@sdalaee/cv-series-4-image-formation-part-3-theory-c040085a6da7?source=rss-5c119e2cbb77------2</link>
            <guid isPermaLink="false">https://medium.com/p/c040085a6da7</guid>
            <category><![CDATA[computational-photography]]></category>
            <category><![CDATA[image-formation]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Shaho Alaee]]></dc:creator>
            <pubDate>Sun, 17 Apr 2022 12:05:22 GMT</pubDate>
            <atom:updated>2022-04-18T14:27:11.714Z</atom:updated>
            <content:encoded><![CDATA[<p>In the previous blogs, we discussed essentially what a camera is and its main components are. When I first started diving into this topic I thought this was interesting, however I didn’t see the relevance. I wanted to do computer vision… I wanted to do computational photography… I wanted to manipulate photos the way that I have done with relational, tabular data. Given my goals, I didn’t pay much attention to this part and it hurt me later as I had to go back and learn it anyway to make any progress. The reason is simple. The calculations from light reflecting off an object into the camera and how far the sensor is from the aperture are key for calculations in computer vision. This blog we start to dive a bit deeper into the examples.</p><h3>Parameters</h3><p>Many parameters are required to work with images in a meaningful way. It doesn’t matter if your goal is to build robots that can see, or extract/manipulate images after they have been processed. The image formation is the first step.</p><p>The two types of parameters we deal with in computer vision are: <a href="https://en.wikipedia.org/wiki/Camera_resectioning#Intrinsic_parameters">intrinsic parameters</a> and <a href="https://en.wikipedia.org/wiki/Camera_resectioning#Extrinsic_parameters">extrinsic parameters</a>. Intrinsic are those that represent the optical center and focal length of the camera, whereas the extrinsic represent the location of the camera in the 3-D scene (the world).</p><h3>Focal Length</h3><p>Lets take a look at the <a href="https://en.wikipedia.org/wiki/Focal_length">focal length</a>. The focal length is the distance between the film/sensor and the aperture. Going forward, we can refer to the location of the film or sensor as the image plane. This is where the light is captured and going forward we do not need to focus on the whether the camera is digital or not. Here is a previous example taken further to demonstrate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*dQQLvb2OYsmDA-RzFLAAjA.gif" /><figcaption>Focal length</figcaption></figure><p>To understand why the focal length is important, think about all the different lenses you have heard about, or why new phones have multiple cameras now. E.g., Samsung Galaxy and Apple iPhones are racing to be the first to have 15 cameras on the back and 1 on the front. Okay, maybe not 15 but there are 3. Why? Those cameras have many different properties, but focal length is one of them. Without a lens that is adjustable, the solution is to put multiple with different distances. This is why lens will have properties such as, 35–85mm. This is the millimeter difference from the aperture to the image plane. In this case, the lens is mechanical and can be adjusted to any distance in that range.</p><h3>Coordinates</h3><p>The coordinates are parameters that matter. This entire time we have been using the GIFs without the camera body to demonstrate what is happening inside. The camera image is back to demonstrate that we need to know where in the world the camera is. In the real world, commonly referred to as the 3-D scene, we need the x, y, and z coordinates. It is important to note, the z coordinate is straight out of the camera towards the object. We also need the world coordinates. In time it will make sense as to why but let’s quickly visualize this. The subscript <strong><em>c </em></strong>refers to the <strong><em>camera coordinates</em></strong>, whereas the <strong><em>w </em></strong>refers to the <strong><em>world coordinates</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*eSn72yLuUTh9_UUTYaIN7Q.gif" /><figcaption>Camera and world coordinates</figcaption></figure><p>As a quick recap to this point, we want to take a picture of an object in the real world which is in three-dimensions, and save it as an image in two-dimensions. This is also known as 3-D to 2-D projection. We know how light travels from the object into the camera. That 2D representation ends up on the image plane as shown below. I removed all the extra light rays for simplicity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*q2UmM6xEQ2iP2NY6uXqD7g.gif" /><figcaption>3D object to 2D image projection</figcaption></figure><p>Wait, what just happened? Why is the farmer upside-down? You see this correctly. Thanks to angles, lights end up flipped on the image plane. As weird as this seems, it is intuitive. Look at the light ray from the top of the famer. It is consistent. And yes, if you were wondering if our eyes do the same thing since they are cameras. They do. Anyway, we can simplify and continue this further. The point in the real world, denoted by uppercase <strong><em>P</em></strong>, is that objects point given an x, y, and z value. That light reflects into the camera and hits the image plane. The lowercase <strong><em>p </em></strong>denotes the pixel coordinates of the image given their u and v value. Does it have to be u and v? No. Does it get annoying when studying trying to keep up with variables? Yes. Is it important to learn all of the different ways to call the same thing some thing else? No, but you should be familiar. If you remember anything from my blogs, let it be that academics love making small changes so they can get their Ph.D. Just kidding. I digress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*N3d2Ro1d7wsytZ0e4CIHrA.gif" /><figcaption>World coordinates to pixel coordinates</figcaption></figure><p>In a previous example, it was demonstrated that the z coordinate for the camera comes directly out of the center of the lens towards the object. This is also referred to the <a href="https://en.wikipedia.org/wiki/Optical_axis">optical axis</a>. The optical axis passes directly through the center of the opening. This is referred to the center of projection and all light captured for the image passes through this opening. The light that passes directly along the optical axis and touches the center of the image plane is known as the principal point. See below for the GIF demonstration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*3KqrkECanOriM5_sIa4wnA.gif" /><figcaption>Optical axis, center of projection, and principal point</figcaption></figure><p>Theoretically, the 2D image we end up with is just a down-scaled version of the original 3D object. What does that mean? So far, we saw that light passes through the center of projection and ends up upside down. That image is just a smaller version. We can demonstrate that easily. Below, we have arbitrarily moved the image plane (gray vertical bar) in front of the center of projection. Obviously we are not capturing the image at that location as those rays of light have not entered the camera but to simplify the math and not work with the inverted image, we can then assume that the image in front is a symmetrical triangle to the actual image plane and the 3D object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*yiL-4NP7_U7T3BAz7DBseA.gif" /><figcaption>Arbitrary image plane</figcaption></figure><h3>Coming Up</h3><p>In the next blog we will continue our journey into more parameters that we need to capture. Someone could easily pick up the OpenCV package and copy/paste code without knowing any of this with nice results but I can assure you that a deeper understanding will allow you to solve different types of problems. Also, learning more topics in depth lends itself to drawing more parallels in life together for interdisciplinary convergence. See you in the next one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c040085a6da7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CV Series 3— Image Formation Part 2 (Theory)]]></title>
            <link>https://medium.com/@sdalaee/cv-series-3-image-formation-part-2-theory-75d4272fbeb4?source=rss-5c119e2cbb77------2</link>
            <guid isPermaLink="false">https://medium.com/p/75d4272fbeb4</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[image-formation]]></category>
            <category><![CDATA[computational-photography]]></category>
            <dc:creator><![CDATA[Shaho Alaee]]></dc:creator>
            <pubDate>Fri, 15 Apr 2022 12:51:50 GMT</pubDate>
            <atom:updated>2022-04-16T23:42:56.209Z</atom:updated>
            <content:encoded><![CDATA[<p>In that last post I talked about the theory behind image formation, which required a basic understanding of cameras. This blog continues getting deeper into the subject. Here, we will need to review the lens in greater detail as we attempt to understand their properties. The aperture is important to constrict how much light passes through the camera. We know that we can’t let all light in and risk a blurry image, and we know restricting it too much will cause a dim photo that takes long to process.</p><h3>Light Reflection</h3><p>Let’s take our previous example further. We used a single light ray to demonstrate light traveling to the object and reflecting. In reality, many rays of light are traveling at the same time. By enhancing the demo, we can see that given the light source, the object, and the film/sensor we are trying to save the photo to, we need a way to prevent too many light rays from coming in. The first example shows what happens without any aperture or hole used. All the light is passing directly to the film. This is why images would appear blurry as light reflecting off of the same point on the object are hitting multiple surface places on the film/senor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*UkfrvncnPv_wDM6VRgQaMA.gif" /><figcaption>Light reflected without aperture</figcaption></figure><p>This is where the aperture plays a huge role. By blocking many light rays from passing through, those that make it to the film/sensor represent a specific part of the object, creating a sharper image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*EiRMd7YH6RQyjui7MrQKUg.gif" /><figcaption>Light reflected with aperture</figcaption></figure><p>Great, we solved everything… right? Not quite. If this was the state of the art, different cameras, lens, accessories, external light sources, etc. wouldn’t have been created. These fundamentals shape computer vision but are not the end state. We can now dive into lens to see how that happens.</p><h3>Converging Lens</h3><p>By adding a <a href="https://en.wikipedia.org/wiki/Lens">lens</a>, especially with curvature, we can collect more light over a larger area while forcing the rays to converge on a single point. Why does this matter? Simply put, this forces more reflected light from a specific point of the object to aggregate, or <em>converge</em>, on a single point on the film/sensor making the image brighter. Is it magic? Yes. But is it cool? Yes. The example is taken further by using the converged lens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*xrMoGRu5n0rSYFuFerhBGA.gif" /><figcaption>Using a converged lens</figcaption></figure><p>Properties of the lens allow us to predict the behavior of the light rays. While my GIF examples are not perfectly created as proper angles, they depict the close reality. In the example above, there is a ray of light traveling directly through the center of the lens and NOT changing. This was not a mistake. Rays passing through the optical center are not deviated. I.e., the rays pass straight through. It does not matter the angle in which they hit the center, they will come directly out the other side at 180 degrees. Look at this example to see multiple lines passing through the center at an angle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*teFV539PwKKywWJUjoSHZg.gif" /><figcaption>Optical center</figcaption></figure><p>The focal point is the last property to discuss in this blog before getting into calculations. Light that passes through the lens converges at a certain location, known as the <em>focal point</em>. This is important because knowing this location is key to creating sharp images. Take a look at this example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*TDPDwaDGkMxdCte52NbV6Q.gif" /><figcaption>Focal point</figcaption></figure><h3>Coming Up</h3><p>In the next section, I will start diving into the equations and geometry around the properties in image formation. These topics are the precursor to understanding the functions available in OpenCV and what utility they serve. See you there!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75d4272fbeb4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CV Series 2— Image Formation Part 1 (Theory)]]></title>
            <link>https://medium.com/@sdalaee/cv-series-2-image-formation-theory-75a5d4157919?source=rss-5c119e2cbb77------2</link>
            <guid isPermaLink="false">https://medium.com/p/75a5d4157919</guid>
            <category><![CDATA[image-formation]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[computational-photography]]></category>
            <dc:creator><![CDATA[Shaho Alaee]]></dc:creator>
            <pubDate>Thu, 14 Apr 2022 21:01:44 GMT</pubDate>
            <atom:updated>2022-04-15T12:30:32.595Z</atom:updated>
            <content:encoded><![CDATA[<p>Computer vision may seem like a very complex field with so many moving parts (maybe magic). I am here to tell you, that is true, and it is. That said, understanding the fundamentals of how digital images are actually formed, the perceived magic is more clear and digestible. To understand image formations produced from cameras, we need to understand what a camera actually does.</p><h3>What is a Camera?</h3><p>I don’t want to spend too much time talking about how cameras evolved over time but this simple premise is key. <a href="https://en.wikipedia.org/wiki/Camera">Cameras</a> are instruments that capture visual images. A camera has a body, a hole as the center of projection (<a href="https://en.wikipedia.org/wiki/Aperture">aperture</a>), and some surface that captures the light (film or a sensor). So what does this mean in action? Simply put, a camera when pointed at some object in the world, is capturing light that is reflected back from the source as it bounces off of an object, then saved. Previously, that light was persisted on film, but with digital cameras there are sensors that capture that light and save it to a hard drive. Eyes are essentially cameras. If you ever wondered why you cant see in the dark, it is because what we see in the light is not necessarily the object itself, rather the light bouncing off of the object and captured by our eyes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Enl-PoL0GVcg2YLcAUEwHg.gif" /><figcaption>Image capture process</figcaption></figure><h3>What is Image Formation?</h3><p><a href="https://en.wikipedia.org/wiki/Image_formation">Image formation</a> is our approach to projecting a 3D object where light is deflected off of, into a 2D plane as an image. Put simply, image formation is the process when a photo is taken in the real 3D world, to how the picture is actually formed. While the abstracted process is simple, many considerations and approaches have been addressed to optimize the output. In the coming blogs, these concepts will be expanded upon. To prep the mind, let’s review some of the important factors which dictate the output.</p><p>Key factors in image formation start with the <strong>aperture</strong>. This refers to the hole that the light passes through to capture the photo. One science experiment that is done with kids to explain this process is building a pin-hole camera at home. This quick <a href="https://www.youtube.com/watch?v=zd4F-N301bk">video</a> demonstrates the concept (and details the experiment if interested on testing it out). Considerations on the hole size are important. How many people even wonder why there is a lens with a hole on cameras anyway? Well, the answer is simple. The hole is the constrictor for how much light actually passes into the camera. This is important as it changes the final image. The larger the aperture the more blurry the image, while sharper as it shrinks. Theoretically, you can have an infinitely small aperture where only a ray of light passes through but that would create a very dim image (and in digital photography, the time to create a photo would extend).</p><p>The <a href="https://en.wikipedia.org/wiki/Camera_lens"><strong>Lens</strong></a><strong> </strong>adds a layer of functionality. Behind the lens of a camera is the hole. So what does the lens do? The lens adds the ability to manipulate the hole size as well as provide zooming features for objects that are far away. In industry, this is referred to as the aperture size and focal length.</p><p><a href="https://en.wikipedia.org/wiki/Camera_angle"><strong>Perspective</strong></a><strong> </strong>is something else to consider. E.g., objects that are further away seem smaller, whereas bigger when close up. Ever wonder why you saw a photo of a group of people and someone looked like a giant? This is it. They were most likely closer to the camera (unless they really are just that much larger).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*1o-UHw8uXtC0LE6rk4V0tQ.png" /><figcaption>The perspective in the real world scene effects the image</figcaption></figure><p>Another phenomenon is how straight lines (those that are very long in the scene) appear to vanish at a converging point. Look at this photo I took in San Francisco. Are these trees actually getting closer together at the top? The image may suggest that but we intuitively know that is not the case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z16lWdygfA0c9hv_GwNYNg.jpeg" /><figcaption>Vanishing point due to perspective</figcaption></figure><p>Ever wonder why only a certain part of the real world shows up on a photo? Also, why doesn’t it capture the same area of what someone sees? This is because of the <a href="https://en.wikipedia.org/wiki/Field_of_view#:~:text=The%20field%20of%20view%20(FoV,is%20sensitive%20to%20electromagnetic%20radiation."><strong>field of view</strong></a> (FOV). Humans naturally have a FOV roughly 210 degrees horizontally and 130 vertically. Different lenses help change the FOV while moving closer/further to an object adjust what is in the FOV.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*812pcedR1MTU9EobLdlD0Q.gif" /><figcaption>Person’s field of view (FOV)</figcaption></figure><p>The <a href="https://en.wikipedia.org/wiki/Depth_of_field"><strong>depth of field</strong></a><strong> </strong>is interesting. This is the distance between the closest and furthest object in an image that appears sharp. The example below from photography life illustrates what this means.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*_lR2ohFZgGL9aJXm.jpg" /><figcaption>Depth of field illustrated by <a href="https://photographylife.com/what-is-depth-of-field">https://photographylife.com/what-is-depth-of-field</a></figcaption></figure><p>This is also why the new cameras used in sporting events where the athletes are in focus, however the background and objects in front of them are blurry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*D4XU3u0_Jk1RGd6g4I9n7g.gif" /><figcaption>Tom Brady is very clear versus the background (<a href="https://www.youtube.com/watch?v=dPKgiYlgbc4">original video</a>)</figcaption></figure><h3>Coming Up</h3><p>In the next section, I will address the lens and its properties as a part 2 to image formation so we can get into calculating these different parameters and how that affects what we do in computer vision. See you there.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75a5d4157919" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CV Series 1 — Intro]]></title>
            <link>https://medium.com/@sdalaee/cv-series-1-intro-def98f9ea901?source=rss-5c119e2cbb77------2</link>
            <guid isPermaLink="false">https://medium.com/p/def98f9ea901</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[opencv-python]]></category>
            <category><![CDATA[computational-photography]]></category>
            <dc:creator><![CDATA[Shaho Alaee]]></dc:creator>
            <pubDate>Wed, 13 Apr 2022 14:49:02 GMT</pubDate>
            <atom:updated>2022-04-13T14:49:02.384Z</atom:updated>
            <content:encoded><![CDATA[<h3>CV Series 1 — Intro</h3><p>One area of computer science that intrigues me is computer vision. The way that systems can see the world leads to autonomous innovation. This series of blogs is to deepen my understanding of computer vision, how to use OpenCV with Python, and to create a reference for later. The content is based on my coursework at the George Washington University, the <a href="https://www.amazon.com/Computer-Vision-Algorithms-Applications-Science/dp/1848829345">Computer Vision Algorithms and Applications</a><em> </em>text book, the robust synthesis from <a href="https://www.themtank.org/a-year-in-computer-vision">The M Tank</a>, and work experience. Please note, this series isn’t to provide a robust deep-dive into the field, rather my journey while learning from those who provided material to study matched with my own curiosity.</p><h3>The Series Layout</h3><p>Following the structure of the text book, the format of the series will follow the following structure: <strong>Image Formation, Image Features, Multiple View Geometry, Optical Flow and Tracking. </strong>This Intro briefly discusses computer vision, my setup, the OpenCV package, and what to expect.</p><h3>What is Computer Vision?</h3><p>Computer vision is the ability to capture, understand, and interpret information as it is contained in visual media. I.e., what we can derive from collecting signals through image and videos.</p><h3><strong>Tools and Technology Used In My Journey</strong></h3><p>There are many languages and tools today that are, <em>and could be</em>, leveraged when doing computer vision tasks. E.g., languages such as Python, C/C++, and Matlab; IDEs from PyCharm, Anaconda, and CLion; and packages like OpenCV and Tensorflow. Given my experience, knowledge, and coursework, I used the Python programming language, the OpenCV library for Python, and bounced between PyCharm and Anaconda for development. The reason for multiple IDEs was that I like the fast prototyping nature of Jupyter notebooks to quickly share code and outputs without requiring the other person to run anything to see output. However, given the type of GPU I have I was not able to leverage it from Jupyter. This meant taking the code when I was ready to work on larger datasets and complex tasks to PyCharm.</p><h3>OpenCV</h3><p><a href="https://opencv.org/">OpenCV </a>(open source computer vision) is a packaged collection of many functions necessary for computer vision tasks. These functions make the barrier to entry much lower as the fundamental tools are readily available for use. OpenCV’s library is extensive and takes time to really grasp all the resources included. Like many others, I bounced between the <a href="https://docs.opencv.org/4.x/">official documentation</a>, references posted by others, and <a href="https://stackoverflow.com/">Stack Overflow</a> for support.</p><h3>What to Expect</h3><p>Throughout the series, I will share code, inputs, and outputs on personal projects that I used to deepen my understanding. It was also more enjoyable to use images/videos that I captured once I learned functions versus the ones online that everybody always uses. Here is a snippet of what to expect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*pHpxZALLSMiVy29b_0cNGQ.gif" /><figcaption>Feature Detection</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*SbyEDHsiDGY-1-0I3mgn8Q.gif" /><figcaption>Feature Matching</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*x2d1lG5rb-Op5HJiZ2gmoA.gif" /><figcaption>Video Mosaic (two separate videos taking on the same x axis stitched together using Homography)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=def98f9ea901" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Immersive Technology — VR Is For Everyone]]></title>
            <link>https://medium.com/@sdalaee/immersive-technology-vr-is-for-everyone-af2aa94b3de9?source=rss-5c119e2cbb77------2</link>
            <guid isPermaLink="false">https://medium.com/p/af2aa94b3de9</guid>
            <dc:creator><![CDATA[Shaho Alaee]]></dc:creator>
            <pubDate>Sat, 26 Feb 2022 15:30:37 GMT</pubDate>
            <atom:updated>2022-02-26T15:30:37.511Z</atom:updated>
            <content:encoded><![CDATA[<h3>Immersive Technology — VR Is For Everyone</h3><p>Data Science and Machine Learning (ML) have been getting growing hype for years. Bootcamps, degrees, certificates, platforms, and all sorts of tools are rolling out what seems like weekly. This is a sign of technical maturity. I expect that this is going to start over the coming years (sooner) for immersive technology. Attracting engineers and developers is a key step in the maturity. Just as you didn’t have to have years of experience to learn key data science and ML to be productive to the field or a team, immersive technology is also becoming more accessible. Of course those who journey down this path will have to learn, but the expansion of tools reduce the barrier of entry to contribute. Here is my experience for my first VR application. For my LinkedIn post with a demo video, click <a href="https://www.linkedin.com/posts/sdalaee_why-do-you-want-to-wear-monitors-on-your-activity-6902610806194659328-ZlB2">here</a>.</p><h3>Project Ideation</h3><p>COVID-19 has posed many travel limitations leaving people feeling trapped at home. Without the ability to go to new places to unwind, many people felt burnt out. In addition, some people don’t have the ability to travel due to financial situations or disabilities. These reasons have further cemented why the use of VR for leisure activities could be appealing to those who think VR is just for gamers. The truth is that there are many use cases and a wide range of demographics who could benefit. The idea was sparked from living in Liechtenstein, where I rode the bus or train daily on a line that ran through the middle of the Alps. The ability to sit in a passive activity while listening to a book, music, or podcast while staring out of the window to take in the environment was amazing and improved my mood and quality of life. The idea of the app was to emulate this experience by providing a beautiful landscape for a relaxing journey through nature without experiencing the wild elements. Given the rise in technological advancements, VR is becoming more available and creating more use cases for a wider audience.</p><h3><strong>VR Application Design</strong></h3><p>The key considerations for building the VR app was to simulate the experience of being in nature while leveraging the techniques and best practices found in the Unity 2020 Virtual Reality Projects book. Intuitively, I knew what I would like to experience, but needed to translate that to actual functionality for an end user. In addition, I had to make sure that this was usable outside my dev environment. Meaning, packaging this up and providing it for those who have the compatible set up. My environment was rather large and took many hours to package.</p><p>I used the HTC Vive Pro 2, which provided some difficulty over the course of the project. Through research, I was able to find the Steam VR package that handles the interactions of the VR setup (as long as you are using Steam VR on the machine) so that specific hardware could be detected automatically and leveraged from within the app. Another consideration was that I wanted the visual effects to be better than average as just moving through an unedited scene using the hardware would not have simulated the experience I had in mind. I needed a way to leverage assets with 3D objects that gave the environment I envisioned during the project ideation versus spending a lot of time on 3D modeling and creation. I did NOT create the nature scene and 3D objects in the demo, I imported the asset and built functionality within it.</p><h3>The Technical Environment</h3><p>The setup that I used was not the norm. I have the HTC Vive Pro 2, which requires a strong machine to power it and is quite expensive compared to personal use headsets, such as the Oculus. I have my own workstation, VR equipment, and a VR room. The workstation I used has the following specifications: Windows 10 Professional Edition build 19042 (64-bit), 1 x AMD Ryzen Threadripper 3960X 24-Core Processor (3800.5 MHz], 127.9GB RAM, NVIDIA GeForce RTX 3090, 954GB HDD, HTC Vive Pro 2, 2 base stations, 2 knuckle valve controllers The VR software environment I used has the following specifications: Unity SteamVR Building VR with Unity and Steam VR (book as reference) and multiple assets imported from the Unity store.</p><h3><strong>User experience</strong></h3><p>Optimizing the user experience for VR app (referring to effective VR application design factors) was important to me. This app includes teleporting, text queues, audio, six degrees-of-freedom (6DOF), and a complete scene with skybox for full immersion. It was also built using Steam VR so the play should be seamless between devices that are linked with SteamVR. I ensured that when in game play, the view changed with the head movement to eliminate motion sickness and did not include any fast speed from one point to another. To fully immerse the player, an audio file was added on a loop of nature sounds to stimulate the auditory senses. Birds that fly around on their own were also added to enhance the experience of being in nature as well as their sounds. A player can walk around the scene and these objects continue their motion and play. Using subtle text queues was also included; instruction when someone first starts, a queue on the controller to explain teleport, and border texts that inform the user that they are at the teleport area boundary and to turn around. A user can use 6DOF by walking in their space, then leveraging teleport to go further. The nature scene includes a sky box and does not let the play leave the area. This ensures full immersion and the idea that the forest they are in is endless as they don’t see where it actually ends given the hills and limited transport area.</p><h3>Continued Development</h3><p>I would like to have incorporated more scenes to switch between and a train experience. I don’t think it would have been hard to do as the skills I learned by creating the forest would have translated, but I ran out of time that I set to finish this project. I spent a lot of time working with the cinemachine package to incorporate the track and dolly feature. When in development mode, I was able to build the track and create the timeline animation, however when in play mode, the camera wouldn’t move. After some time, I decided to give up on that feature and make the experience to include moving around the nature scene I had built versus a train experience. I also included some birds, but other animals or other people automatically walking through the scene would have made it more immersive. Adding some time concept so that it goes from day to night would also have been interesting. The last feature that I think could be exciting is some connection that allows for a person to listen to their audiobook/music from within. If a person wants to sit by the beach or in a forest while listening to their favorite book, it would be possible from their couch.</p><h3><strong>Lessons Learned</strong></h3><p>The book I used had every version of software. Meaning, almost every chapter in the book I followed used a different version of Unity. This wasn’t a problem to do exercises and learn as I easily downloaded whatever environment and version that was required and was able to proceed. The challenge at the end was that I had to rebuild everything myself and not leverage my previous exercises because they were incompatible with each other. For example, learning teleporting and configuring it on 2018.1 and creating a main menu on 2020.2 meant that if I wanted both, I had to recreate one. This happened for many features. The good news is that made me better as I had more practice but definitely extended the development time. This also meant that some bugs I experienced (or didn’t experience) in a specific version, would be different in another. For example, configuring the controller bindings locally on one version of Unity used a different port than the others. This meant troubleshooting something I had previously learned to figure out why all of a sudden this feature is no longer right.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af2aa94b3de9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Behavior Algorithm]]></title>
            <link>https://medium.com/@sdalaee/the-behavior-algorithm-bfa63e582856?source=rss-5c119e2cbb77------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfa63e582856</guid>
            <category><![CDATA[algorithm-development]]></category>
            <category><![CDATA[customer-segmentation]]></category>
            <category><![CDATA[time-series-clustering]]></category>
            <dc:creator><![CDATA[Shaho Alaee]]></dc:creator>
            <pubDate>Tue, 22 Feb 2022 14:06:44 GMT</pubDate>
            <atom:updated>2022-02-22T16:16:50.459Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7bqHi1QObslDZ4nmyZQERg.png" /></figure><h3>A Novel Time Series Clustering Approach Applied to B2B Customer Segmentation</h3><h3><strong>Introduction</strong></h3><p>Understanding time series data is useful. Understanding customer behavior is useful. During my professional career, I was tasked with finding a way to better understand my company’s customer base to aid in strategic customer segmentation by identifying patterns that were outside of the typical firmographics (Figure 1).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*zFbTL7oaocr4ys2A_tQ1gA.png" /><figcaption>Figure 1: Firmographics</figcaption></figure><p>I thought the problem itself was trivial, as segmentation (viewing a heterogenous market as several smaller homogenous markets) had been around for years. Similarly, time series analysis was also not new. The more I researched, the more I realized the current approaches were lacking. I worked with many business SMEs to understand the customer base. This helped me determine what it was that I was searching for. What initially seemed like a simple copy/paste approach, quickly turned into much more.</p><h3><strong>The Work</strong></h3><p>Outside of the typically firmographics, companies are constantly looking for new ways to understand the market, which means customer segmentation was not static. Time series clustering also did not have an approach to cluster the based on behavior of the line. This work was to create a novel, theoretical approach for clustering time series data together, then applying it to a real-world problem in the customer segmentation domain. Figure 2 breaks down the work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*5SMBVfYKcYGLaw8Q0OeqIg.png" /><figcaption>Figure 2: The work</figcaption></figure><h3><strong>Time Series Clustering</strong></h3><p>There are two well known approaches for time series clustering. Euclidean Distance (Figure 3) measures the difference between every data point at the same timestamp, then sums them to get one value. The smaller the sum, the closer (more similar they are). Euclidean Distance excels at matching series that are the same, or very close. i.e., series data that has very similar values at the same timestamps</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*ma2Gpz5brZnObPjXFTxgOg.png" /><figcaption>Figure 3: Euclidean Distance</figcaption></figure><p>Dynamic Time Warping (Figure 4) measures the distance between every data point at the all timestamps to find the optimal location to adjust for temporal shifts, then sums them to get one value. Dynamic Time Warping excels at matching series that are the same in values, or very close, but considers temporal shifts. i.e., series data that has very similar values but can be at different timestamps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*JSw4uWNbb_JZSYJe_petZw.png" /><figcaption>Figure 4: Dynamic Time Warping</figcaption></figure><h3><strong>The Behavior Algorithm</strong></h3><p>Solutions exist but not without flaws. The Behavior Algorithm is a proposed theoretical solution for clustering time series data and seeks to overcome the shortcomings of existing methodologies. Figure 5 shows the known problems and proposed solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*TcMC5eZXUeKme8MGWJvmTA.png" /><figcaption>Figure 5: Problems and proposed solution</figcaption></figure><p>The pattern that a series of data depicts over time is the behavior. The behavior of a time series gives insight into the data. The premise is that similar behaviors over time equate to the time series data being similar. Figure 6 shows different behaviors as time series lines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*wXBIrf0BQCfgJMsQghyItw.png" /><figcaption>Figure 6: Time series examples of similar behavior</figcaption></figure><p>Here are examples (Figure 7) of two time series graphs where the <strong>absolute values are the same</strong>, however the <strong>pattern is different.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*UzfpRciicxQof5ABWpEovg.png" /><figcaption>Figure 7: Examples with similar absolute numbers</figcaption></figure><p>Here are examples (Figure 8) of two time series graphs where the <strong>absolute values AND patterns are different.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*arCKaIqfEV35HmBPh1KWAg.png" /><figcaption>Figure 8: Examples with very different absolute numbers</figcaption></figure><p><strong>Normalization is the key </strong>to put all series on the same scale. The three previous examples are graphed below (Figure 9) after normalization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*69kuyLDP_kBeEazAoPc2Uw.png" /><figcaption>Figure 9: Examples graphed together after normalization</figcaption></figure><p>The <strong>behavior algorithm creates a single value for an individual time-series</strong>, regardless of how many timestamps or the absolute values, so that similar scores can be clustered together based on behavior. <strong>It comprises of two calculations.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*lEFOt3gQNAJLe1FVdKo4LA.png" /><figcaption>Figure 10: Two calculations of the behavior algorithm</figcaption></figure><h3><strong>Contrived mathematical examples for understanding.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*hzbLjUEYl0x-k0scNLGksg.png" /><figcaption>Figure 11</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*0PYDvy8GdJ82GUKhcpm-Lw.png" /><figcaption>Figure 12</figcaption></figure><p><strong>The sum of series and the sum of absolute difference</strong> <strong>have overlap </strong>in the patterns they detect, <strong>and</strong> each <strong>has advantages over the other</strong>. Figure 13 shows the differences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*BrSsaXfIBPPIQ-VtdXf0cA.png" /><figcaption>Figure 13</figcaption></figure><p>The <strong>behavior algorithm applied to real data</strong>. The human eye test can easily find similarities in the series… so can the behavior algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*YvFa-GxqqoSJgClAqm1Yvw.png" /><figcaption>Figure 14: Real world data application</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*DoM20_ueGZH1kv2an7cDqg.png" /><figcaption>Figure 15: Real world data application</figcaption></figure><h3><strong>Real World Application</strong></h3><p>This use case is <strong>an international B2B company</strong>. Through this section of the presentation, it will be clear how the behavior algorithm was leveraged, enhanced, and applied. The goal of this application was to <strong>systematically</strong> <strong>group customers </strong>together who are <strong>similar</strong> based on their <strong>purchase patterns</strong> by creating one model that is robust enough for every country without modification. Working with business SMEs, I was able to identify three customer behaviors important to strategy and relationship.</p><p><strong>Types of customers; Project</strong> customers spend money frequently with high variation. <strong>Operational</strong> customers spend money frequently with low variation. <strong>Transactional</strong> customers have both patterns; however, the total amount is below a certain threshold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*gA-sELy5Kf5ba9vKAPMi7Q.png" /><figcaption>Figure 16: Types of customers</figcaption></figure><p>This graph (Figure 17) shows the behavior of the different customer groups in a simplistic view. <strong>The operational and project customer have a consistent history of spending money</strong>; however, the <strong>operational customer has a low fluctuation</strong> in the amount whereas the amount for <strong>project customers have higher fluctuation</strong>. <strong>Transactional</strong> <strong>customers</strong> can have one of the two behaviors, however, have a total amount <strong>below a threshold.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*qd_yjxWwHLiFRN5kWwekUA.png" /><figcaption>Figure 17: Customer behavior as time series examples</figcaption></figure><p>The <strong>threshold is a computed value that automatically sets the transactional limit based on the amounts of a market </strong>(Figure 18). This simplifies the model, while making it robust enough to be specific for each country without the input of people.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*01lV3qdVoHBhuOm0-k03-Q.png" /><figcaption>Figure 18: Threshold example</figcaption></figure><p><strong>The ability to compare customers who are project, operational, and transactional from different views </strong>(Figure 19) provides strategic advantages. In this case, we can now easily view the market from the three main perspectives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*As34C7ljMda_A-1TvTAm9Q.png" /><figcaption>Figure 19: Different strategic views</figcaption></figure><h3><strong>Results</strong></h3><p><strong>The Behavior Algorithm outperforms Dynamic Time Warping in speed</strong>. It is important to note that DTW outperforms when looking for exact matches and not similar patters. E.g., matching to sound waves. Figure 20 demonstrates the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DuAZG-1G28uZf2JZsCJqYA.png" /><figcaption>Figure 20: DTW vs Behavior Algorithm</figcaption></figure><p>By <strong>computing the values for the customers</strong>, we can take the average over the years to <strong>classify them appropriately. </strong>E.g., a customer pattern over a single year, may not be indicative of a true classification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HMU82oTrzGeZPtJ03xzE_w.png" /><figcaption>Figure 21: Classification ranges based on data</figcaption></figure><p>To <strong>recap </strong>(Figure 22), the <strong>behavior algorithm was developed </strong>to apply <strong>customer segmentation </strong>to a real-world use case to solve the strategic needs of an international company with <strong>time series data.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P5r-Pt3zIWZDJNXOSmh47Q.png" /><figcaption>Figure 22: Recap of work</figcaption></figure><h3><strong>Things to Consider</strong></h3><p>We need a <strong>time frame to measure</strong>, but where is the sweet spot? By choosing a window too large or too small, we will lose the essence of the behavior. <strong>The smaller the window, the more fluctuation the data gives, and the larger the less. </strong>The examples below (Figure 22) are from the same data, just aggregated in different periods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YAbK3lxrR3SwWzk79GSgfw.png" /><figcaption>Figure 22: Time intervals</figcaption></figure><p>We can use <strong>rounding </strong>(Figure 23)<strong> to control for noisy variation for better results.</strong> Depending on the data, in this case transactions, measurement to decimals, tens, thousands, etc. may not be important and therefore accounted for in the data preparation process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*TRfyqKpFofTJAZ3exerj2Q.png" /><figcaption>Figure 23: Rounding</figcaption></figure><p>The <strong>behavior algorithm could be further refined </strong>and used for different use cases in other domains. Here are suggestions (Figure 24) on how this could be pursued further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*e5DqPep_ZRIu5bZys4yQeg.png" /><figcaption>Figure 24: Continuing work</figcaption></figure><h3><strong>References</strong></h3><p>Aghabozorgi, S., Seyed, A., &amp; Wah, T. Y. (2015). Time-series clustering — A decade review. <em>Information Systems</em>, <em>53</em>, 16–38. <a href="https://doi.org/10.1016/j.is.2015.04.007">https://doi.org/10.1016/j.is.2015.04.007</a></p><p>Alvandi, M., Fazli, S., &amp; Abdoli, F. (2012). K-Mean clustering method for analysis customer lifetime value with LRFM relationship model in banking services. <em>Research Journal of Applied and Basic</em>, <em>3</em>(11), 2294–2302. Retrieved from <a href="http://irjabs.com/files_site/paperlist/r_289_121025150620.pdf">http://irjabs.com/files_site/paperlist/r_289_121025150620.pdf</a></p><p>Balaji, S., &amp; Srivatsa, S. K. (2012). Customer Segmentation for Decision Support using Clustering and Association Rule based approaches. <em>International Journal of Computer Science and Engineering Technology</em>, <em>3</em>(11), 525–529.</p><p>Balke, N. S. (2019). Detecting Level Shifts in Time-series, <em>11</em>(1), 81–92.</p><p>Chicco, G., Napoli, R., &amp; Piglione, F. (2006). Comparisons among clustering techniques for electricity customer classification. <em>IEEE Transactions on Power Systems</em>, <em>21</em>(2), 933–940. <a href="https://doi.org/10.1109/TPWRS.2006.873122">https://doi.org/10.1109/TPWRS.2006.873122</a></p><p>Cierpicki, S., Rungie, C., &amp; Faulkner, M. (1998). Segmentation: Linking Management Practice to Marketing Theory. <em>Australian and New Zealand Marketing Academy Conference 98</em>, <em>CD proceed</em>, 362–376.</p><p>Dawes RM. (1979). The robust beauty of improper linear models. <em>American Psychologist</em>, <em>34</em>(July), 571–582.</p><p>Golmah, V., &amp; Mirhashemi, G. (2012). Implementing A Data Mining Solution To Customer Segmentation For Decayable Products — A Case Study For A Textile Firm. <em>International Journal of Database Theory and Application</em>, <em>5</em>(3), 73–90.</p><p>Kumar, V., &amp; Gagandeep Raheja, E. (2012). Business To Business (B2B) and Business To Consumer (B2C) Management, <em>3</em>(3), 447–451. <a href="https://doi.org/10.1.1.299.8382">https://doi.org/10.1.1.299.8382</a></p><p>Mcafee, A., &amp; Brynjolfsson, E. (2012). Spotlight on Big Data Big Data: The Management Revolution. Retrieved from <a href="http://tarjomefa.com/wp-content/uploads/2017/04/6539-English-TarjomeFa-1.pdf">http://tarjomefa.com/wp-content/uploads/2017/04/6539-English-TarjomeFa-1.pdf</a></p><p>Mora Cortez, R., &amp; Johnston, W. J. (2017). The future of B2B marketing theory: A historical and prospective analysis. <em>Industrial Marketing Management</em>, <em>66</em>(January), 90–102. <a href="https://doi.org/10.1016/j.indmarman.2017.07.017">https://doi.org/10.1016/j.indmarman.2017.07.017</a></p><p>Noori, B., &amp; Salimi, M. H. (2005). A decision-support system for business-to-business marketing. <em>Journal of Business and Industrial Marketing</em>, <em>20</em>(4–5), 226–236. <a href="https://doi.org/10.1108/08858620510603909">https://doi.org/10.1108/08858620510603909</a></p><p>Shearer, C. (2000). The CRISP-DM Model: The New Blueprint for Data Mining. <em>Journal of Data Warehousing</em>, <em>5</em>(4), 13–22. <a href="https://doi.org/10.1016/0022-4073(81)90019-4">https://doi.org/10.1016/0022-4073(81)90019-4</a></p><p>Smith, W. R. (1956). Product Differentiation and Market Segmentation as Alternative Marketing Strategies. <em>Journal of Marketing</em>, <em>21</em>(1), 3. <a href="https://doi.org/10.2307/1247695">https://doi.org/10.2307/1247695</a></p><p>Stormi, K., Laine, T., &amp; Elomaa, T. (2018a). FEASIBILITY OF B2C CUSTOMER RELATIONSHIP ANALYTICS IN THE B2B INDUSTRIAL CONTEXT. <em>Journal of Strategic Marketing</em>.</p><p>Stormi, K., Laine, T., &amp; Elomaa, T. (2018b). FEASIBILITY OF B2C CUSTOMER RELATIONSHIP ANALYTICS IN THE B2B INDUSTRIAL CONTEXT.</p><p>Sugeno, M., &amp; Yasukawa, T. (1993). A Fuzzy-Logic-Based Approach to Qualitative Modeling. <em>IEEE Transactions on Fuzzy Systems</em>, <em>1</em>(1), 7–31. <a href="https://doi.org/10.1109/TFUZZ.1993.390281">https://doi.org/10.1109/TFUZZ.1993.390281</a></p><p>Thomas, R. J. (2016). Multistage market segmentation: an exploration of B2B segment alignment. <em>Journal of Business and Industrial Marketing</em>, <em>31</em>(7), 821–834. <a href="https://doi.org/10.1108/JBIM-12-2015-0245">https://doi.org/10.1108/JBIM-12-2015-0245</a></p><p>Zalaghi, Z., &amp; Abbasnejad Varzi, Y. (2014). Measuring customer loyalty using an extended RFM and clustering technique. <em>Management Science Letters</em>, <em>4</em>(5), 905–912. <a href="https://doi.org/10.5267/j.msl.2014.3.026">https://doi.org/10.5267/j.msl.2014.3.026</a></p><p>Zu, Q., Wu, T., &amp; Wang, H. (2010). A multi-factor customer classification evaluation model. <em>Computing and Informatics</em>, <em>29</em>(4), 509–520.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfa63e582856" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>