<?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 P-Bhandari on Medium]]></title>
        <description><![CDATA[Stories by P-Bhandari on Medium]]></description>
        <link>https://medium.com/@piyush1995bhandari?source=rss-b6647c860d03------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Od7DBl6ztJQ2g31c8HSDbg.jpeg</url>
            <title>Stories by P-Bhandari on Medium</title>
            <link>https://medium.com/@piyush1995bhandari?source=rss-b6647c860d03------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 04:54:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@piyush1995bhandari/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[Legal Tech India]]></title>
            <link>https://medium.com/@piyush1995bhandari/legal-tech-india-1132ed3f2848?source=rss-b6647c860d03------2</link>
            <guid isPermaLink="false">https://medium.com/p/1132ed3f2848</guid>
            <category><![CDATA[legaltech]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[legal-services]]></category>
            <category><![CDATA[legal-technology]]></category>
            <category><![CDATA[law]]></category>
            <dc:creator><![CDATA[P-Bhandari]]></dc:creator>
            <pubDate>Tue, 12 Mar 2019 12:45:04 GMT</pubDate>
            <atom:updated>2019-03-12T12:45:04.970Z</atom:updated>
            <content:encoded><![CDATA[<p>I spent quite some time researching and talking to different lawyers and legal firms to explore the problems faced by law firms. After few months into the research, I was able to get a good idea on the current scenario of the legal tech industry. In order to aid people who might be inclined towards the field, I decided to jot down my conclusions and research. I would advise the reader to bear in mind that this research is focused purely on the legal tech side, with a special emphasis on the Indian ecosystem.</p><p>I you google, you are bound to find many existing startups in the legal tech field, however I would still go out on a limb to say that as of 2019 the field is not yet saturated, there is a lot of scope to gain a monopoly or capture the market in both the b2b and b2c market.</p><p>The legal tech field is mainly divided in the following categories:-</p><ul><li>Marketplace</li><li>Document Automation</li><li>Practice Management</li><li>Legal Research</li><li>Legal Education</li><li>Analytics</li></ul><p>I will go through each of the categories in detail and provide examples of some of the best startups working in that particular field along with their funding and LinkedIn pages wherever possible.</p><h3>Marketplace</h3><p>Startups that help connect the customers with the legal firms or practitioners fall into this category. This is one of the most prominent fields with a lot of small and medium sized startups working towards their individual solutions. The B2C framework helps match the customer with the relevant legal firm.</p><p>Each lawyer needs to make a profile on the website/app and the startups take a percentage of the fee after a customer has successfully purchased the services of the lawyer. Few of the startups in this field use review based systems to help increase the credibility of the lawyer.</p><p>The startups in this category serve to both customers and firms mainly comprising of small businesses and startups.</p><p><a href="https://in.linkedin.com/company/lawrato-com">LawRato</a> : Founded in 2013, the platform helps connect people with lawyers. It recently raised an undisclosed amount in its seed funding led by <a href="https://inc42.com/tag/indian-angel-network/">Indian Angel Network (IAN)</a>.</p><p><a href="https://in.linkedin.com/company/legalraasta">LegalRaasta</a>: Founded in 2015, the startup helps startups and small business owners to solve problems pertaining to legal compliance. The startup raised $1 million in angel funding.</p><p><a href="https://in.linkedin.com/company/vakilsearch-com">VakilSearch</a> : This startup caters to both individuals and businesses for their respective legal requirements. After winning the Ritz Entrepreneurship award in 2015, Vakilsearch has drawn investors’ attention and has raised Rs`16 crore in funding — Rs. 6 crore in February 2015 from <a href="https://tech.economictimes.indiatimes.com/tag/kalaari+capital">Kalaari Capital</a> and Rs.11 crore in March 2016 from Kalaari and Dr Agarwal’s Group.</p><p><a href="https://in.linkedin.com/company/lawyered">Lawyered</a> : Taking an interesting approach to connect people with lawyers ‘relevant’ to their needs, Lawyered was founded in 2015. They provide cost effective, high quality and accessible solutions. The customers also get free proposals and advice for their requirements from various firms and lawyers.</p><h3>Document Automation</h3><p>Few startups are working to automate the tasks that lawyers face on a daily basis: such as document reviewing, updating documents and contracts, and defining templates for various types of contracts etc. Majority of the legal tech solutions focus on this area, primarily in the US where we can find a lot of tech startups using Machine Learning solutions to parse, classify, and review the documents in an autonomous manner.</p><p>This particular category is further divided into two different types of solutions :-</p><blockquote><strong>i) Review process automation</strong> :</blockquote><blockquote>Drafting a document takes several iterations. The document is usually passed between lawyers primarily in two different styles: interchange of documents within a firm and exchange of documents between two opposing firms. Each of the above process requires a candidate to proof read the documents and provide the previous candidate with the changes and fixes.</blockquote><blockquote>This process is time consuming and no system for version control system is popularly used. The lawyers, most of the time, manually go through each point in the document multiple times and use their emailing services,(aren’t we all guilty of using gmail as a version control tool :P), as a method for revision and version control.</blockquote><blockquote>The startups solutions in this field use Natural Language Processing techniques to identify the crucial lines/points that a candidate needs to go through instead of the entire document and use an GUI to present the points in a highlighted manner to the candidate. They also provide a version control system to help the lawyers in easily reverting to previous documents or identifying the changes made in the newer versions. Many startups have gone far enough to provide OCR for scanned documents, converting them into editable files and using document classification methods to provide a standard structure for each type of the document.</blockquote><p>Few of the emerging legal tech startups working on this field are :-</p><p><a href="https://www.linkedin.com/company/lawgeex/?originalSubdomain=in"><strong>Lawgeex</strong></a><strong> : </strong>Lawgeex help legal teams automate the review and approval of day-to-day business contracts. There solutions aim to reduce the legal bottleneck, and help to focus legal’s time on more strategic tasks. Founded in 2014, they have in 2018 raised $12M for its AI-powered contract review technology bringing their total funding to $21.5M .</p><p><a href="https://www.linkedin.com/company/vaultedge/?originalSubdomain=in"><strong>Vaultedge</strong></a><strong> : </strong>An indian startup founded in 2015 has showcased their first version of the contract review automation system. Vaultedge uses artificial intelligence (AI) and machine learning to understand Contracts the way a lawyer does. They claim that by analyzing contracts and highlighting risks they save approximately 70% of time lawyers spend in contract reviews.</p><p>Other startups in this field are Leverton, ThoughtRiver, Lawgeex, Luminance.</p><blockquote><strong>ii) Template customization :</strong></blockquote><blockquote>There are a number of categories in which the legal field documents are classified into. Each type of document corresponds to a different set of rules, compliance and contracts. Recently, a lot of templates for each category are used by the lawyers, making it easier for the lawyers to create the required documents. This save them both time and effort that they would be required to spend otherwise.</blockquote><blockquote>This type of solution can be used not only by lawyers or legal firms but also by individuals who might want to DIY their own contracts. A persona could easily download the required templates such as rent agreements or NDAs etc and fill the relevant information in the documents. A few of the tech startups have worked on questionnaire for each type of document which would make it easier for an individual to fill out a form. Also, chatbots are being used for the Q/A style of template customization.</blockquote><p>Emerging startups in this field are :</p><p><a href="https://tryprose.com/"><strong>Prose </strong></a><strong>: </strong>It is an advanced LawTech software that lets the user create legal documents by providing drafts and templates for user’s specific needs.</p><p><a href="https://www.linkedin.com/company/rocket-lawyer-inc/"><strong>Rocket Lawyer</strong></a><strong> :</strong> Founded in 2008, Rocket lawyer has been in the market long enough to diversify their services in many of the categories. In addition to providing legal templates to practitioners and other businesses, Rocket Lawyer also provides legal help and connects people to lawyers. They also provide cloud infrastructure to securely store or access legal documents.</p><h4>Practice Management</h4><p>There are relatively fewer startups working in the field of practice management. The main innovation areas is allowing the lawyers the flexibility to work from anywhere and anytime. Solutions provided by the startups focus on capturing time of calls with clients, time spent on input, edit, approve or delete of records etc. The lawyer can choose their fee per activity, generate invoice automatically and securely send it to the client online. Apart from the above focus areas, there are multiple additional features such as full case life cycle support, easy integrations for existing enterprise solutions and automatic conflict of interest check.</p><p>Portempus, Lex24, Thread.legal, Signatu are few of the startups working on a a few interesting solutions pertaining to this category.</p><p><a href="https://www.linkedin.com/company/lex247/https://www.linkedin.com/company/lex247/"><strong>Lex24 </strong></a><strong>: </strong>Lex24 claims to be the modern platform to effectively manage and grow legal practice. The startup allows you to create invoices, track the billable time for each case, and effectively on board new clients.</p><h4>Legal Research</h4><p>Research in legal field is one of the most time/effort intensive tasks. If you go to any lawyers office, especially in India, you would be surprised just by the sheer volume of books that they possess. Along with the bare acts, the lawyers, in order to keep themselves updated, subscribe to numerous magazines, supreme court judgements and case summaries. Law firms have their own in house collection of database, which is updated weekly/monthly. Apart from the books, which are dominantly used for references, the modern day lawyer has to subscribe to blogs, and newsletters to keep himself on toes with regards to latest amendments and judgements.</p><p>The average time a lawyer takes for the research on his case can vary from 10 days to 30 days, depending on the experience, type of case and the jurisdiction it corresponds to. In order to reduce the research time, many of the startups are working on solutions to increase the relevancy of the data that is presented to a lawyer given a particular case. Using AI based technologies, and leveraging the state-of-the-art machine learning models, a lot of online databases are dominant in the market. The emerging startups tend to focus on intuitive search query methods, increasing relevancy of context based searching, automated summaries of legal cases and optimizing the cost of each of their services.</p><p>In India, quite a few startups have picked up their pace to expand their databases, however, many startups in the US are already raising funds to tailor the search queries according to the practitioners needs. The lag in the Indian ecosystem is partially because of the lack of digital copies in the Indian courts. Indian legal system has yet to advance to a digital age which would in turn help the users utilize the advancements achieved in the technology sector.</p><p><strong>Manupatra: </strong>One of the biggest sharks in the indian legal system, Manupatra started its operations in 2000, and launched its flagship product, the online database <a href="http://www.manupatra.com/">www.manupatra.com</a> in August 2001. Manupatra has one of the largest online databases and affordable subscription fees.</p><p><a href="https://www.linkedin.com/company/supreme-court-cases-online/"><strong>SCC Online</strong></a><strong> : </strong>SCC stands for supreme court cases. SCC online is another shark which caters to a greater market than manupatra, mainly due to their very low subscription fees. The company not only provides online legal research tools but also provides summaries and short descriptions for all supreme court cases. SCC Online also has a subscription based model for magazines, digests and books accounting for weekly,monthly and yearly cases. The platform is used by student, practitioners, law firms and research organizations.</p><p><strong>ROSSIntelligence :</strong> Founded in 2014, ROSSIntelligence aims to bring cutting edge AI technology solutions to the real world. They have recently raised Series A funding of about $8 millions, bringing their total funding to $13+ millions. ROSSIntelligence aims to develop a research tool which will show results to the user based on the question posed in the form of a query. ROSS, their first product, is a digital attorney which understands natural language legal questions and aims to provide relevant answers instantaneously.</p><h4>Legal Education</h4><p>Due to the nature of the studies in the legal field, there is yet to see any breakthrough in this category. Using video lectures, tutorials and interactive video sessions is something which not only startups or coaching centers but also universities are trying adopt.</p><p>However, there is definitely an increase in the number of case competitions or mock trial competitions held by a third party in a university. These third party companies come up with a lot of interesting events and competitions which provides students with a really fun and interactive learning opportunity.</p><p><a href="http://lawsikho.com/"><strong>Lawsikho</strong></a><strong> (HQ Delhi) : </strong>An online platform for legal tutorials on everyday legal issues faced by common people. It uses technology to provide access to legal knowledge and connect with the lawyers.</p><p><strong>Quimbee : </strong>Started in 2007 by Matt Sellers, Quimbee is now the best learning platforms with users ranging to tens of thousands. Definitely a veteran company in the field of legal education, Quimbee provides a full suite of services at very affordable prices. Their contents are produced by professional legal writers, and they also have the e-learning platform on iOS and android devices.</p><h4>Analytics</h4><p>An emerging field in the legal tech industry is Legal Analytics. Legal analytics is the discovery, interpretation or communication of valuable and actionable insights in legal data. The primary focus area of the startups in legal analytics field are :</p><blockquote><strong><em>1. Insights on litigation :</em></strong> Data on past cases of the opposing counsel, parties, judges and other participants in litigation so practitioners can develop more effective case strategies and predict potential outcomes. This helps the practitioners to make better decisions such as analysis on whether or not to settle a dispute, and if so, when. Analytics can also help practitioners determine the specific strengths and weakness of opposing counsel and opposing parties, and review their behaviors and outcomes in similar cases.</blockquote><blockquote><strong><em>2. Insights on transaction :</em></strong> This data is especially helpful for practitioners in mergers and acquisitions. Lawyers using analytics can review similar deals and agreements and strengthen their negotiating position in transactions by bench marking from the past cases. They can also run transaction searches for insight on current market practice and deal precedents that cover the complete spectrum of transaction-related topics, including capital markets and corporate governance, corporate and M&amp;A, and employee benefits and executive compensation. Analytics can help identify pending legislative action that may impact the target of acquisition.</blockquote><blockquote><strong><em>3. Regulatory analytics: </em></strong>It helps legal professionals track rapidly changing regulatory developments, make data-based determinations about compliance risk and predict whether specific legislation will pass.</blockquote><p>In India not many startups are currently working in this sector which is mainly due to the lack of a proper digital infrastructure to carry out the analysis. However, one such startup in Canada, <em>“Loom Analytics”</em> is steadily becoming one of the prominent player in the sector of legal analytics.</p><p><strong>Loom Analytics :</strong> <a href="https://ca.linkedin.com/in/monadatt">Mona Datt</a>, 38, is the co-founder and president at Loom Analytics, which launched in June, 2016. Loom Analytics aims to organize the level of access of the huge amount of legal data that makes it possible to get a big picture and bird’s eye view of a particular area of law.</p><p>Apart from the above categories, there are a lot of other problems that companies are trying to solve. The field is filled with a lot of startups, however, very few of them are able to survive past the 3 year and the 5 year benchmarks. This observation could be correlated to the mix of legal and tech expertise required for a successful solution in this field and to be honest you will not be able to find any more diametrically opposite fields.</p><p>I hope this article has helped the reader to get a better understanding of the legal tech field. In case of any questions, please feel free to reach out or comment below :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1132ed3f2848" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Survival Of The Fittest — Plants vs Humans]]></title>
            <link>https://medium.com/@piyush1995bhandari/survival-of-the-fittest-plants-vs-humans-7ceb8763faca?source=rss-b6647c860d03------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ceb8763faca</guid>
            <category><![CDATA[evolutionary-psychology]]></category>
            <category><![CDATA[science]]></category>
            <category><![CDATA[evolutionary-biology]]></category>
            <category><![CDATA[evolution]]></category>
            <category><![CDATA[darwin]]></category>
            <dc:creator><![CDATA[P-Bhandari]]></dc:creator>
            <pubDate>Mon, 17 Dec 2018 07:58:42 GMT</pubDate>
            <atom:updated>2020-03-10T09:53:07.431Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rM3xeyu1M5bk7N_Y1phRjQ.jpeg" /><figcaption>Stages of evolution</figcaption></figure><h3>Survival Of The Fittest — Plants vs Humans</h3><blockquote>In this post I will try to explain my own take on evolution and how I arrived at the conclusion that ‘plant kingdom’ is on the winning side of evolution.</blockquote><p>The concept of evolution was brought to light in mid-19th century. Charles Darwin, also known as the father of evolution, wrote, in great detail, on evolution and natural selection in his book “<em>On The Origin Of Species</em>”. Because of Darwin’s contributions, evolution is now accepted as a fact rather than just a theory.</p><p>Natural selection, the key mechanism for evolution, is something that has always peeked my curiousness. However, many people are unable to fathom the way natural selection works. It is not easy to imagine the vastness of the selection’s effect, the time period over it occurs also makes it difficult to imagine its extent. Therefore, before I delve into the second part of the post let me give you a fair idea of the time scale on which evolution works.</p><p>Earth is approximately 4.5 billion years old and the first cell was formed approximately 2 billion years ago. Natural selection has apparently been<br>working for 2 billion years, and it was not until after 1.7 billion years that the dinosaur came into being. So, it took approximately 1.7 billion years to reach the Mesozoic era. The dinosaurs lived during the Mesozoic era which spans from about 252 million years ago to about 66 million years ago. The dinosaurs themselves lived for about 190 million years. Many people disregard evolution just because they are unable to see drastically different attributes among humans. They claim that if there were a tail, then at least at the moment some people should possess it. Humans, whose life span is approximately less than 100 years, can hardly complain about the lack of their observable data on natural selection. The distinguishable features in the life form can only be observed when taking into consideration hundreds of thousands of years if not more.</p><p><strong>Forced selection</strong>, another form of selection that happens in much less of a time span when compared to natural selection, occurs when a particular species is forced to evolve/perish because of its external and environmental factors. Humans have long been the cause of forced selection for a number of species. The extinction of life forms that are not preferred/useful to humans and the excess of species that are more line with the human needs are few of the outcomes of forced selection. Even the species that haven’t been adversely affected by human’s forced selection often suffer from other trait alternations. Friendly dogs are preferred compared to wild ones, hence inhibiting the gene trait of the wild ones. Edible fishes, birds and crops flourish in the nature while their counterparts suffer from extinction. The extent of the forced selection is so drastic that estimated 10,000 species of life form are becoming extinct each year. Only in recent centuries have we began to notice and raise awareness against the effects of such forced selection.</p><p>Forced selection is merely a small event when compared to the vastness and the extent of natural selection. Natural selection occurs at a larger scale, with much larger time frame compared to forced selection, and is therefore much more difficult to observe within the short life span of human life.</p><p>It is undeniable that dinosaurs were a powerful creatures, one of the evolution’s greatest outputs. We now refer to them as a failed prototype of the test “Survival Of The Fittest”. The Mesozoic era is also merely an iteration in the whole game. The stronger the prototype the better the chances of its survival. In this test or game of survival, many different genes and DNAs compete with each other and the environment to pass on their genes to the next generations. Reproduction and evolution seem to be the sole purpose of life. Through the numerous years, we have been passing an improving the genetic traits for the seemingly never ending test.</p><p>Of all the traits passed on one trait that hugely differentiates the animal to the plant kingdom is the human brain(neurons). The ability to think or <strong><em>consciousness </em></strong>is an ambiguous genetic trait that has long been passed on to the animal kingdom. Also it is important to point out that there are several other lifeforms that lie between the two in the level of consciousness the animals and plants possess. Therefore, it can be said that each of species is competing in the game of survival with consciousness being one of the factors that distinguishes each of them.</p><p>Humans pride themselves on their intelligence and they believe themselves to be the best among all of the species. They impose their beliefs to their surroundings, often dislodging other species to their own benefits. But let’s step back for a second and analyze the whole scenario. We know that dinosaurs were also the dominant specifies 100 million years ago, they also possessed some level of consciousness that has been passed upon. But the plant kingdom around that time also existed and has been passing on their genes that are devoid of conscious control to the next generations. If this really is a game of survival the plants are also doing a really good job to continue their proliferation without much consciousness. One would rather extrapolate and say they are doing a much better job in this game of survival since they do not indulge in many self destructive habits that us conscious people involve in. Humans have long considered themselves to be superior because of the conscious control and intelligence they possess, but does the game of evolution requires such level of consciousness ? It could be possible that it is much better not have that amount of conscious control, dinosaurs might vouch for that since their particular traits and genes have almost been discarded by evolution.</p><p>It is understandable that one might say that what is the fun in having no conscious control, it is rather boring to just sit at one place and perform the same photosynthesis process every morning. Fun-passion-emotions-love is something that every human strives for, maybe our gene structure has been hard coded this way. But what if it is much better not have such emotions, what if it is much better to have a disciplined and non-destructive lifestyle, what if the way plants live is much more aligned towards what evolution has planned. The myth of passion is something that been discussed upon by many great philosophers. There are many studies that indicate that passion is not important to achieve greatness rather discipline is something that the top performers embrace.</p><blockquote>“Only after truly embracing discipline can one achieve greatness”.</blockquote><p>The above quote corresponds to a very important trait. A trait that has been mastered by the plant kingdom. The disciplined way of life is a hard coded genetic trait that each of the members of the plant kingdom possess. Their way of life is something that greatly distinguishes them to the animal kingdom. And maybe, there is a teeny tiny possibility that the plants, via their disciplined and boring lifestyle, will be able to pass on their genes and survive eternally.</p><p>It is quite interesting and counter intuitive when one starts to ponder upon this topic. However, it is important for humans to respect their surroundings and learn from it instead of exploiting the other forms of life. I would like to end by saying that I pretty much have taken a big leap from natural selection to plants actually winning the game of the survival, but this is something that I have been wondering upon for long. I welcome all kinds of arguments on the above topic, and in case you have some interesting insights, do write it up and share. Happy reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ceb8763faca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Augmented Reality: Google’s ARCore Sample App Tutorial]]></title>
            <link>https://medium.com/coinmonks/arcore-tutorial-21d67fce04dd?source=rss-b6647c860d03------2</link>
            <guid isPermaLink="false">https://medium.com/p/21d67fce04dd</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[arcore]]></category>
            <category><![CDATA[virtual-reality]]></category>
            <category><![CDATA[augmented-reality]]></category>
            <category><![CDATA[ar-tutorial]]></category>
            <dc:creator><![CDATA[P-Bhandari]]></dc:creator>
            <pubDate>Mon, 25 Jun 2018 11:11:46 GMT</pubDate>
            <atom:updated>2022-06-26T11:42:01.267Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*AjZ5OBkuFK4geYO5FnySMA.jpeg" /></figure><p>After working on ARCore, there was no way that I wasn’t going to write about it. It is definitely, hands down, one of the best augmented reality based libraries out there and I definitely recommend you to give it a try.</p><p>In this post, I will be giving an overview of ARCore and explain the functionality of ARCore using the HelloAr example app provided by Google.</p><h3>Overview</h3><p>ARCore is Google’s platform for building augmented reality experiences. It is an alternative to the ArKit, developed by apple, for building applications based on augmented reality on android devices. Using different APIs, ArCore enables the developer to sense its environment, understand the world and interact with information.</p><p>The set of algorithms, exposed APIs, provided by ARCore are the result of the project Tango, which due to a few reasons were unable to see the light of day.</p><p>ARCore uses three key capabilities to integrate virtual content with the real world as seen through your phone’s camera:</p><ul><li><a href="https://developers.google.com/ar/discover/concepts#motion_tracking"><strong>Motion tracking</strong></a> allows the phone to understand and track its position relative to the world.</li><li><a href="https://developers.google.com/ar/discover/concepts#environmental_understanding"><strong>Environmental understanding</strong></a> allows the phone to detect the size and location of all type of surfaces: horizontal, vertical and angled surfaces like the ground, a coffee table or walls.</li><li><a href="https://developers.google.com/ar/discover/concepts#light_estimation"><strong>Light estimation</strong></a> allows the phone to estimate the environment’s current lighting conditions</li></ul><p>Hope you get the general idea of ARCore. In order to better understand the platform let dive into the HelloAR sample app. I will be using the unity framework for explaining the app, however the knowledge can be extended to all the other frameworks.</p><h3>Tutorial</h3><p>The HelloAR core app utilizes a bunch of classes which are very well documented in <a href="https://developers.google.com/ar/reference/">this</a> link.</p><p>In the beginning the app launches an instance named as Session. GoogleARCore.Session is the class which handles the app to ARCore service communication. Each session is started at the launching of the app and the “SessionStatus” is used to determine the tracking state of the app.</p><p>The session will be in the tracking state unless and until it is able to find a plane from the points that it has detected. The planes detected by the session are accessed by</p><pre>Session.GetTrackables&lt;DetectedPlane&gt;(temp); </pre><p>The variable temp will hold all the detected planes that the session was able to find.</p><p>Now instead of using the Physics.Raycast, the ray casting approach provided by the Unity framework, googleARCore uses it own raycast implementation which can be accessed by :-</p><pre>Frame.Raycast(<br>  float x,<br>  float y,<br>  <a href="https://developers.google.com/ar/reference/unity/namespace/GoogleARCore.html#namespaceGoogleARCore_1a8da5a2395bdef6ffe411700df5a713ff"><strong>TrackableHitFlags</strong></a> filter,<br>  out <a href="https://developers.google.com/ar/reference/unity/struct/GoogleARCore/TrackableHit.html#structGoogleARCore_1_1TrackableHit"><strong>TrackableHit</strong></a> hitResult<br>)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*EWXE5t3eo7ai0JcJi45JSw.jpeg" /><figcaption>User touch for RayCast</figcaption></figure><p>This particular function sends the ray from a point, specified by the parameters x, y, and dumps the number of objects, rigid objects with mesh filters, the ray hits on its path, in the real world scenario, on the out Trackable Hit.</p><p>The above API is used when the user gesture selects the location in the real world by tapping on the screen. The ray cast is then sent in the direction of the touch point of the user and only when the raycast gives a detected plane on the hitResult, the virtual object is placed on that plane. The code for same is stated below :-</p><blockquote>TrackableHit hit; <br>TrackableHitFlags raycastFilter= TrackableHitFlags.PlaneWithinPolygon | TrackableHitFlags.FeaturePointWithSurfaceNormal;</blockquote><blockquote>if (Frame.Raycast(touch.position.x, touch.position.y, raycastFilter, out hit)) <br>{ <br> // Check if the out hit is a detected plane <br> if ((hit.Trackable is DetectedPlane))<br> {<br> //Add the virtual object <br> }</blockquote><blockquote>}</blockquote><p>In order to add the object to the virtual space, you need the position and rotation of the object in the real world. The position can be easily obtained using the point of incidence of the ray onto the detected plane.</p><pre>hit.Pose.position ; //Position of the incidence </pre><p>In order to set the rotation, you will need to do some tweaking on your own, which would majorly depend on the output desired. However, you can get access to the rotation of the camera, rotation of the incident plane, normal of the plane etc. You can use these rotations as reference and then rotate the object accordingly.</p><pre>hit.Pose.rotation; //Rotation of the incidence of the ray to plane</pre><pre>//rotation of the plane on to which the ray cast hits.((DetectedPlane)hit.Trackable).CenterPose.rotation ; </pre><p>The rotation is provided in quaternion instead of euler angles, though you can convert them into each other using the following APIs.</p><pre>//For euler to quaternion<br>Quaternion.Euler(x, y,z ); // where x,y,z are euler angles</pre><pre>//For getting euler angles from the quaternion variable<br>Quaternion q ; <br>q.eulerAngles.x ; //get x rotation <br>q.eulerAngles.y ; //get y rotation<br>q.eulerAngles.z ; //get z rotation</pre><p>Now once you have Instantiated/created the virtual object in the AR space, you will need to make sure that even when you move, the object stays in the same position relative to the plane on to which it was created. Also, it is important to maintain the previous data as the understanding of the space evolves. Using anchors, googleArCore is able to tackle the problem effectively. Anchors are used to create a link between the virtual object and the detected plane. There whenever the plane is displayed in the real world space, the object will always come associated with it.</p><pre>var anchor = hit.Trackable.CreateAnchor(hit.Pose);                     // Make Andy model a child of the anchor.                    andyObject.transform.parent = anchor.transform;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xdFgbzI8Ybent6VmdCMfNA.png" /></figure><p>These are the major APIs that are used in the HelloAR sample app provided by googleArCore. In order to better understand each API and class you can read the detailed documentation <a href="https://developers.google.com/ar/reference/unity/"><strong><em>here</em></strong></a>. Also, make sure that you have a phone that supports ARCore before you start developing, you can find the list of the supported phones <a href="https://developers.google.com/ar/discover/supported-devices"><strong><em>here</em></strong></a>.</p><h3>Drawbacks</h3><p>The only drawback that I faced whilst working with ARCore was the inability to change or tweak the parameters of the algorithms used in the feature tracking and plane detection. The algorithms used by the exposed APIs are not documented anywhere and also the developer is unable to tweak the parameters as to his or her own problem. For example, the feature point detection, surface detection, light estimation are the different functionalities which can be used but cannot be tuned by the developer. However, the execution and working of the APIs are in itself quite powerful and tend to work well in many different scenarios.</p><p>In case you have any doubts regarding my post or ARCore in general, please do comment on the section below. I will try to help you as much as I can. Have fun developing :).</p><blockquote>Join Coinmonks<a href="https://t.me/coincodecap"> Telegram Channel</a> and<a href="https://www.youtube.com/c/coinmonks/videos"> Youtube Channel</a> get daily <a href="http://coincodecap.com/">Crypto News</a></blockquote><h4>Also, Read</h4><ul><li><a href="https://medium.com/coinmonks/top-10-crypto-copy-trading-platforms-for-beginners-d0c37c7d698c">Copy Trading</a> | <a href="https://medium.com/coinmonks/crypto-tax-software-ed4b4810e338">Crypto Tax Software</a></li><li><a href="https://coincodecap.com/grid-trading">Grid Trading</a> | <a href="https://medium.com/coinmonks/the-best-cryptocurrency-hardware-wallets-of-2020-e28b1c124069">Crypto Hardware Wallet</a></li><li><a href="http://Top 4 Telegram Channels for Crypto Traders">Crypto Telegram Signals</a> | <a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a">Crypto Trading Bot</a></li><li><a href="https://medium.com/coinmonks/crypto-exchange-dd2f9d6f3769">Best Crypto Exchange</a> | <a href="https://medium.com/coinmonks/bitcoin-exchange-in-india-7f1fe79715c9">Best Crypto Exchange in India</a></li><li><a href="https://medium.com/coinmonks/best-crypto-apis-for-developers-5efe3a597a9f">Best Crypto APIs</a> for Developers</li><li>Best <a href="https://medium.com/coinmonks/top-5-crypto-lending-platforms-in-2020-that-you-need-to-know-a1b675cec3fa">Crypto Lending Platform</a></li><li>An ultimate guide to <a href="https://medium.com/coinmonks/leveraged-token-3f5257808b22">Leveraged Token</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21d67fce04dd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/arcore-tutorial-21d67fce04dd">Augmented Reality: Google’s ARCore Sample App Tutorial</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Depth Estimation Techniques]]></title>
            <link>https://medium.com/@piyush1995bhandari/depth-estimation-techniques-830ffd297245?source=rss-b6647c860d03------2</link>
            <guid isPermaLink="false">https://medium.com/p/830ffd297245</guid>
            <category><![CDATA[depth-map]]></category>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[opencv]]></category>
            <category><![CDATA[stereo-vision]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[P-Bhandari]]></dc:creator>
            <pubDate>Sun, 27 May 2018 13:32:54 GMT</pubDate>
            <atom:updated>2018-05-27T13:32:54.584Z</atom:updated>
            <content:encoded><![CDATA[<p>Want to estimate the depth information of the images real-time? Stuck on which algorithm to choose ? You might wanna start looking at the hardware requirements first?</p><p>Wikipedia didn’t help, did it. Are you pulling out your hair by now ?..In this post I will try to explain the methods that can be used for estimating distance of objects from the camera. I will describe the popular methods and give a comparison in the various complexities and accuracies of these methods.</p><blockquote>TL;DR at the bottom of the page.</blockquote><p>Depth information nowadays is used by almost every vision algorithm. Why wouldn’t one use it ! Almost all the state of the art algorithms use some kind of combination of the data(depth included) and extract as much information as they can from it. RGB-D images are pretty common and, with a boom in the Autonomous Driving technology , a significant boost in noticed in the accuracy of the depth estimation techniques.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*A5pXquq5nm-zvzRJiScSGA.jpeg" /></figure><blockquote>In this post, I will briefly go through the different type of algorithms to use depending on the available hardware. We will be restricting this post on the use of stereo camera as the acquisition device.</blockquote><h4>Calculating Disparity Maps</h4><p>Using the Stereo Images, you can calculate the disparity map by estimating the distance moved by a particular point in the left and right images. An inverse correlation exists between the shift of the point and the distance of the object from the camera, i.e the larger the point’s movement, smaller will be the distance of the object from the camera. Since a stereo camera assumes the <a href="https://en.wikipedia.org/wiki/Epipolar_geometry">epipolar geometry</a>, instead of searching for a point in the whole image, we search for a particular point only along the horizontal-x axis of the stereo images. In simpler words, all we have to do is to find the correspondence of a point, in the left image, to its position in the right image along the same x axis,usually with an offset and range. This drastically reduces the space complexity of our algorithm and reduces the multi dimensional problem to a single dimension.</p><p>Even though the problem of finding correspondences in the two images sound easy, it is quite difficult to find the correspondence of “all” the points even when they lie in the same y axis. Not all the points in an image are easily distinguishable and even if they are, the size of image varies anywhere from 100x100 to 640x480 and above. Finding the correspondences of all the 3x 10⁵ points can pose some computation problems.</p><p>Despite the challenging computation problems, there are 3 types algorithms that are most widely used: —</p><h4>Local Methods</h4><p>These methods are one of the simplest approaches to stereo matching. They also go by a reasonable assumption that corresponding pixels in left and right images have similar colors, which is known as the photo consistency assumption.</p><p>The local methods search for a point by exploiting the surroundings of a point, usually done via a block (5x5, 7x7). The whole block is matched with similar sized blocks on the horizontal axis of the second image and the block with the greatest similarity provides us with the point’s location in the two images. The algorithm is simple with the approximate time complexity of O(N*W), where N corresponds to the number of points to be search and W is the number of pixels in the window. Usually a lot of optimization and color correlation functions are used for matching the windows. Some of the popular function for matching are :- Hamming’s Distance, computation on Census Transformed images, weights windows, adaptive weighted windows. One of the methods with low computation time and higher accuracy is the<a href="https://ieeexplore.ieee.org/document/7225748/"> Multi-Block matching.</a></p><blockquote>Simple block matching approaches are easy to implement on both processors and FPGAs, have low computational time( compared to global methods) but are relatively less accurate. These methods are very popular and a lot of research papers are available which use variations of the local methods.</blockquote><p>Despite of the high research attention that local methods have gained over the last couple of years, they do not render global approaches useless. The problem is that even large support windows are not sufficient for handling highly ambiguous data, that is, very un-textured image regions.</p><h4>Global methods</h4><p>Global methods differ from local ones in that they express the smoothness assumption in an explicit form via a so-called smoothness term. These methods involve an energy function E(D) that measures the quality of the disparity map D. Later, the energy function is optimized to find the disparity map with the lowest energy and of the highest quality. The optimization of the energy function can be done via several ways — dynamic programming, graph cuts, message passing etc. The algorithms in itself have high complexity due to the high dimensional variable incorporated in the energy function, since each pixel disparity value is a variable. However, the performance of these methods are usually the best. The peak of the performance comes with a lot of time complexity overhead. It is quite difficult to implement these methods on hardware due to its high memory footprint. The best methods of global matching are approximately 100 times slower than those of local matching. However, there are quite a few hardware implements of the global methods that try to manage the memory problem by using extra memory optimization and hardware.</p><h4>Semi- global methods</h4><p>Semi-Global Matching <a href="http://www.ifp.uni-stuttgart.de/publications/phowo11/180Hirschmueller.pdf">(Hirschmüller, 2005 and 2008)</a> successfully combines concepts of global and local stereo methods for accurate, pixel-wise matching at low runtime. The method reduces the multi dimension approach to one dimension. This reduces the computational complexity of the global methods with path wise optimization many folds while retaining the accuracy of the global methods. In order to better understand the optimization I suggest you read the presentation by <a href="http://www.ifp.uni-stuttgart.de/phowo/2011/presentations/180Hirschmueller.pdf"><em>Dr. Hirschmüller</em></a><em>.</em></p><p>Semi-global matching is one of the best approaches available for hardware implementations, I suggest you use this method due to its low complexity and high accuracy.</p><h4>TL;DR</h4><p>To summarize the three methods —</p><ul><li><strong><em>Local methods</em></strong> — simple block matching approach, easy to impliment on both processors and FPGAs, low computational time( compared to global methods) but relatively less accurate.</li><li><strong><em>Global methods</em></strong> — energy based optimization method, uses an energy function and optimizes it using dynamic programming or some other approach. Highly accurate but computational time is higher than local methods. Difficult to implement on hardware though there are some papers that provide some solutions.</li><li><strong><em>Semi- global methods</em></strong> — this is one of the latest benchmark methods with accurate depth maps and low computational time . Uses one dimensional optimization approach. There have been some papers regarding its implementation on FPGA, I would suggest you to use this method because of its low complexity and high accuracy.</li></ul><blockquote>Comparisons based on <strong>time complexity </strong>:-</blockquote><blockquote><strong>Local &lt; Semi-Global &lt; Global</strong></blockquote><blockquote>Comparisons based on <strong>accuracy</strong> of the method:-</blockquote><blockquote><strong>Local &lt; Semi-Global == Global</strong></blockquote><p>Hopefully now you can start building your depth estimation algorithm. In case you need any help regarding any of these methods a quite a few open source github codes are available. Even Opencv provides APIs for the semi global matching approach.</p><p><a href="https://docs.opencv.org/java/2.4.9/org/opencv/calib3d/StereoSGBM.html">StereoSGBM</a></p><p>To view the benchmarks for the popular Middlebury dataset —</p><p><a href="http://vision.middlebury.edu/stereo/eval3/">vision.middlebury.edu/stereo/eval3</a></p><p>For a little enhanced local method estimation techniques you can check out my work on <a href="https://github.com/P-bhandari/stereo_matching"><strong><em>github</em></strong></a>. The paper is yet to be accepted, I will definitely post the link after acceptance.</p><p>In case you come across any problem or an interesting , do write it up, share or comment on the post. Happy coding:)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=830ffd297245" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Thorny Meditation Experience]]></title>
            <link>https://medium.com/@piyush1995bhandari/my-thorny-meditation-experience-39d7a7006b1f?source=rss-b6647c860d03------2</link>
            <guid isPermaLink="false">https://medium.com/p/39d7a7006b1f</guid>
            <category><![CDATA[mind]]></category>
            <category><![CDATA[meditation]]></category>
            <category><![CDATA[experience]]></category>
            <category><![CDATA[mindfulness]]></category>
            <category><![CDATA[peace]]></category>
            <dc:creator><![CDATA[P-Bhandari]]></dc:creator>
            <pubDate>Tue, 10 Apr 2018 04:17:43 GMT</pubDate>
            <atom:updated>2018-04-15T06:49:17.146Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever tried removing something obscure and tiny, something that has been bugging you for quite sometime, only to find out that no matter what you try, it is still present there. More like a tiny thorn like structure stuck in your arm, tiny enough to not bother you unless you directly look at it. Your mind constantly bugging you to get that thing out of your arm. In your mind you comprehend that pulling it out would be easy but the size is so small that no matter what you try, you just cannot get a hold of it. This sensation, right there, is exactly what I felt when I was trying to meditate recently.</p><p><strong>In the following post I will be going into the details of one of my best meditation experience.</strong></p><p>It wasn’t my first time to meditation nor will it be my last, but the experience was like never before. I have had my fair share of meditation practice — I started meditating with my mother when I was 16 year old. At that time I thought that deep breaths and a clam mind is all that there is to meditation, I would try to constantly remind myself to keep taking deep breaths and retain a calm mind, little did I know that by constantly reminding myself I was bound to end up with the exact opposite of a calm mind. Continuing with my poor meditation practice I never achieved the proper calmness that my mother used to emphasize upon, never — up until one morning.</p><h3>The profound experience</h3><p>I got up quite early around 5:30 am and found my mom in her meditating posture. I sat beside her crossed my legs and began to meditate. However, this time it was different, this time I felt no compulsion to forcefully keep a clam mind, instead, I would continue on to have one of the best meditation routines of my life. A few seconds after I maintained my posture, I felt a little but noticeable tension all over my head and body. The tension was subtle and I hardly ever noticed it before. Only after focusing all my attention to it, I found that it is spread out all over my body, especially in my forehead area. I went on to parse all the sensations inside of me and explored the tension to its roots. I tracked down the tension, which was situated somewhere near my forehead and I focused on it extensively. Suddenly, as if working as a switch, the tension disappeared and I went into a tranquil emptiness. I felt so relaxed, as if floating in a zero gravity. I found myself dissolving into the vast universe and become a part of something serene. The feeling is something that I will not forget during my lifetime, little did I know that I will have a hard time achieving it in my later years. The tranquil feeling lasted for quite sometime, and I tried to consciously guide myself into the even tempered, newly discovered arena. Conscious to the serenity, I was unable to maintain it and I quietly opened my eyes. The experience was new and I felt so peaceful and calm that I sat still, with a satisfied smirk, long enough for my mom to inquire about my expression. I explained her everything in as much detail as I could have, I saw her smiling and telling me that the calmness I experienced is one of the goals of meditation. Even after the meditation there was a peaceful satisfaction that accompanied me in whatever activity I performed. I was honestly quite amazed with the experience and had a new found respect for meditation and its practices. Later, I would go on to read about the various aspects of meditation, monks, Buddhism and even astral planes, trying to find an explanation or documentation of the phenomenon I experienced. To be honest, I did relate to a lot of the phenomenons I found online but they were not enough to complete the piece of the puzzle. I obviously did try meditation after this many times again. Even though I did enjoy my meditation practices , never again was I able achieve the previous levels of serenity . After my high school I rarely continued my meditation practices and I would go on to forget about it as my college started.</p><h3>Returning To Meditation</h3><p>Recently, while laying in bed one night, the thought of “the” meditation came to my mind and I promised to give it a shot one day. Procrastinating to almost a week afterwards, I finally sat down one morning to meditate. Positioned myself on the yoga mat and crossed my legs while slowing closing my eyes. Surprisingly I was again able to find a subtle emotion lying deep inside my head. It went from subtle to significant as I went on deeper and found that the tension was much larger in intensity compared to the tension I experienced previously. It felt as if I had grown up a lot and with a lot of new changes the tension inside my muscles has also escalated. I tried to focus on it as much as I could but wasn’t able to release the tension. It felt like a thorn like structure, as described in the first paragraph, that must be removed but is somehow stuck. I was even able to extrapolate the feeling that I would experience once this thorn was taken out, I was so close the removing it, the thorn was almost in my grasp, just at the tipping point, using all my focus on the tension, trying to remove it, but I could not . Even with all my might, I could not. I just couldn’t bring myself remove the tension. I scratched my forehead with my nails, which actually felt kind of nice, maybe because it was a different feeling. I went again for round 2, determined to bring out the thorn from my flesh. It almost felt like the tip of the thorn was rooted quite deep, like a big ice berg whose tip is visible with the major part of the body concealed. I was almost certain of the satisfaction that would come only if I could remove the thorn, inch by inch, remove it from the tip to its tail. Alas, after a few minutes I did give up — few minutes actually feel quite long when meditating, but more on the general relativity later. Even though the meditation wasn’t as fruitful as it would seem, I at least got to know about the huge amount of concealed tension residing in my muscles and mind. Though not as profound as my first time, this meditation did encourage me to accommodate meditation into my schedule. I really think that everyone should give meditation atleast a shot, it is more like discovering the subtle details that are in our body but are suppressed by the over powering sensations and experiences of our day to day life.</p><p>In case you have an interesting or similar story about your meditation experience, do write it up and share. Happy meditating :)</p><p>P.S :- I’m not giving up this easily, will definitely pull the thorn out and enter the bliss realm.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39d7a7006b1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Loading Shared Libraries During Runtime]]></title>
            <link>https://medium.com/@piyush1995bhandari/loading-shared-libraries-during-run-time-9970b6aaef77?source=rss-b6647c860d03------2</link>
            <guid isPermaLink="false">https://medium.com/p/9970b6aaef77</guid>
            <category><![CDATA[libraries]]></category>
            <category><![CDATA[dynamically]]></category>
            <category><![CDATA[runtime]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[shared-libraries]]></category>
            <dc:creator><![CDATA[P-Bhandari]]></dc:creator>
            <pubDate>Fri, 06 Apr 2018 04:53:27 GMT</pubDate>
            <atom:updated>2018-04-06T04:53:49.540Z</atom:updated>
            <content:encoded><![CDATA[<p>After almost starting to shred my hair one by one , I was able to figure out a proper way for loading my .so during run time.</p><p>Using &lt;dlfcn.h&gt; we can easily load the functions and symbols from the library in our c/cpp code.</p><p><a href="http://pubs.opengroup.org/onlinepubs/7908799/xsh/dlfcn.h.html">http://pubs.opengroup.org/onlinepubs/7908799/xsh/dlfcn.h.html</a></p><p>The APIs of the same are pretty straightforward.</p><h3><strong><em>dlopen(char *, int)</em></strong></h3><p>This function is used for reading the shared library, more specifically it creates an executable object from the library.</p><p><a href="https://stackoverflow.com/questions/23654120/usage-of-dlsym-dlopen">Usage of dlsym()/dlopen()</a></p><h3><strong><em>dlsym(void *, const char *)</em></strong></h3><p>This function allows a process to obtain the address of a symbol defined within an object made accessible through a <a href="http://pubs.opengroup.org/onlinepubs/7908799/xsh/dlopen.html"><em>dlopen()</em></a> . It will search for the named symbol in all the objects which are loaded automatically as a result of loading the object referenced by <em>handle.</em></p><p>The part where <em>dlsym </em>searches for the name of the function is really important. If you compile the object using a g++ compiler, you will find that there is an error while loading the symbol. The error will be something in line of :-</p><pre>Error while dynamically loading : Failed to load X. Error = /root/vmware/usr/openv/lib/Y.so: undefined symbol: X</pre><p>In order to make sure that the name of the symbol specified in your cpp file is same as that of the shared library, you can use the following command —</p><pre>nm $SharedObject.so | grep $SymbolName</pre><p>Refrain from use the -c flag while using the above command, since the flag will show the name of the function as seen by the c compiler.</p><p>C++ compiler changes the name of the function, whereas C compiler does not change the name of the function. You can try it yourself by compiling the same library with different compilers. The following is the example of the name of a function named <em>“</em><em>vmcGetDiskChangedInfoStrm ”.</em></p><pre><strong>C++ compiler :-</strong>_Z25vmcGetDiskChangedInfoStrmPvilPKcS1_S1_S1_RSt18basic_stringstreamIcSt11char_traitsIcESaIcEEb</pre><pre><strong>C compiler :-</strong> vmcGetDiskChangedInfoStrm</pre><p>You can bypass this error by using extern “C” {void func()} in your library code. This will compile the particular part of the file using gcc instead of g++ .</p><h3><strong><em>dlclose(void *):-</em></strong></h3><p>If the object referenced by a <em>handle</em> returned from a previous <a href="http://pubs.opengroup.org/onlinepubs/7908799/xsh/dlopen.html"><em>dlopen()</em></a> invocation is no longer needed by the application, we close the handle safely using dlclose.</p><h3>Done with it !</h3><p>If you are able to load your functions and use your shared object dynamically during run time, then congratulations on your feat. In case you come across any problems regarding the same, comment on the section below and I will try to help you out. Hopefully the post has helped you in understanding the concepts of loading shared libraries during run time. Thank you for reading !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9970b6aaef77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building/Cross compiling FFmpeg for android]]></title>
            <link>https://medium.com/@piyush1995bhandari/cross-compiling-ffmpeg-for-android-545a1cfca31e?source=rss-b6647c860d03------2</link>
            <guid isPermaLink="false">https://medium.com/p/545a1cfca31e</guid>
            <category><![CDATA[ffmpeg]]></category>
            <category><![CDATA[shared-libraries]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[build]]></category>
            <category><![CDATA[cross-compile]]></category>
            <dc:creator><![CDATA[P-Bhandari]]></dc:creator>
            <pubDate>Fri, 30 Mar 2018 18:45:31 GMT</pubDate>
            <atom:updated>2018-03-31T08:02:35.865Z</atom:updated>
            <content:encoded><![CDATA[<p>Once again in my journey of exploring android, I came across the hurdle of cross compiling multiple libraries example — live555, ffmpeg, libevent etc. Of all the libraries what stumped me the most was ffmpeg. Despite there being so many details on the ffmpeg builds, I was always struggling, sometimes for hours, to find my way through all the errors. The errors were so subtle and common that it would have been sinful of me not to write about them.</p><p>Most of the problems arise when using the latest ffmpeg build or the latest ndk version. The use of unified headers in ndk 14 and above makes it difficult to use the deprecated ones which give rise to compile errors.</p><p><a href="https://android.googlesource.com/platform/ndk/+/ndk-r15-release/docs/UnifiedHeaders.md">Unified Headers</a></p><p>After spending a fair deal of time with ffmpeg I found that due to some issues in the header files of the ffmpeg and the support of unified libc headers in ndk the configurations proposed by different blogs or tutorials for cross compiling ffmpeg will lead to compile errors. In order to bridge the gap I will write the complete process for successfully cross compiling ffmpeg for android.</p><h3>NDK Toolchains</h3><p>As directed by the link in the previous paragraph, we will need to disable the use of unified headers or in other words make sure to use deprecated headers. In ndk r15 or greater the support of deprecated headers will be removed; if you need to revert to the deprecated headers, make sure you’re working on fixing your build or filing bugs. This can be by passed easily in ndk r14 or less, by passing the arguments<strong> <em>deprecated-headers </em>for the ndk14</strong> or using the <strong>ndk nversion ≤ 13</strong> for making tool-chains.</p><pre>$NDK/build/tools/make_standalone_toolchain.py --deprecated-headers ...</pre><h3>Cross compiling</h3><p>After you have successfully made your toolchains, download the ffmpeg from releases:-</p><p><a href="https://github.com/FFmpeg/FFmpeg/releases">FFmpeg/FFmpeg</a></p><p>You can use any of stable releases with version&lt; 3.4.2 . I personally used 3.0.11 and was able to successfully build the ffmpeg. If you use 3.4 versions then you will definitely come across the following error</p><pre>libavcodec/aaccoder.c: In function &#39;search_for_ms&#39;:<br>libavcodec/aaccoder.c:803:25: error: expected identifier or &#39;(&#39; before numeric constant<br>int B0 = 0, B1 = 0;<br>^<br>libavcodec/aaccoder.c:865:28: error: lvalue required as left operand of assignment<br>B0 += b1+b2;<br>^<br>libavcodec/aaccoder.c:866:25: error: &#39;B1&#39; undeclared (first use in this function)<br>B1 += b3+b4;<br>^<br>libavcodec/aaccoder.c:866:25: note: each undeclared identifier is reported only once for each function it appears in<br>make: *** [libavcodec/aaccoder.o] Error 1<br>make: *** Waiting for unfinished jobs....</pre><p>Now if you still want to use 3.4.x ffmpeg versions you will have to rectify this error. In order to do that you first need to understand the source of the error.</p><p>Basically what happens is <strong>sysroot/usr/include/asm-generic/termbits.h</strong> defines a macro definition of</p><p>#define B0 0000000000</p><p>and FFMPEG uses variables such as</p><pre>is_available_B0 = AVAILABLE(cand_up_right, B0) &amp;&amp;<br>            xb0 &lt; s-&gt;ps.sps-&gt;width &amp;&amp;<br>            PRED_BLOCK_AVAILABLE(B0) &amp;&amp;<br>            !is_diff_mer(s, xB0, yB0, x0, y0);</pre><p>And then replaces them with 0000000000 as</p><pre>is_available_0000000000  = AVAILABLE(cand_up_right, 0000000000 ) &amp;&amp;<br>            x0000000000  &lt; s-&gt;ps.sps-&gt;width &amp;&amp;<br>            PRED_BLOCK_AVAILABLE(0000000000 ) &amp;&amp;<br>            !is_diff_mer(s, x0000000000 , y0000000000 , x0, y0);</pre><p>Which then leads to compile issues.</p><p><strong>Solution :- </strong>Replace B0 with a different variable like b0 in all the files very carefully using source insight or Visual Studio. If you really want to go down this road that you have my respect and if are successful in building ffmpeg please do make sure to comment or write a post on it.</p><p>After all this hassle I hope you would have understood that cross compiling is no easy task especially in this case. Damn you FFMPEG !!</p><h3>Configure</h3><p>Running the configure script will require a few arguments, to be honest more than a few :P . However, you can just copy paste the following command (make sure, to change the path of prefix, cross prefix and sysroot according to your system).</p><pre>./configure \<br>--target-os=linux \<br>--cross-prefix=$NDK/toolchains/$NDK/platforms/android-14/arch-arm//bin/arm-linux-androideabi- \<br>--arch=&quot;$target_arch&quot; \<br>--cpu=armv5te \<br>--enable-runtime-cpudetect \<br>--sysroot=$NDK/toolchain/$target_arc/ \<br>--enable-pic \<br>--enable-libx264 \<br>--enable-libass \<br>--enable-libfreetype \<br>--enable-libfribidi \<br>--enable-fontconfig \<br>--enable-pthreads \<br>--disable-debug \<br>--disable-ffserver \<br>--enable-version3 \<br>--enable-hardcoded-tables \<br>--disable-ffplay \<br>--disable-ffprobe \<br>--enable-gpl \<br>--enable-yasm \<br>--disable-doc \<br>--disable-shared \<br>--enable-static \<br>--prefix=&quot;$installationg_directory&quot; \<br>--extra-cflags=&quot;--O3 -Wall -pipe -std=c99 -ffast-math -fstrict-aliasing -Werror=strict-aliasing -Wno-psabi -Wa,--noexecstack -DANDROID -DNDEBUG-march=armv5te -mtune=arm9tdmi -msoft-float&quot; \<br>--extra-libs=&quot;-lpng -lexpat -lm&quot; \<br>--extra-cxxflags=&quot;$CXX_FLAGS&quot;</pre><p>Make sure your environment variable does not have ldflags = “pie”, unset it if it is present, otherwise there would be build errors with the make command.</p><p>If you have reached this far successfully, give yourself a pat on your shoulder and a clap to this post. We finally move into making the shared objects.</p><pre>make -j2 &amp;&amp; make install</pre><p>If things move smoothly, you will find your *.so files in the folder specified in the prefix directory during the configuration.</p><h3>Done with it!</h3><p>If you survived up to this point — you successfully embedded FFmpeg into your application. You can use these .so files for either making executables or unity or jni sdk.</p><p>In case you faced some different errors or are stuck somewhere, please do reach me out and comments on the section below. I will be there to help you out :).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=545a1cfca31e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>