File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -715,5 +715,22 @@ This will produce the output
715
715
> > {: .language-python}
716
716
> >
717
717
> > 
718
+ > >
719
+ > > > You may have noticed that in the solution, we have used the
720
+ > > > `labeled_image` to index the array `object_areas`. This is an
721
+ > > > example of [advanced indexing in
722
+ > > > Numpy](https://numpy.org/doc/stable/user/basics.indexing.html#advanced-indexing)
723
+ > > > The result is an array of the same shape as the `labeled_image`
724
+ > > > whose pixel values are selected from `object_areas` according to
725
+ > > > the object label. Hence the objects will be colored by area when
726
+ > > > the result is displayed. Note that advanced indexing with an
727
+ > > > integer array works slightly different than the indexing with a
728
+ > > > Boolean array that we have used for masking. While Boolean array
729
+ > > > indexing returns only the entries corresponding to the `True`
730
+ > > > values of the index, integer array indexing returns an array
731
+ > > > with the same shape as the index. You can read more about advanced
732
+ > > > indexing in the [Numpy
733
+ > > > documentation](https://numpy.org/doc/stable/user/basics.indexing.html#advanced-indexing).
734
+ > > {: .callout}
718
735
> {: .solution}
719
736
{: .challenge}
You can’t perform that action at this time.
0 commit comments