필터 지우기
필터 지우기

Manipulating a image of a yellow car.

조회 수: 2 (최근 30일)
Oscar Tsang
Oscar Tsang 2019년 1월 27일
댓글: Star Strider 2019년 1월 27일
I have a JPG image of a yellow car and one of the task was to flip it 3 different ways which I did. The only pickle I'm is is that somehow output isn't the same as the exspected output. I have no idea what i missed out and becasue of that I can't produce the later wanted outputs. Any help is really appriciated. I have includedthe images (ouputs) that include my output and exspected output.
My Output:
car2.jpg
Exspected output:
c3.jpg
c4.jpg
crt5.jpg
  댓글 수: 4
madhan ravi
madhan ravi 2019년 1월 27일
편집: madhan ravi 2019년 1월 27일
where is your code and attach YellowCar.jpg file?
Oscar Tsang
Oscar Tsang 2019년 1월 27일
Here's my code. I have attached it as a .m file

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

답변 (1개)

Star Strider
Star Strider 2019년 1월 27일
The yellow background is relatively straightforward:
A = imread('Yellow Car.jpeg');
GrayCar = rgb2gray(A);
YellowBackground = uint8(cat(3, ones(size(GrayCar)), ones(size(GrayCar)), zeros(size(GrayCar))));
YellowCarWithYellowBackground = GrayCar .* YellowBackground;
imshow(YellowCarWithYellowBackground)
I named the image file ‘Yellow Car.jpeg’. Change that if yours is different. The rest of my code should work.
I notice the the wheels, side moulding, and windows are different colours. You might have to segment the image and make those changes if they’re important.
  댓글 수: 4
Oscar Tsang
Oscar Tsang 2019년 1월 27일
Got it, but the only trouble is that im having trouble to put that purple strip in between the cars and rehsaping it.
Star Strider
Star Strider 2019년 1월 27일
Since that appears to be part of the assignment, I will defer to you to solve it. Think of how you might do it if it were on paper, and you want to insert the purple (later yellow) stripe between the first and second row of cars.
You might find some inspiration in consulting the vertcat function.

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

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by