# CNN and Image Sizes

조회 수: 15 (최근 30일)
Jovan 2023년 8월 12일
답변: Josh 2023년 11월 5일
I have a 129x23x2 input and 129x1x2 output for couple of thousand samples in the training set. How do a I create an convolutional autoencoder in matlab to fit the output size? Can somebody explain how do we structure windows of the convolution layers?
##### 댓글 수: 1이전 댓글 -1개 표시이전 댓글 -1개 숨기기
Josh 2023년 11월 5일
I might need clarification regarding the nature of your images as usually images are represented as a:
1. n x m matrix where elements values range from [0,1] --- this is more commonly known as an indexed image and can either be grayscale or color if used in combination with a colormap
2. n x m x 3 matrix where elements range from [0,1] (indexed) or [0,255] --- this generally represents the complete RGB values for the image with separate layers for red (:,:,1), green (:,:,2), and blue (:,:,3).
Your description outlines a 3D output matrix; however, it only has two layers.
For changing the size of output (image size), I would recommend using the imresize() function. This function can be used to either scale an image by a factor or resize images to a desired height (rows) and width (columns). As far as image convolution methods, MATLAB allows for you to specificy which method/kernel to use in the resizing of the image. Again, I may be misinterpreting your question and need more clarificaton about what you mean by "structure windows of the convolution layers".

댓글을 달려면 로그인하십시오.

### 답변 (1개)

Josh 2023년 11월 5일
I might need clarification regarding the nature of your images as usually images are represented as a:
1. n x m matrix where elements values range from [0,1] --- this is more commonly known as an indexed image and can either be grayscale or color if used in combination with a colormap
2. n x m x 3 matrix where elements range from [0,1] (indexed) or [0,255] --- this generally represents the complete RGB values for the image with separate layers for red (:,:,1), green (:,:,2), and blue (:,:,3).
Your description outlines a 3D output matrix; however, it only has two layers.
For changing the size of output (image size), I would recommend using the imresize() function. This function can be used to either scale an image by a factor or resize images to a desired height (rows) and width (columns). As far as image convolution methods, MATLAB allows for you to specificy which method/kernel to use in the resizing of the image. Again, I may be misinterpreting your question and need more clarificaton about what you mean by "structure windows of the convolution layers".

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by