Manipulating a image of a yellow car.
1 view (last 30 days)
Show older comments
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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/201681/car2.jpeg)
Exspected output:
![c3.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/201682/c3.jpeg)
![c4.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/201683/c4.jpeg)
![crt5.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/201684/crt5.jpeg)
4 Comments
madhan ravi
on 27 Jan 2019
Edited: madhan ravi
on 27 Jan 2019
where is your code and attach YellowCar.jpg file?
Answers (1)
Star Strider
on 27 Jan 2019
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 Comments
Star Strider
on 27 Jan 2019
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.
See Also
Categories
Find more on Computer Vision with Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!