<?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 Yi Shen on Medium]]></title>
        <description><![CDATA[Stories by Yi Shen on Medium]]></description>
        <link>https://medium.com/@ys3372?source=rss-bfbed0d06513------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*INrDDmfL7MHXB06z</url>
            <title>Stories by Yi Shen on Medium</title>
            <link>https://medium.com/@ys3372?source=rss-bfbed0d06513------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 22:53:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ys3372/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[Color Threshold and Image Processing Basics]]></title>
            <link>https://medium.com/@ys3372/color-threshold-and-image-processing-basics-c1d4099cfd9e?source=rss-bfbed0d06513------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1d4099cfd9e</guid>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[colors]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Yi Shen]]></dc:creator>
            <pubDate>Sat, 28 May 2022 03:42:50 GMT</pubDate>
            <atom:updated>2022-05-28T03:42:50.015Z</atom:updated>
            <content:encoded><![CDATA[<h4>How pixels are classified by color</h4><h3>Introduction</h3><p>What I’m introducing here are the basic principles of image processing. Specifically, image segmentation(raster classification), color spaces, color threshold, and some senior techniques. Please be aware that some of these are old-fashioned techniques that have all been achieved by graphic design software. Still, they are the foundation of image processing and have been applied in many color recognition-related fields such as face(skin color) recognition, land texture classification, graphic software development, etc. For further research, Machine Learning techniques are a must.</p><p>For designers who would like to understand image processing principles, this post is a step-by-step journey showing how an image is processed based on color.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*C6NZzwOgNHdo2gwO302acg.png" /></figure><p>I believe my priority is not to the Python lines in my post but to tell the story. A big part of the codes are from other Medium posts, all listed in the reference. Therefore, for those who wish to see the codes, I strongly recommend you to read those splendid posts and try the codes yourself. Still, I’m happy to share all my Python(Google Colab) files. Just leave a comment!</p><h3>Understanding Image Data Structure and Color Space</h3><p>Graphics(rasters, of course!) are written and read as array-like data. In the example below, the shape of image data is (631, 889, 3), which means that the array has 3 dimensions(rows, columns, and color dimensions). The first two dimensions define the image size(how many pixels), while the third means the number of color space dimensions. The screenshots below show the differences between the same image in RGB &amp; RGB-A color space. For a greyscale image, the structure can be simpler.</p><p>Here I used a satellite image of Shanghai Disneyland, accessed via Google Earth(for some reason the API satellite image was not accessible):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*yK4JpbpR6FO6IN2EujYKxw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*IIOdaVoicINMryc7iGfoVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/278/1*sA83dT5emPQuJ-wZFmbFTw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*rKwbxPwlx7xTee7ZW_ZH6Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*3d4Ss4cC9z9-QYmdjYXSEw.png" /></figure><p>Grayscale images are black-gray-white, simply showing the amount of light. Therefore, an image can be processed(calculated). For example, if we define a luminosity threshold, we can classify the rasters into two groups and separate the pixels we want. In the processed images shown below, pixels with a grayscale smaller than our threshold(0.2) are revised to 0(white); otherwise revised to 1(black).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dr3DanMZJZOgUk23loCEGg.jpeg" /><figcaption>Grayscale Image(Left); Masked(Right)</figcaption></figure><p>The RGB to Grayscale formula(RGB values normalized to 0–1):</p><pre>Grayscale = 0.299R + 0.587G + 0.114B</pre><p>There are multiple threshold methods in <em>skimage.filters </em>with various mathematical logic<em>. </em>We can compare them all and decide which works the best in our specific case.</p><pre>thresh = threshold_otsu(img_gray)</pre><pre>img_otsu  = img_gray &lt; thresh</pre><pre>img_otsu = img_otsu*1 #convert boolean to integer</pre><pre>imshow(img_otsu, cmap=&#39;Greys&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*9-pt0nE73PZf8tGF74V_cg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*eHqUA6JOdlvyk_0yzz4Qyg.png" /><figcaption>otsu_threshold(Left); <em>try_all_threshold</em>(Right)</figcaption></figure><p>Similarly, we can separate pixels based on RGB or HSV code. Below diagrams are visualizations of the image’s HSV/RGB color space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qlw-FFe_iJ9_GsjJCvuyrQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a5Kwr91byou0UqG-TQR87g.png" /></figure><p>A few lines of code can help us tell the differences between two similar images. This is based on grayscale values. These lines conduct a pixel-by-pixel grayscale subtraction of the two images(resized, of course). Typically, the result from two different images should have 1. a mixed structure(pixels overlapping each other) and 2. both red and blue colors(depending on the colormap we use), meaning the images’ different luminosity structures. This is because, for any two different pictures, the bright part and the dark part should be different. However, if two images are from the same original source with a few parameters adjusted, they might look either red or blue with identifiable outlines.</p><p>This result may not be accurate, especially for images with <em>contrast</em> adjusted, but is an easy and effective visualization if you want to detect the differences between images.</p><pre>img1_gray = rgb2gray(img1)<br>img2_gray = rgb2gray(img2)<br>img3_gray = rgb2gray(img3)<br>diff1 = img1_gray - img2_gray<br>diff2 = img1_gray - img3_gray<br>imshow(diff1)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhTfp5Hud9wMxX76O1lLBA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N-l3nugMxsrNKybM8V02yg.jpeg" /></figure><h3>Adding A Mask(Not a Musk)</h3><p>Keep in mind that your purpose is to separate your objects. For a satellite image, this means recognizing water, vegetation, bare land, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*RrShNqoN5WiAUUqW2R0quA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*C9i4i6H93q0QmNEDnVR6hQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*39AR_Qw-C2am3TRyaLd41Q.jpeg" /></figure><p>Intuitively, you should choose the image among all the threshold results that best separates your object. In this case, V-value in HSV color space seems to work best in identifying green. So I choose to add conditions to V-value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4r1iin1Su9UtWW-1heHe3w.jpeg" /></figure><p>You may have noticed that the conditions returned an image-like boolean array. This is the mask that tells the computer which rasters from the original image we want to keep. Diagrams below show how the mask works:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*m40VRRE7_NAvXSMCMB7pRw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*e3_OM4C7H5PftXBJGMM6BQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*QNluPwWExJ7LGlzPi8rOlQ.png" /></figure><h3>Finding The Mathematical Definition For Your Color</h3><p>If you wish to find pixels of the same/close color as some small part of an image(depending on what color you want). In Adobe Photoshop it is as simple as the gif shows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXWdEz80AxezIVUCix4pyA.gif" /><figcaption>the Magic Wand function in Photoshop</figcaption></figure><p>How to separate the exact pixels in python? How was the function achieved? It’s the same logic as you define a point cluster in a 2d or 3d axis. Here I present the easiest color space to understand — RG color space as an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*qDzA9-RbIka7guCN-g77jQ.png" /><figcaption>RG Chromaticity Equation and Color Space. <a href="https://medium.com/swlh/introduction-to-image-processing-part-6-image-segmentation-2-3099c7bca29b">Source</a></figcaption></figure><p>In RG color space, colors are better illustrated in the 2d axis, each can be represented by a set of X-Y coordinates. Once you have the R and G values, the B value can be calculated with a simple formula.</p><p>The diagrams below show the image and its patch’s Gaussian distribution of R and G channels. The color space visualization illustrates that even better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cECT3DRRCurUjA3yzPhEvQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*IZrnOHxK4Ot9tpzUE0FL-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*z74PoN-TeKraFXkoV3XeLQ.png" /></figure><p>Apparently, the patch’s color range is more monochromatic. If we make the patch area larger(meaning we selected more pixels with more different colors), the pixels can be visualized like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*cSnaoBpfKTSTU1zhURnN0g.png" /></figure><pre>figure,ax = plt.subplots(2,2,figsize=(16,16))</pre><pre>#[0,0] RG color space</pre><pre>patch = ax[0,0].scatter(patch_r.flatten(),patch_g.flatten(),color=&#39;tomato&#39;, s=2)</pre><pre>all=ax[0,1].scatter(img_r.flatten(),img_g.flatten(),color=&#39;lightblue&#39;, s=0.2)<br>ax[0,0].set_xlim(0,1)<br>ax[0,0].set_ylim(0,1)<br>ax[0,0].set_title(&#39;RG Color Space: Patch&#39;)<br>ax[0,0].legend((patch, all), (&#39;Patch&#39;,&#39;All&#39;), scatterpoints=5, loc=&#39;uppr right&#39;,ncol=10,fontsize=12)<br>ax[0,0].set_xlabel(&#39;Red Channel&#39;)<br>ax[0,0].set_ylabel(&#39;Green Channel&#39;)</pre><pre>#[0,1]<br>all=ax[0,1].scatter(img_r.flatten(),img_g.flatten(),color=&#39;mediumslateblue&#39;, s=0.2)<br>ax[0,1].set_xlim(0,1)<br>ax[0,1].set_ylim(0,1)<br>ax[0,1].set_title(&#39;RG Color Space: Patch vs All&#39;)<br>patch=ax[0,1].scatter(patch_r.flatten(),patch_g.flatten(),color=&#39;tomato&#39;, s=2)<br>ax[0,1].legend((patch, all), (&#39;Patch&#39;, &#39;All&#39;), scatterpoints=5, loc=&#39;uppr right&#39;,ncol=10,fontsize=12)<br>ax[0,1].set_xlabel(&#39;Red Channel&#39;)<br>ax[0,1].set_ylabel(&#39;Green Channel&#39;)</pre><pre># histogram[1,0]<br>ax[1,0].hist2d(patch_r.flatten(), patch_g.flatten(), bins=10,cmap=&#39;binary&#39;)<br>ax[1,0].set_xlim(0,1)<br>ax[1,0].set_ylim(0,1)<br>ax[1,0].set_title(&#39;Histogram: Patch&#39;)<br>ax[1,0].set_xlabel(&#39;Red Channel&#39;)<br>ax[1,0].set_ylabel(&#39;Green Channel&#39;)<br>#RG Chromaticity Graph</pre><pre>p_color = [(r, g, 1-r-g) for r,g in zip(patch_r.flatten(),patch_g.flatten())]<br>norm = colors.Normalize(vmin=0,vmax=1.)<br>norm.autoscale(p_color)<br>p_color = norm(p_color).tolist()<br>ax[1,1].scatter(patch_r.flatten(), patch_g.flatten(), c = p_color, alpha = 0.20, s=0.4)<br>ax[1,1].set_xlabel(&#39;Red Channel&#39;)<br>ax[1,1].set_ylabel(&#39;Green Channel&#39;)<br>ax[1,1].set_xlim(0,1)<br>ax[1,1].set_ylim(0,1)<br>ax[1,1].set_title(&#39;RG Chromaticity Graph: Patch&#39;)</pre><p>Our job then became ‘finding the functions that best define the cluster.’ The smaller and more aggregated the point cluster is, the more accurate our functions would be.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*jpwRtoaAbMGICYa3AcAR8Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*EMEPnR9N6nXlgIcTf0sA1w.png" /></figure><p>The final result is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jMYlux2xp7febesik27kDg.gif" /></figure><p>Finally, below is another RG color space visualization example. The original picture was taken in Oct 2021 at the Metropolitan Museum of Art(MET)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O2pIdUzw7WVaksP8uICSig.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*C6NZzwOgNHdo2gwO302acg.png" /></figure><h3>Key Takeaways</h3><ul><li>Image Structure and Color Space</li><li>Grayscale Definition and Application</li><li>How to add a Mask</li><li>RG Color Space and Gaussian Distribution</li><li>Image Visualization in RG Color Space</li></ul><p>My next post will be about how Machine Learning methods are applied in graphic detection and image processing.</p><h4>Thanks for reading!</h4><h3><strong>References</strong></h3><ul><li><a href="https://medium.com/swlh/human-skin-color-classification-using-the-threshold-classifier-rgb-ycbcr-hsv-python-code-d34d51febdf8">Human Skin Color Classification Using The Threshold Classifier: RGB, YCbCr, HSV(Python Code)</a></li><li><a href="https://medium.com/swlh/introduction-to-image-processing-part-5-image-segmentation-1-99f93d9f7a5e">Introduction to Image Processing — Part 5: Image Segmentation 1</a></li><li><a href="https://medium.com/nerd-for-tech/lane-detection-with-opencv-part-2-efdad71e8819">Lane detection with OpenCV — Part 2</a></li><li><a href="https://medium.com/swlh/introduction-to-image-processing-part-6-image-segmentation-2-3099c7bca29b">Introduction to Image Processing — Part 6: Image Segmentation 2</a></li><li><a href="https://towardsdatascience.com/image-processing-with-python-using-rg-chromaticity-c585e7905818">Image Processing with Python — Using RG Chromaticity</a></li><li><a href="https://medium.com/@ys3372/deconstructing-an-image-with-pixels-4c65c3a2268c">Image Color Extraction using K-Means</a></li><li><a href="https://medium.datadriveninvestor.com/skin-segmentation-and-dominant-tone-color-extraction-fe158d24badf">Skin Segmentation and Dominant Tone/Color Extraction</a></li></ul><p>For further study:</p><ul><li><a href="https://medium.com/hackernoon/image-feature-extraction-local-binary-patterns-with-cython-b31171ad5dc9">Image Feature Extraction: Local Binary Patterns with Cython</a></li><li><a href="https://towardsdatascience.com/clothes-and-color-extraction-with-generative-adversarial-network-80ba117e17e6">Clothes and color extraction with Generative Adversarial Network</a></li><li><a href="https://medium.datadriveninvestor.com/skin-segmentation-and-dominant-tone-color-extraction-fe158d24badf">Skin Segmentation and Dominant Tone/Color Extraction</a></li><li><a href="https://github.com/matterport/Mask_RCNN">GitHub - matterport/Mask_RCNN: Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1d4099cfd9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Image Color Extraction using K-Means]]></title>
            <link>https://medium.com/@ys3372/deconstructing-an-image-with-pixels-4c65c3a2268c?source=rss-bfbed0d06513------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c65c3a2268c</guid>
            <category><![CDATA[color-space]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[color-extraction]]></category>
            <category><![CDATA[design-thinking]]></category>
            <dc:creator><![CDATA[Yi Shen]]></dc:creator>
            <pubDate>Mon, 23 May 2022 09:08:35 GMT</pubDate>
            <atom:updated>2022-05-23T13:26:18.910Z</atom:updated>
            <content:encoded><![CDATA[<h3>Image Color Extraction using K-Means Clustering</h3><h4>Everything About Color Extraction</h4><h4>Introduction</h4><p>This article explains basic methods for <strong>image color extraction</strong> and visualization using Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tM6tYF6UlPCe-rkBGK13xw.png" /></figure><h4><strong>Vector vs Raster</strong></h4><p>There are two general types of graphs: <strong>raster </strong>and <strong>vector</strong>. Vector graphs are based on geometry shapes, such as points, curves, polygons, etc. For vector data are drawn by clear geometric formulas, they convey information correctively and accurately. If you zoom in on a vector image on your device, the boundaries are always clear.</p><p>Raster graphs can be recognized as array-like data made of pixels, the smallest unit of a dot containing color information. The number of pixels in an image is referred to as resolution. For the same image, high resolution(more pixels) usually means higher graphic quality and more details. Most graphic analysis research is raster-based.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z1N7quTBKzGLaNVlyJKgIg.png" /><figcaption>A Photo of Hells Kitchen at Different Resolutions</figcaption></figure><h4><strong>Color Spaces</strong></h4><p>Every single pixel in a raster image is given a color. Images can be perceived as <strong>datasets of colors</strong>. All we have to do is to<strong> define colors with numbers</strong>. For example, the colormap is one method to present <strong>one-dimensional</strong> color information. Each point from one end to the other represents one specific color, while palettes and color swatches can be perceived as a <strong>two-dimensional</strong> color index.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*h2AdT-P-sPrgld2BeML6RQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*DdQFRQFTxB4N6nJwcbkprg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LoaBDcar3PwIPaWm9him3w.png" /><figcaption>Matplotlib Colormaps(left); Photoshop Color Swatch(right)</figcaption></figure><p>While 1d and 2d are easy to understand, 3d color space is broadly applicable in practice. Typical 3d color spaces include <strong>RGB, HSV, Lab, etc. RGB</strong> is the default color space for Machine Learning among all color spaces. Photoshop’s Color Picker is a perfect illustration for colors and codes for different color spaces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*BL4c3-crMxaDYb0xFA7sPQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/105/1*Cf8dTkaLWaIB0UkdV3TcQQ.jpeg" /><figcaption>Color <strong>Botticelli(</strong>left)<strong> </strong>in<strong> </strong>RGB Color Space(RGB 145, 179, 188; HEX #91B3BC)</figcaption></figure><p>The following two articles I found on Medium explain the definition and application of different color spaces.</p><ul><li><a href="https://towardsdatascience.com/understand-and-visualize-color-spaces-to-improve-your-machine-learning-and-deep-learning-models-4ece80108526">Understand and Visualize Color Spaces to Improve Your Machine Learning and Deep Learning Models</a></li><li><a href="https://pub.towardsai.net/opencv-different-color-spaces-in-image-processing-with-python-17bbed3592ad">OpenCV: Different Color Spaces in Image Processing with Python</a></li></ul><h4>Extracting Colors From an Image</h4><p>Now let’s try what we can do with the color knowledge. Here I used a photo I posted on WeChat Moments in March 2022. The image is understood by the computer as a 1080*1440*3 array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r3cqQeS0O7gsl2-oxonwVA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*ZQYVwRal86zDQuiZn6j-gg.png" /><figcaption>Original Image(1080x1440 jpeg)</figcaption></figure><p>I then split RGB color channels with the function in cv2. For each pixel conveying [r,g,b] data, this function changes the data into [r, r, r], [g, g, g], and [b, b, b] respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S57BO3buFu8cTGnpoSKVHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/309/1*jCdbm4DZY1-m6Lh3lbmDBg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*tD4RWBfPs2GizdyWMZ1g-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*8tlV6YTVZNNNiE7RRdZlsw.png" /></figure><p>Therefore, the photo is deconstructed into pixels with <strong>3d RGB data points</strong>, thus can be visualized in a 3-d axis. See below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TkLKcKsu5XL1bA5iAwRaDw.png" /><figcaption>RGB Color Space Visualization</figcaption></figure><h4><strong>K-Means Clustering</strong></h4><p>How do we extract a few dominant colors from this large dataset? One intuition is to classify them into clusters and find the geometry center of each cluster. This can be achieved via Machine Learning methods.</p><p>The principle of <strong>clustering</strong> is to partition data into groups, each data point is assigned to a group. Data points in one group share similarities. In our practice, similarities are recognized as simple as <strong>Euclidean distance</strong>(visually reasonable).</p><p>I used K-Means clustering for this case. In short, K-Means clustering is a dynamic process of <strong>finding the centroid</strong>, and other points are classified according to their distance from the centroid. Theoretically, other clustering methods(e.g. DBSCAN, agglomerative) can also be applied. But K-means clustering is a <strong>nondeterministic algorithm</strong>, meaning the outputs could be adjusted (by changing the number of cluster <strong>K</strong>) until we find the results <strong>consistent with our intuition</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*uwZLt-XL7JDkolVIt2FA5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rqlNCJHOeF3QxUafdZgnPA.png" /><figcaption>Extracted Colors(left); RGB Color Space Visualization, Colored by Cluster Centroid(right)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hARB3v8n_OouScfJhUsMWA.jpeg" /><figcaption>Original Image vs Extracted Colors (k=8)</figcaption></figure><p>Below is another example of color extraction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*21S5zFqDKy6KriLFat0awg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*godv3N7kl8TIaDMnII8AYg.png" /><figcaption>Chinatown(纽约华埠), Manhattan, NY</figcaption></figure><h4>The Number of Colors To Extract</h4><p>How many colors should we extract? Typically, data scientists use the <strong>Silhouette</strong> or <strong>Elbow test</strong> to find the <strong>optimal K </strong>for K-means clustering, which is not necessary for our practice. For example, when applying the Elbow test, the optimal K is 2(the location of the bend), while 2 is clearly not helpful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*-RM4E-I4LVPXr9br61gZ1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*o7zFwcfLTwEqsOMtHVaDKA.png" /><figcaption>Elbow Test Result(left); Extracted Colors when K=2(right)</figcaption></figure><p>The diagram below shows results from different K values(2, 4, 8, 12, 16) applied to the model. The colored clusters can help us decide K-value(in layman’s terms, how many colors we should extract). When K-value is larger than eight, the differences in these clusters are no longer visually apparent. Also, the pie charts are showing some visually-identical colors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6aKJRIVhv4eRd7lOXp5c1w.jpeg" /><figcaption>Applying the Model with Different K values</figcaption></figure><h4><strong>Key Takeaways</strong></h4><ul><li>Perceive images as mathematical data</li><li>Understand why RGB color space can be used in Machine Learning</li><li>K-Means Clustering</li><li>How to decide on K-value</li></ul><p>The next coming article will be about color calculation and thresholds.</p><h4>References</h4><ul><li><a href="https://medium.com/analytics-vidhya/3d-visualization-of-k-means-clustering-47d3d3e82117">3D Visualization of K-means Clustering</a></li><li><a href="https://towardsdatascience.com/color-palette-extraction-with-k-means-clustering-machine-learning-from-scratch-part-iv-55e807407e53">Color palette extraction with K-means clustering | Machine Learning from Scratch (Part IV)</a></li><li><a href="https://medium.datadriveninvestor.com/skin-segmentation-and-dominant-tone-color-extraction-fe158d24badf">Skin Segmentation and Dominant Tone/Color Extraction</a></li><li><a href="https://pub.towardsai.net/opencv-different-color-spaces-in-image-processing-with-python-17bbed3592ad">OpenCV: Different Color Spaces in Image Processing with Python</a></li><li><a href="https://towardsdatascience.com/understand-and-visualize-color-spaces-to-improve-your-machine-learning-and-deep-learning-models-4ece80108526">Understand and Visualize Color Spaces to Improve Your Machine Learning and Deep Learning Models</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c65c3a2268c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One-click Design With Grasshopper]]></title>
            <link>https://medium.com/data-mining-the-city-2022/programming-design-methodology-5a7556c4e791?source=rss-bfbed0d06513------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a7556c4e791</guid>
            <category><![CDATA[final-project]]></category>
            <dc:creator><![CDATA[Yi Shen]]></dc:creator>
            <pubDate>Sun, 01 May 2022 16:29:57 GMT</pubDate>
            <atom:updated>2022-05-23T12:30:59.111Z</atom:updated>
            <content:encoded><![CDATA[<p>Yining Shen</p><p>Below are three landscape drafts of the accessory park of the Hudson Yards. Please look at them and answer the following two questions:</p><ol><li>Which draft do you like most?</li><li>These three drafts are by three individuals: a landscape architect, someone without any design background, and a grasshopper program. Can you guess which?</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c2V-cRMYdotFwzJXmZxm4Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*luDUif5NqNmPIP_fXAT2Xw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o2iGyoJ6lOsuCNcPLqub-g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/0*Zz1EmmdnG0Ukwv70.png" /></figure><p>What I was trying to do here was a Turing test.</p><p>Can computers do better design than human designers?</p><p>Can people tell computer from human?</p><blockquote><strong><em>In the annual Turing test competition, computers uses their astonishing achievements as well as their equally fascinating failings to reveal our most human abilities: to learn, to communicate, to intuit, and to understand.</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*UMadEyTeYqbzwYIaj38rYw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oUvkGn2rGxGjk84WW0Sf6g.jpeg" /><figcaption>gh batteries(left); designer’s draft</figcaption></figure><p>My project aims to program one design methodology that can be used to offer plans for landscape projects. With a number of preset inputs(site boundary, built environment, osm data), designers are asked to draw their drafts for the site. Three designers are given the job: a landscape architect professional, a tourist with no design education background, and my grasshopper program. They were asked not to add too many details, for my program has not been completely developed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*_BdhTX3oiyt41U4klITNTw.png" /><figcaption>Algorithm</figcaption></figure><p><strong>1 Pixelation</strong></p><p>Both the site and its surrounding buildings are pixelated (for view analysis in this case). Lines(simulating the sight) connecting the center point of the buildings and the site are used to test whether the sight is blocked by obstacles. The panels that have the best views score the highest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YU5WsaJP9qpWkNE_ff760w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vQ3Hz3YhmoJJYnBXaMVetQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7tfLCbxlHWkoGrKCweiLhw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UyN99OS5XGMx8qmZ1_ZqMg.jpeg" /><figcaption>The initial view analysis result</figcaption></figure><p><strong>2.1 Zoning</strong></p><p>The pixels are sorted into 3 categories to generate clear boundaries based on their scores. Those who score the highest(green) are better places for vegetation because they have better openness and healthy green can be seen by more people. Low-scored red indicating closure and privacy are better places for public events and placing public arts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8y3SAjEXsUMr6SoJkSifaw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vGHZK4ewg2DuQ3jrkG1mOw.jpeg" /></figure><p>Green panels are clustered to generate smooth shapes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X1wVYJVCh2OaljjT9mJaqw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eoDCG-OWO4oaIW5AEzdVxg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9WUKHEbYt4v_XEydAuIfMA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w9PUWeATShZLrt8609zUyQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xl3SBHoyENCJtbh-SPR7pw.gif" /><figcaption>multiple options offered by k-means calculation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MLIfUHpJlhTYx38o1EqzHg.gif" /></figure><p>2.2 Locating</p><p>Again, red in our site means something interesting. Red clusters are “must-go”s. I clustered the red pannels and located their center points. These points help decide a route inside the park.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8mqgS4tM-OmmrnMijOI5Hw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U_H7BzTjupiLFlP_FF99hA.jpeg" /></figure><p>3. Finding a route</p><p>A mesh web was created based on: 1. the must-go spots, 2. control points of the vegetation boundaries, and 3. the grid points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DMlcXBBfiPIY1-f_Ns9xCw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x2oGqAdehRaVoYsHmKjZaw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yaUyNY6T6_smRrs6mhrkvQ.gif" /></figure><p>Finally, the plug-in <em>Shortest Path </em>helped me decide on one major path.</p><p>And the path is smoothed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dNw0unWzYeUYf3hyu0fA7A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RObdefem4Qz0Vs5Ya6Klig.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o2iGyoJ6lOsuCNcPLqub-g.jpeg" /></figure><p>The program worked well in the case of Lincoln Square. Still, it’s not a one-click process but requires a lot of adjusting. And we have to choose from the hundreds of options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BkOAzGPY4wHalEg-dBRTDg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s7qeOx-wQcu4rnVlcBW_Pg.jpeg" /></figure><p><strong>I did this project to show that computers can do design, though it has limitations.</strong></p><p>References</p><p>To construct the model, I acquired .osm data from <a href="http://enstreetmap.org/">OpenStreetMap</a> and MapPLUTO from <a href="https://www1.nyc.gov/site/planning/data-maps/open-data.page">NYC Planning’s Open Data portal</a>.</p><ul><li>MapPLUTO — Shoreline Clipped (FGDB). NYC Department of City Planning. Last updated on Sep 31, 2021. <a href="https://www1.nyc.gov/site/planning/data-maps/open-data/dwn-pluto-mappluto.page">https://www1.nyc.gov/site/planning/data-maps/open-data/dwn-pluto-mappluto.page</a></li><li>OSM file around Hudson Yards. OpenStreetMap. Acquired on Feb 26, 2022. <a href="https://www.openstreetmap.org/">https://www.openstreetmap.org/</a></li></ul><p><a href="https://brianchristian.org/the-most-human-human/">Brian Christian</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a7556c4e791" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-mining-the-city-2022/programming-design-methodology-5a7556c4e791">One-click Design With Grasshopper</a> was originally published in <a href="https://medium.com/data-mining-the-city-2022">Data Mining the City — City Playlab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Applying Grasshopper Plug-ins in Hudson Yards]]></title>
            <link>https://medium.com/data-mining-the-city-2022/graduately-simulating-a-picturesque-path-6cec3bfeabd1?source=rss-bfbed0d06513------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cec3bfeabd1</guid>
            <category><![CDATA[assignment-3]]></category>
            <dc:creator><![CDATA[Yi Shen]]></dc:creator>
            <pubDate>Wed, 13 Apr 2022 23:07:20 GMT</pubDate>
            <atom:updated>2022-05-23T12:32:02.804Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FWmr8rSCM1jyYz_5AYn-cg.gif" /><figcaption>24-hour pedestrian volume simulation</figcaption></figure><p>A general impression of the pedestrian volume of Hudson Yards. This is based on a lot of simulations and speculations. Clearly, there isn’t much going on on my site compared with the 10th ave.</p><p>33th St seems to be the busiest street, which was not true. Many people go through 20 Hudson Yards, the retail center, instead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TflKDxkNONWhOv9WGg_8fA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7cJ2e8yFbttrRHBWWe6HAg.jpeg" /><figcaption>site boundary(left); site visibility patterns(right)</figcaption></figure><p>What’s going on here is both a view analysis and an initial site plan. I colored the most visible spots(panels) green and red for the least. Judging from the graph in the middle, the differences were not significant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k9lhvRraDIvovvXBXZ8SNA.jpeg" /><figcaption>sight-based site zoning(right)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-HuzZn_f1u4JtL8xhB59SQ.png" /></figure><p>I classified the site into three colors with a grasshopper. (a small step towards “one-click design”)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h7giIeTNXwMrGV4uHDXalw.jpeg" /><figcaption>route simulation</figcaption></figure><p>The route(line) was drawn based on “red spots.” Ideally, the red spots would be connected and generate an identifiable way itself. For now, it is drawn by hand.</p><p>Next step: to generate a line with the view-analysis logic automatically. The most head-aching but essential part.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F699228810%3Fh%3D54c4c1303b%26app_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F699228810&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F1413676378-308a060b41d636b6b27da2c801d3160e2ffc87440d40eb622c0ca34b894eb3d2-d_1280&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/cf1560f60f46de200163315ce49c94dc/href">https://medium.com/media/cf1560f60f46de200163315ce49c94dc/href</a></iframe><p>A simulation of how pedestrians would wander through the site along the route.</p><p>The two gifs of view visualization below contribute nothing to the overall design logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O-dmo9oYuBtFp6Fq3je4kw.gif" /><figcaption>2D view analysis</figcaption></figure><p>A simulation of 2d-view analysis</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y-ZsY3fF8taMVhLOkBoyOw.gif" /><figcaption>3d view analysis</figcaption></figure><p>A simulation of 3d-view analysis</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cec3bfeabd1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-mining-the-city-2022/graduately-simulating-a-picturesque-path-6cec3bfeabd1">Applying Grasshopper Plug-ins in Hudson Yards</a> was originally published in <a href="https://medium.com/data-mining-the-city-2022">Data Mining the City — City Playlab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One-Click Design with Grasshopper?]]></title>
            <link>https://medium.com/@ys3372/one-click-design-with-grasshopper-9e83bafbeef4?source=rss-bfbed0d06513------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e83bafbeef4</guid>
            <dc:creator><![CDATA[Yi Shen]]></dc:creator>
            <pubDate>Thu, 24 Mar 2022 00:41:05 GMT</pubDate>
            <atom:updated>2022-05-23T12:32:59.906Z</atom:updated>
            <content:encoded><![CDATA[<p>Yining Shen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*WKG_WMAJjqeZ2tf35uAomw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*Bwdfwq825Plrhn6iHAH1gg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*F-CGOi5OWRcoE9qzD4564w.jpeg" /><figcaption>(left)the Turing test, (middle)<strong><em>The Most Human Human</em></strong>, (right)the Loebner Prize</figcaption></figure><blockquote><strong><em>The Turing test is a test of a machine’s ability to exhibit intelligent behavior</em></strong><em> </em><strong><em>equivalent to</em></strong><em>, or indistinguishable from, </em><strong><em>that of a human</em></strong><em>. </em><strong><em>Turing proposed that a human evaluator would judge natural language conversations between a human and a machine designed to generate human-like responses.</em></strong></blockquote><blockquote><strong>We are interacting with computers so sophisticated that we think they’re human beings.</strong> In the book the Most Human Human, Brian Christian takes the recent and breathtaking advances in artificial intelligence as the opportunity to rethink what it means to be human, and what it means to be intelligent.</blockquote><blockquote><strong>In the annual Turing test competition, computers uses their astonishing achievements as well as their equally fascinating failings to reveal our most human abilities: to learn, to communicate, to intuit, and to understand.</strong></blockquote><h3>Day-Dreaming… a Turing test for designs? (Not My Plan)</h3><p>Can people tell what good design is? In other words, do they accept something not designed by the traditional designers but by computer experts?</p><p>With the help of Grasshopper(or any other kind of software), generated one or multiple plans, but choose ONE. Use the plan to bid for projects against human designers.</p><p>No modification can be done once the plan has been generated.</p><h3>Inspiration: simplifing the design workflow.</h3><p>SAPNDA has developed an apartment building automation process. This process makes it possible to find an apartment layout that satisfies the legal requirements such as the distance between the buildings, the distance between the skylights, the distance between the sidewalls, and other legal requirements in a short time through the legal conditions within the same plane and the site. It also includes tools for analyzing solar conditions, views, and parking.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fgf9F-eLVOXE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dgf9F-eLVOXE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fgf9F-eLVOXE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8409bbfd0072641fa31689286889066e/href">https://medium.com/media/8409bbfd0072641fa31689286889066e/href</a></iframe><h3>Inputs:</h3><ol><li><strong>Site Boundary</strong></li></ol><p>A Site of any kind with its surrounding environment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*JVy9oKer0G6j9gJTBMXcqg.png" /><figcaption>Public Space of Hudson Yards, roughly 500x500</figcaption></figure><p><strong>2. Traffic Network</strong></p><p>Specify at least 3 types: Driveways, Bikeways, Footways</p><p><strong>3. Major/Secondary Entrances</strong></p><p><strong>4. Other things required by the local law(FAR)</strong></p><h3>Outputs</h3><ol><li>With some limited parameter inputs, generate a set of draft site-design plans with a simple building footprint.</li><li>(If possible)Consider terrains as a preset</li><li>(If possible)Coloring and Rendering</li></ol><h3>Possible Methodologies</h3><p>the essense is to design methodologies</p><ol><li>Visual Focus(with IsoVist and other view analysis tools)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/0*moJQpYugJdB6dnNq.png" /></figure><p>2. Traffic Flow(with traffic data)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KwKqEcS9Ff2VkH0m.jpeg" /></figure><p>3. Land Texture/Land Color(Generated from Google API)</p><p>4. Case studies of design methodologies…</p><p>The Most ‘#NameOfArchitects’ ‘#NameOfArchitects’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rhJOPHd8nFGo4iWyzqpUmA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*vc-tL57DVuo8qTXQ6xll9g.jpeg" /></figure><h3>References</h3><ul><li><a href="https://brianchristian.org/the-most-human-human/">Brian Christian</a></li><li><a href="http://news.bbc.co.uk/2/hi/science/nature/1595136.stm">BBC News | SCI/TECH | Chatty computers sought</a></li></ul><p><a href="https://woojsung.com/2020/04/">https://woojsung.com/2020/04/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e83bafbeef4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Now You See Ve?]]></title>
            <link>https://medium.com/data-mining-the-city-2022/now-you-see-ve-4e2b573f1dc5?source=rss-bfbed0d06513------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e2b573f1dc5</guid>
            <category><![CDATA[grasshopper]]></category>
            <category><![CDATA[viewability]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[hudson-yards]]></category>
            <category><![CDATA[student-work]]></category>
            <dc:creator><![CDATA[Yi Shen]]></dc:creator>
            <pubDate>Thu, 10 Mar 2022 15:21:22 GMT</pubDate>
            <atom:updated>2022-05-23T12:39:53.375Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Logic of View Analysis in Grasshopper</h3><h4><strong>Hudson Yards as an Example</strong></h4><p>Known as the most expensive real-estate development in US history, <strong>Hudson Yards </strong>has become one of the must-go destinations since its opening to the public in <strong>2019</strong>. It is estimated that Hudson Yards contains approximately <strong>125,000 people</strong> daily in this 28-acre neighborhood, half of which is public open space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OwGBFjWRzoTh0PZCyF4M0w.png" /><figcaption>The Turn on the Highline before the Vessel Appeared (the cylindrical object behind in this image)</figcaption></figure><p>The vessel appeared behind the modern-style buildings at the end of my first trip to the Highline as something unknown but incredible. The first word that hit my mind was “Luxury.” It would be a luxurious experience to live in a condo with a view of the Vessel through its fall-to-ground windows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6u3yX3z9eKz46GNjIwC7Q.jpeg" /><figcaption>A pic from inside 20 Hudson Yards</figcaption></figure><p>My research site is basically the L-shaped open space outside the buildings. I deconstructed my objects into panels: first the site, then the buildings around with the panels and analysis points. These points are assumed both observation spots and target-view spots. All visualization below is selected from Grasshopper’s random picks, which best illustrate the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xvoR7zpW8ZOGfejYa176rA.png" /></figure><p>The logic of view analysis is to draw lines between observation spots and the targets(a line between 2 spots, basically) and then make the program judge whether any obstructions cut the lines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*82mNgBgP5wE4hkqEJ9Go-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l_YbChOG_2Ft5EeNhfJ2aQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VQh6GiM77hWF_ycl6mI0RQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*-mVk6omrbpm_MDtYTsR0qA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uSn_zCLrkIjKAPUmnW_3BQ.png" /><figcaption>Solid blue means better visibility of the spots in the site, while transparent pink implies the opposite.</figcaption></figure><p>Each spot is labeled by how many rays they emit can hit the target before being hit by the obstruction(buildings). The same thing was done both to the buildings and the site. The colors can help with site design in defining visual focuses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*uNZE3W4UxW1WIekNiE5LYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*p7TV1l-EDoUOH4pSXhMCpw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kybtOSMWL_Q8Y3w_hapQsw.png" /><figcaption>Have the Site Colored Based on ‘Views Counts’ from Buildings</figcaption></figure><p>A not-new conclusion from the visualization: the spots with the best views(the red panels in the image above) are usually traffic intersections. Designers can think dialectically about how to deal with the contradiction between traffic and entertainment.</p><h4><strong>Data Sources</strong></h4><p>To construct the Twin City model, I acquired .osm data from <a href="http://enstreetmap.org/">OpenStreetMap</a> and MapPLUTO from <a href="https://www1.nyc.gov/site/planning/data-maps/open-data.page">NYC Planning’s Open Data portal</a>.</p><ul><li>MapPLUTO — Shoreline Clipped (FGDB). NYC Department of City Planning. Last updated on Sep 31, 2021. <a href="https://www1.nyc.gov/site/planning/data-maps/open-data/dwn-pluto-mappluto.page">https://www1.nyc.gov/site/planning/data-maps/open-data/dwn-pluto-mappluto.page</a></li><li>OSM file around Hudson Yards. OpenStreetMap. Acquired on Feb 26, 2022. <a href="https://www.openstreetmap.org/">https://www.openstreetmap.org/</a></li></ul><h4><strong>File Link</strong></h4><p><a href="https://drive.google.com/drive/folders/1rspem2hMDpmZdCgmZbMwj-mRPAJb1LHh?usp=sharing">https://drive.google.com/drive/folders/1rspem2hMDpmZdCgmZbMwj-mRPAJb1LHh?usp=sharing</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e2b573f1dc5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-mining-the-city-2022/now-you-see-ve-4e2b573f1dc5">Now You See Ve?</a> was originally published in <a href="https://medium.com/data-mining-the-city-2022">Data Mining the City — City Playlab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>