Тёмный

Taking Screenshots With Matlab [Advanced Matlab] 

CodingLikeMad
Подписаться 3,4 тыс.
Просмотров 8 тыс.
50% 1

This video covers how to take screen shots using Matlab and the Java AWT Robot class. This is most useful for capturing data from screen when you want to post process that data with image processing code.

Наука

Опубликовано:

 

30 окт 2018

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 7   
@TK-wk4vp
@TK-wk4vp 3 года назад
Hi, I'm having a hard time understanding the three lines with imgData in the conversion to the RGB image. Can you explain me why it has to be rgb(3:4:end) in imgData(:,:,:1) and rgb(2:4:end) in imgData(:,:,2) and rgb(3:4:end) in imgData(:,:,3)? And what does these three parameters mean?
@CodingLikeMad
@CodingLikeMad 3 года назад
Hi TK, the details are a bit technical, but the short answer is that the function is returning a 4 component array - we are grabbing the data correspond to red, green and blue, but ignoring the alpha component, stored in the 4th byte position(hence the 4 in 1:4:end). The offsets provided have to do with the order of the TYPE_INT_ARGB variable java uses. Note that the byte order in the variable is BGR, hence the reversed order. Also note that the offsets are 3,2,1 for RGB(not 3,2,3 as your comment says). A quick run down can be found here: stackoverflow.com/questions/6001211/format-of-type-int-rgb-and-type-int-argb And the java documentation for the robot class method itself is here: docs.oracle.com/javase/7/docs/api/java/awt/image/BufferedImage.html#getRGB(int,%20int)
@matteoverardo8005
@matteoverardo8005 5 лет назад
Hi, I saw the video that shows how to do a scrrenshot but it refers to a fixed rectangle position inside Matlab enviroment.From Matlab I need to do a screenshot of a generic part of screen of a different program. In other words I want to capture an area of a CAD program. How can I do that? Thanks, Matteo.
@CodingLikeMad
@CodingLikeMad 5 лет назад
Hi Matteo, the coordinates of the rectangle(the one specified to the robot class) are in the desktop coordinate system, not the matlab environment. If you use the desktop coordinates corresponding to the region of the screen your cad window is in, it should work(depending on how cad does its rendering). Let me know if you have more trouble and thanks for watching :)
@matteoverardo8005
@matteoverardo8005 5 лет назад
Ciao MAD, yes, you are right, the rectangle is in the desktop coord. system. My problem is that I want the vector "pos = [left, top, width, height]" to be set by dragging the rectangle using the mouse as you would do with any capturing screen software. I need a "mouse dragging" function that calls "imgData = takeScreenshot(left, top, width, height)" and pass it the "pos" vector. I can't do that by myself, I am not able. Would you help me please?
@CodingLikeMad
@CodingLikeMad 5 лет назад
Hi Matteo, I have a second video that used screenshots that includes code in the description (the mouse and keyboard one). Note my reply in the comments as well if you try to use the code directly - it currently assumes the window is in the top left. The get button function does most of what you want I think.
Далее
Where To Find Screenshots On Windows
1:50
Просмотров 247 тыс.
ШАР СКВОЗЬ БУТЫЛКУ (СКЕРЕТ)
00:46
How To Fix Missing Data In Matlab [Machine Learning]
12:21
TP1 modélisation chaine bande base partie1
7:14
Просмотров 7 тыс.
4. How Kafka Works | Apache Kafka Fundamentals
26:41
Просмотров 188 тыс.
How to Import MATLAB Code file in LATEX
11:01
Просмотров 7 тыс.