The right way to access red channel in Lena

Adam Hughes hughesadam87 at gmail.com
Thu Mar 26 20:27:01 EDT 2015


Thanks Josh.  I actually would normally do it that way, but I stumbled on
this behavior when we were trying to build filters.  For example, scale the
red channel by 50% via multiplying by (0.5, 1, 1).  Just curious what's
going on, and why multiplcation by (1,0,0) doesn't work.

On Thu, Mar 26, 2015 at 7:31 PM, Adam Hughes <hughesadam87 at gmail.com> wrote:

> I don't think the image came through.  Let me attach it
>
> On Thursday, March 26, 2015 at 7:16:12 PM UTC-4, Adam Hughes wrote:
>>
>> I'm trying to build a filter to show only the red channel in the lena
>> image.  I defined two masks:
>>
>> (1,0,0)
>> (255,0,0)
>>
>> Oddly, the (255,0,0) gives me the correct plot when doing imshow(), but
>> (1,0,0) doesn't.  Why does the (1,0,0) mask lead to light regions being
>> dark and dark regions being light?  Here's a working example:
>>
>> %pylab inline
>> from skimage.data import lena
>>
>> lena = lena()
>>
>> f, (ax1, ax2) = plt.subplots(1,2, figsize=(8,6))
>>
>> ax1.imshow(lena*(1,0,0))
>> ax2.imshow(lena*(255,0,0))
>>
>>
>>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "scikit-image" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/scikit-image/JzmfEbBJKYU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> scikit-image+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20150326/cbe67341/attachment.html>


More information about the scikit-image mailing list