- Informações do recurso
Resumo
Este é um projeto divertido baseado no processamento de imagens com MATLAB, aqui vamos aprender a contar o número de objetos distinguíveis em uma imagem. O tutorial a seguir é realizado com a ajuda do MATLAB. MATLAB significa “MATrix LABoratory” e é um ambiente de computação numérica e linguagem de programação de quarta geração, desenvolvido pela MathWorks. Usando o MATLAB, podemos resolver problemas técnicos de computação mais rapidamente do que com linguagens de programação tradicionais, como C, C++ e Fortran. Esta atividade pode ser desenvolvida individualmente pelos alunos ou em dupla (2 alunos) que deve ser focada no uso do MATLAB. O professor deve manter um parafuso apertado do trabalho realizado pelos alunos. O tutorial pode ser executado executando os comandos em cada etapa sequencialmente na janela de comandos do MATLAB.

Uma imagem original
Fonte https://www.instructables.com/Image-Processing-and-Counting-using-MATLAB/
Resultados de Aprendizagem
The learners will learn how to edit an image using MATLAB.
- Organize um trabalho em equipe dividindo tarefas e papéis.
- Habilidades sociais como liderança, consciência organizacional ou comunicação.
- Programming skills.
- Gestão de tempo e recursos para cumprir os objetivos propostos.
- Responsabilidade social e conscientização.
- Conhecimento matemático através do reconhecimento de diferentes medidas, volumes e perspectivas.
- Como trabalhar em grupo.
- How to understand programming principles.
- How to process an image using MATLAB.
Outras instruções
In 7 simple steps you will have your processed image: o Read an image: An image is choosen so that it has considerable contrast with its background so that the objects can be identified. The function imread reads the image from a given location and stores it in the matrix img1. The imshow function displays the image. img1=imread(‘Lines.jpg’); imshow(img1) o Convert to greyscale: This step removes any color information in the image to make it easier to identify objects. The rgb2gray converts the color image into a grayscale image and stores it into the matrix img2. img1=rgb2gray(img1); imshow(img1) o Threshold the image: This step thresholds the image by converting the grayscale image into an image that contains only two colors. The function im2bw() assigns black color to all the pixels that have luminosity than a threshold level and the others as white. the function graythresh() approximately calculates the threshold of the image. img2=im2bw(img1,graythresh(img1)); imshow(img2) o Complement the image: In this step we complement the image by using the ~ operator. By this we convert the white patches into black and vice versa. We perform this step as we wanted the areas of concern(objects) to be colored white. img2=~img2; imshow(img2) o Found the boundaries of the object: This step finds the boundaries of each object that it finds and stores it in B. The text function prints the number of objects that are found by bwboundaries. B = bwboundaries(img2); imshow(img2) text(10,10,strcat(‘\color{green}Objects Found:’,num2str(length(B)))) hold on o Draw the boundaries: This is a fun step in which we mark the boundaries of all the objects identified by bwboundaries function. This step can be eliminated if it seems complicated for k = 1:length(B) boundary = B{k}; plot(boundary(:,2), boundary(:,1), ‘g’, ‘LineWidth’, 0.2) end
URL
RECURSOS
Autor
Linguagem
Inglês