- the input image differed between the two analyses, or
- the algorithm differs between the two analyses
Can we count the color pixels in each box like it did in mathematica?
1 次查看(过去 30 天)
显示 更早的评论
I am working in a project to split an image into small boxes of equal size which I have made. The problem is that when OI concatinate the boxes again to count the number of color pixels and use it for further computation then there are many new colors of which I dont know the name and it coounted to be about more than 17000 in an 1000 x 1000 image. I splitted an imae in mathematica and ploted the number of color pixels with their shade that made my work quite easy but the porblem is that when I work for larger box number it keep on running and very slow computation as compared to matlab. I want to do that in matlab to reduce the computaional cost. Kindly help.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/361636/image.png)
This is what mathematica gives me for a 25 x 25 image when it is splitted into 5 x 5 boxes and each box contained 25 pixels.
3 个评论
Mario Malic
2020-9-16
编辑:Mario Malic
2020-9-16
"This is what mathematica gives me for a 25 x 25 image when it is splitted into 5 x 5 boxes and each box contained 25 pixels."
From the image and this information from the post, it's possible to deduce that all pixels are in the each box. Adam, I am impressed by the amount of work you invested in that just-for-fun post (+1 on that).
Regarding the computational cost, I doubt it's that big, even though it's 3 milion elements (1000x1000x3) that should be analysed. The thing is that, if image you're analysing is a colorful image, then think about how can you display all the colors in the box, you'll have to set some threshold on count of colors.
About the process, load the image and split the image array according to the sizes, and set up the process for 1 box and just loop it for remaining boxes.
Adam Danz
2020-9-16
Thanks, Mario.
@Atique Khan , on second glance, it looks like the Mathematica algorithm is also not differentiating between very similar but numerically different colors so I can't imagine what it's doing.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!