changing the pixel color in an image
3 ビュー (過去 30 日間)
古いコメントを表示
I have a raster image and I have the coordinates of the shown point. I need to change the colour of the area occupied by the image(i.e. the black pixels) in the two perpendiculars drawn from the same point(along x and y-axis). Is there any function that I can use?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169032/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169034/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169035/image.png)
2 件のコメント
Jan
2018 年 1 月 17 日
I do not understand the question. What is "the coloured area"? Do you mean the black pixels which are under the green bars? Or inside the rectangle built by the green bars?
採用された回答
Image Analyst
2018 年 1 月 18 日
Convert your calibrated x,y into rows and columns, then make two masks and AND them together and use sum() to count pixels
yellowMask = rectangleMask & ~blackPolygonMask;
numYellowPixels = sum(yellowMask(:))
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!