Farbod pm

import requestsfrom requests.structures import CaseInsensitiveDict
url = “https://map.ir/routes/route/v1/driving/51.421047%2C35.732936%3B51.422185%2C35.731821?alternatives=true&steps=true”
headers = CaseInsensitiveDict()headers[“x-api-key”] = “eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjcyMThjOTliYWM4OWQzNmM4MmQxMzJlNjRjNDE3MWRmNjRjMzJkZjg2OTE5MGE0ZWQyYzU4Njc2M2M1MmI2OTY4ZTcwNDAyM2I1MTQyOWQzIn0.eyJhdWQiOiIxMDgxMCIsImp0aSI6IjcyMThjOTliYWM4OWQzNmM4MmQxMzJlNjRjNDE3MWRmNjRjMzJkZjg2OTE5MGE0ZWQyYzU4Njc2M2M1MmI2OTY4ZTcwNDAyM2I1MTQyOWQzIiwiaWF0IjoxNTk5NzU5NjIwLCJuYmYiOjE1OTk3NTk2MjAsImV4cCI6MTYwMjQ0MTYyMCwic3ViIjoiIiwic2NvcGVzIjpbImJhc2ljIl19.Xzp9yMI5rvT69XHxcEu4w1wqdesAsl01faKxji33XhnUiI-e8AJOQ_8_GzygMXHfZMfrVenNyIiaSMzsdRPN3ug88ogDkVFPx5QLixpQ1Cg0vHPpfaRYaVRpw2vhzIaessR6YS3HGAVyE1IKq3ECgH2a0Q8Lsj-JIggH7r8JHTCIx-WtUMwZKHLlTubiFdxGKsW3VToZj3Y2ldV0s7SlnXtlD6HD1JMui6zuqeRz36qiEIugAQqFL7mxbP-7-n0wuFiuenU5zDJneaSaQ7VJ9c3XUynvrjbtQPl8Aa0shS8YR9XA5aVXwwS0RPIgCbvYoqSCLp44EpA6BvsCRXujdg”

resp = requests.get(url, headers=headers)
print(resp.status_code)

cv2 import error

This error will happen whenever your python OpenCV is not installed. So you just need to install it using “pip” or make CV2 library using cmake and copy that to your python library folders. Pip is a really good tool to install python packages and you can find a very good tutorial here.

To install OpenCV libarary just run the below in cmd or terminal according to your OS.

>> pip install python_opencv

OR

>>python -m pip install python_opencv

To check that the installation was successful go to pythonshell and import it. no Error should be appear just like below.

ربات‌های پرنده شرکت DJI

امروز درباره دنیای ربات‌های پرنده صحبت می‌کنیم. دنیای امروز ما در حال تغییره. هر روزه ربات های زیادی با اهداف مختلف وارد بازار می‌شوند. در صنعت کشاورزی ،صنعت ساختمان ربات های پرنده میخوان خودشون رو جا کنند. برای همینه که ما سعی داریم در اینجا به اونها بپردازیم. در کشور ما،ایران، ربات های پرنده در زمینه فیلم برداری هوایی و امداد و نجات و حتی کشاورزی داره استفاده میشه. استفاده از ربات های سمپاش و صبت اختراع اون در جهان نشونه پیشرفت این ربات در کشور ماست. خب شاید بپرسید که این اطلاعات چه ربطی به شرکت DJI داره. علت این بحث اینه که نیاز استفاده از ربات پرنده در شما ایجاد بشه بعد از اون به سراغ یکی از قوی ترین شرکت های فعال در حوزه ربات های پرنده.

از زمانی که من در زمینه ربات پرنده کار کردم، یعنی چیزی حدود ۶ یا ۷ سال پیش شرکت DJI در زمینه ربات های پرنده بهترین بوده. محصولات این شرکت رو به دو دسته محصولات آماده تجاری که شامل ربات های آماده میشه و محصولات تخصصی که هدفش ساخت ربات های پرنده توسط مهندسین هست دسته بندی کرد. ربات های آماده و هوشمند فانتوم و مویک برای فیلم برداری و نقشه برداری های کوچیک خیلی مناسب هستند. کارباهاشون راحته و به دلیل هوشمندی بالا پرواز کردن با اون ها امنه. نمونه های زیادی از این دو مدل ربات داخل بازار هست که قیمت زیادی دارند، اما به دلیل امنیت بالا خیلی ها تمایل به استفاده ازشون رو دارند.

نوع دیگر ربات ها ربات های پشینهادی شرکت DJI هست که برای هر کاربرد جنس بدنه توان مصرفی موتور هامتفاوته. مثلا برای یک ربات معمولی که بتونه وزن ۱ کیلوگرم رو جابه جا کنه بدنه f450 بهترین گزینه است. این بدنه با ۴ موتور 2212 میتونه علاوه بر وزت ربات یه دوربین یا یه قطعه تا ۱ کیلوگرم رو حمل کنه. برای تفریحات خوبه و حتی برای فیلم برداری. اما خب به دلیل این که هوشمند نیست نیاز به خلبان ماهر داره با یک دوربین خوب و گیمبال مناسب هزینه فیلم برداری تا ۱۰ میلیون میره در صورتی که اگر بخواید از ربات آماده فانتوم استفاده کنین چیزی حدود ۲۰ میلیون باید خرج کنین. البته شاید مدل های دست دوم ربات فانتوم برای شما مقرون به صرفه تر باشه. انتخاب با خود شماست.نمونه های سه موتوره این سری از بدنه با عدد ۳۵۰ و نمونه های شش موتوره اون با سری ۵۵۰ توی بازار شناخته می‌شن.

سری دیگه از ربات های پیشنهادی این شرکت ربات های سری S هستند که ربات S1000 نمونه قدیمی تر اونه و ربات S1200 نمونه جدید تر. این ربات قابلیت این رو داره که چیزی حدود ۱۰ کیلوگرم وزن رو حمل کنه. این پرنده هشت موتوره با موتور های قدرتمندش مخصوص حمل وسایل و تجهیزات بزرگه.

DJI Drones

ربات‌های پرنده شرکت DJI

امروز درباره دنیای ربات‌های پرنده صحبت می‌کنیم. دنیای امروز ما در حال تغییره. هر روزه ربات های زیادی با اهداف مختلف وارد بازار می‌شوند. در صنعت کشاورزی ،صنعت ساختمان ربات های پرنده میخوان خودشون رو جا کنند. برای همینه که ما سعی داریم در اینجا به اونها بپردازیم. در کشور ما،ایران، ربات های پرنده در زمینه فیلم برداری هوایی و امداد و نجات و حتی کشاورزی داره استفاده میشه. استفاده از ربات های سمپاش و صبت اختراع اون در جهان نشونه پیشرفت این ربات در کشور ماست. خب شاید بپرسید که این اطلاعات چه ربطی به شرکت DJI داره. علت این بحث اینه که نیاز استفاده از ربات پرنده در شما ایجاد بشه بعد از اون به سراغ یکی از قوی ترین شرکت های فعال در حوزه ربات های پرنده.

از زمانی که من در زمینه ربات پرنده کار کردم، یعنی چیزی حدود ۶ یا ۷ سال پیش شرکت DJI در زمینه ربات های پرنده بهترین بوده. محصولات این شرکت رو به دو دسته محصولات آماده تجاری که شامل ربات های آماده میشه و محصولات تخصصی که هدفش ساخت ربات های پرنده توسط مهندسین هست دسته بندی کرد. ربات های آماده و هوشمند فانتوم و مویک برای فیلم برداری و نقشه برداری های کوچیک خیلی مناسب هستند. کارباهاشون راحته و به دلیل هوشمندی بالا پرواز کردن با اون ها امنه. نمونه های زیادی از این دو مدل ربات داخل بازار هست که قیمت زیادی دارند، اما به دلیل امنیت بالا خیلی ها تمایل به استفاده ازشون رو دارند.

نوع دیگر ربات ها ربات های پشینهادی شرکت DJI هست که برای هر کاربرد جنس بدنه توان مصرفی موتور هامتفاوته. مثلا برای یک ربات معمولی که بتونه وزن ۱ کیلوگرم رو جابه جا کنه بدنه f450 بهترین گزینه است. این بدنه با ۴ موتور 2212 میتونه علاوه بر وزت ربات یه دوربین یا یه قطعه تا ۱ کیلوگرم رو حمل کنه. برای تفریحات خوبه و حتی برای فیلم برداری. اما خب به دلیل این که هوشمند نیست نیاز به خلبان ماهر داره با یک دوربین خوب و گیمبال مناسب هزینه فیلم برداری تا ۱۰ میلیون میره در صورتی که اگر بخواید از ربات آماده فانتوم استفاده کنین چیزی حدود ۲۰ میلیون باید خرج کنین. البته شاید مدل های دست دوم ربات فانتوم برای شما مقرون به صرفه تر باشه. انتخاب با خود شماست.نمونه های سه موتوره این سری از بدنه با عدد ۳۵۰ و نمونه های شش موتوره اون با سری ۵۵۰ توی بازار شناخته می‌شن.

سری دیگه از ربات های پیشنهادی این شرکت ربات های سری S هستند که ربات S1000 نمونه قدیمی تر اونه و ربات S1200 نمونه جدید تر. این ربات قابلیت این رو داره که چیزی حدود ۱۰ کیلوگرم وزن رو حمل کنه. این پرنده هشت موتوره با موتور های قدرتمندش مخصوص حمل وسایل و تجهیزات بزرگه.

مقایسه بدنه F550 و S1000

این شرکت علاوه بر بدنه و موتور تجهیزات دیگه ای شامل رادیوکنترلر دوربین و نگه دارنده های اون و کنترلر ها داره که داخل پست های بعدی به اونها اشاره خواهم کرد.

Kim Kardashian Canny Picture

To have understand Canny filter, I have applied Canny filter on Kim Kardashian picture. As I mentioned previously about Canny filter, It’s an edge detector filter. if you have some problem in understanding this filter don’t worry. We will understand it completely here.

First, check this picture. It’s a full color picture of Kim Kardashian. What do you think if we apply canny filter with first threshold 50 and second threshold 100?! Let’s see the result.

Kim kardashian before applying canny filter

As you may have noticed the lines located where there is a observable change in color differences. Eyebrows, lips and eyelashes, and bottom of hairs are full of lines. But ‌blouse lines and face has obvious lines with low noise. because of blurred background no edges detected there. So one important problem about canny filter is never apply it on blurred pictures because nothing goes well this way.

Now let’s check first and second threshold results. move the scrolbars.


Hello OpenCV.js

OpenCV.js is loading…

No Image
imageSrc
canvasOutput

Canny edge detector OpenCV.js

Today I am going to talk about Canny filter. Canny is a edge detector in image processing. It has been developed by John F.Canny in 1986. He also produced a computational theory of edge detection explaining why the technique works.

In OpenCV library Canny operator can be really helpful especially when you are going to detect a Line or circle in a very simple picture with low noise. It is also really popular algorithm for applying to your pictures and post it on Instagram. Canny function in OpenCV has six argument.

Parameters

image8-bit input image.
edgesoutput edge map; single channels 8-bit image, which has the same size as image.
threshold1first threshold for the hysteresis procedure.
threshold2second threshold for the hysteresis procedure..
apertureSizeaperture size for the Sobel operator.
L2gradientspecifies the equation for finding gradient magnitude. If it is True, it uses the equation mentioned above which is more accurate, otherwise it uses this function: Edge_Gradient(G)=|Gx|+|Gy|.

if you’re going to install OpenCV.js right now follow out installation tutorial here.

Now lets see how to use canny detector in OpenCV.js. All you need to use Canny filter is this code:

>>cv.Canny(src, dst, 50, 100, 3, false);
First parameter is source image that you choose it by:

let imgElement = document.getElementById(‘imageSrc’);
let src = cv.imread(imgElement);

The second parameter is output image. Other argument are First and second threshold numbers and Not to use L2Gradiant. that’s it. check the code and enjoy.

OpenCV in Web Programming

Here we are going to discuss about the most incredible feature that OpenCV library has newly. The good news is that you can run image processing code using JavaScript code. So it would be very simple to have image processing feature for websites and I think that is awesome. Feel free and leave comment your opinion about this feature. because I really love this feature I will try to share tutorials about image processing in JS.

How to install Opencv-JS

First of all we need the OpenCV sources. To build JS file you should install emscripten. Installation is really easy just check this link. Emscripten is a toolchain for compiling to asm.js and WebAssembly, built using LLVM, that lets you run C and C++ on the web at near-native speed without plugins. This is a really useful SDK and I would like to share more about it in later posts.

The next Step is like following:

1.To build opencv.js, execute python script <opencv_src_dir>/platforms/js/build_js.py <build_dir>. For example, to build in build_js directory:

>>cd opencv

>>python ./platforms/js/build_js.py build_js

Note: It requires python and cmake installed in your development environment.

2.The build script builds asm.js version by default. To build WebAssembly version, append --build_wasm switch. For example, to build wasm version in build_wasm directory:

>> python ./platforms/js/build_js.py build_wasm –build_wasm

[optional] To build documents, append --build_doc option. For example: >>python ./platforms/js/build_js.py build_js –build_doc

Note: It requires doxygen installed in your development environment.

[optional] To build tests, append --build_test option. For example: python ./platforms/js/build_js.py build_js –build_testTo run tests, launch a local web server in <build_dir>/bin folder. For example, node http-server which serves on localhost:8080. Navigate the web browser to http://localhost:8080/tests.html, which runs the unit tests automatically. You can also run tests using Node.js. For example: cd binnpm installnode tests.jsNoteIt requires node installed in your development environment.

Now you can test your code. Take a photo from you and draw a red rectangular boarder around it. It’s really simple and fun. you can download the pre-built library in this link



Iter in the middle of it’s way

After a series of set backs the international project is back on track, say scientists, giving tentative hope for a major new source of clean power by 2025.


The International Thermonuclear Experimental Reactor project aims to generate energy from nuclear fusion

The International Thermonuclear Experimental Reactor project aims to generate energy from nuclear fusion. Photograph: Courtesy of ITER

An international project to generate energy from nuclear fusion has reached a key milestone, with half of the infrastructure required now built.

Bernard Bigot, the director-general of the International Thermonuclear Experimental Reactor (Iter), the main facility of which is based in southern France, said the completion of half of the project meant the effort was back on track, after a series of difficulties. This would mean that power could be produced from the experimental site from 2025. Q&A

What is nuclear fusion and how will it work in the Iter project?

The effort to bring nuclear fusion power closer to operation is backed by some of the world’s biggest developed and emerging economies, including the EU, the US, China, India, Japan, Korea and Russia. However, a review of the long-running project in 2013 found problems with its running and organization. This led to the appointment of Bigot, and a reorganization that subsequent reviews have broadly endorsed.

Fusion power is one of the most sought-after technological goals in the pursuit of clean energy. Nuclear fusion is the natural phenomenon that powers the sun, converting hydrogen into helium atoms through a process that occurs at extreme temperatures.

Replicating that process on earth at sufficient scale could unleash more energy than is likely to be needed by humanity, but the problem is creating the extreme conditions necessary for such reactions to occur, harnessing the resulting energy in a useful way, and controlling the reactions once they have been induced.

For these reasons, fusion power was long ago abandoned by nuclear physicists as a potential source of commercial energy in favor of fission reactors, using processes by which radioactive materials release energy as they are induced to decay. Advertisement

The Iter project aims to use hydrogen fusion, controlled by large superconducting magnets, to produce massive heat energy which would drive turbines – in a similar way to the coal-fired and gas-fired power stations of today – that would produce electricity. This would produce power free from carbon emissions, and potentially at low cost, if the technology can be made to work at a large scale.

For instance, according to Iter scientists, an amount of hydrogen the size of a pineapple could be used to produce as much energy as 10,000 tonnes of coal.

However, while fusion has been the subject of intermittent scientific research projects since the 1940s, no means has yet been found to make it work in controllable conditions at the scale needed to produce the power of a fossil fuel power station. The extreme conditions driving the sun require temperatures of millions of degrees, and mimicking those conditions has proved elusive.

Iter has been described as the most complex scientific endeavour in human history. The project requires hydrogen plasma to be heated to 150 million C – 10 times hotter than at the sun’s core. A doughnut-shaped reactor called a Tokamak would be surrounded by giant magnets that take the superheated plasma away from the metal walls of the container. This requires the magnets to be cooled to -269C.

Getting to this stage of the project has already required remarkable feats of engineering, such as the manufacturer of more than 100,000km of niobium-tin superconducting strands of metal, produced by nine suppliers over seven years, to make the magnets.

Bigot said the milestone of building half of the project indicated that the rest of the project was now technically feasible.

However, there are still political difficulties. One is that US president Donald Trump’s administration is notably cooler on clean energy research than its predecessor, and the US budgetary contribution, of nearly 10%, or more than $1bn, is now partially in doubt. The EU is providing 45% of the cost of the project, with the rest provided by the other main partners.

Bigot, currently in Washington DC holding meetings to try to break the impasse, told the Guardian he was confident the conflict could be resolved.

He said the project was on track to reach “first plasma” in December 2025, proving the concept. If successful, the Iter machine would produce 500MW of power, enough to study a self-heating plasma, which has never been produced in a controlled way on earth. That could in turn lead to the development of power plants to harness the energy produced. Advertisement

Google is also now working on fusion power, in the first major private sector try-out of the technology. This summer, the internet giant announced it had formed a partnership with Tri Alpha Energy, backed by Microsoft co-founder Paul Allen, to generate new computer algorithms that could help test the concepts behind nuclear fusion engineering efforts.

As 2019 begins…

… we’re asking readers to make a new year contribution in support of The Guardian’s independent journalism. More people are reading our independent, investigative reporting than ever but advertising revenues across the media are falling fast. And unlike many news organisations, we haven’t put up a paywall – we want to keep our reporting as open as we can. So you can see why we need to ask for your help.

The Guardian is editorially independent, meaning we set our own agenda. Our journalism is free from commercial bias and not influenced by billionaire owners, politicians or shareholders. No one edits our editor. No one steers our opinion. This is important as it enables us to give a voice to those less heard, challenge the powerful and hold them to account. It’s what makes us different to so many others in the media, at a time when factual, honest reporting is critical.

Please make a new year contribution today to help us deliver the independent journalism the world needs for 2019 and beyond. It’s now quicker and easier than ever to show your support for The Guardian. Contribute today from as little as £1 – and it only takes a minute. Thank you.

From The Guardians

How to install LaTeX

How to use LaTeX

Install LaTeX

LaTeX, which is pronounced «Lah-tech» or «Lay-tech» is a document preparation system for high-quality typesetting. Commonly, it is used for medium or large technical or scientific documents. But I  recommend it for any publishing like papers, journals and reports. I really enjoy it because you can write things programmatically. When you use Latex  you can just add reference just using one word but in Microsoft you have to find the reference button and coding “\cite{}” is much easier. In this topic we are going to learn about it. In the following line you will learn how to install latex in Ubuntu.
Firstly, The LaTeX should be installed on your computer. But you can also use the web-editor. ShareLaTeX is a website in which you can compile your latex script online. If you sign up there you can have several file and use them whenever and wherever you want. But for those who want to install it on their computer I suggest Textmaker. For installation in Ubuntu just try the bellow command:

  • Sudo apt-get install Texmaker

Start a document

After installation launch the program. As you can see the window has been divided to three section.

  1. Structure: in which you can see the structure of your file including headers and sub headers.
  2. editor: which is in the middle and you can write down the command and scripts.
  3. output: The output of your code which can be in PDF form or other format.

To make a new document just click on new in file or use the hot key Ctrl+N. just after creating new document the editor will be available and your ready to go but to start there are some notes that would help you. before creating new document, search for templates that is available on network. There are many good templates in here including Book formats or reports. I advice to check it first.

Help-Desk