CoreVideo to pixel level data (speed path problems)

  • All:

      I am trying to take iSight data, and get the bitmap data for post-
    processing.  I am currently using the WhackedTV example from Apple as
    a base, and it converts CVPixelBufferRef-->CIImage(s)-->NSImage--
    > NSBitmapImageRep, but these operations are expensive and slow.  (I
    am seeing that converting the images to NSBitmapImageRep can peg a
    processor at low frame rates.  All of the time is spent in [NSImage
    drawImage:], the final step to convert NSImage(s) to NSBitmapImageRep.)

      I am interested in knowing if there are any quick ways to access
    the pixel level data in any of the data structures I am using?  Does
    anyone have any example code?

      As a (possibly useful) aside, I am only interested in the red data
    (from RGB) of the pixel data.  If it helps, I would be glad to
    sacrifice G/B/Alpha for just the red.

    Thanks in advance.

    Best Regards,
      Jeremy Faller
  • On 10/16/06, Jeremy Faller <jeremy_faller...> wrote:
    > All:
    >
    >
    > I am trying to take iSight data, and get the bitmap data for post-
    > processing.  I am currently using the WhackedTV example from Apple as
    > a base, and it converts CVPixelBufferRef-->CIImage(s)-->NSImage--
    >> NSBitmapImageRep, but these operations are expensive and slow.  (I
    > am seeing that converting the images to NSBitmapImageRep can peg a
    > processor at low frame rates.  All of the time is spent in [NSImage
    > drawImage:], the final step to convert NSImage(s) to NSBitmapImageRep.)
    >
    > I am interested in knowing if there are any quick ways to access
    > the pixel level data in any of the data structures I am using?  Does
    > anyone have any example code?
    >
    > As a (possibly useful) aside, I am only interested in the red data
    > (from RGB) of the pixel data.  If it helps, I would be glad to
    > sacrifice G/B/Alpha for just the red.

    If you have a CVPixelBufferRef why not just use it directly? Consider
    using CVPixelBufferGetBaseAddress(CVPixelBufferRef) or possibly
    CVPixelBufferGetBaseAddressOfPlane(CVPixelBufferRef).

    -Shawn
  • I tend to do pixel-bashing with the help of Quartz Composer these
    days.  It's pretty easy to extract whatever pixel-level info you want
    from a video stream using a QC "Core Image Kernel" patch with a bit of
    GL SLANG code.

    What are you trying to do with this red data?

    -jcr

    On Oct 16, 2006, at 4:39 PM, Jeremy Faller wrote:

    > All:
    >
    >
    > I am trying to take iSight data, and get the bitmap data for post-
    > processing.  I am currently using the WhackedTV example from Apple
    > as a base, and it converts CVPixelBufferRef-->CIImage(s)-->NSImage--
    >> NSBitmapImageRep, but these operations are expensive and slow.  (I
    > am seeing that converting the images to NSBitmapImageRep can peg a
    > processor at low frame rates.  All of the time is spent in [NSImage
    > drawImage:], the final step to convert NSImage(s) to
    > NSBitmapImageRep.)
    >
    > I am interested in knowing if there are any quick ways to access
    > the pixel level data in any of the data structures I am using?  Does
    > anyone have any example code?
    >
    > As a (possibly useful) aside, I am only interested in the red data
    > (from RGB) of the pixel data.  If it helps, I would be glad to
    > sacrifice G/B/Alpha for just the red.
    >
    >
    > Thanks in advance.
    >

    John C. Randolph,
    VP, Engineering
    Stealth Imaging, Inc. <jcr...>
  • I'm making a laser range finder:  (http://www.pages.drexel.edu/~twd25/
    webcam_laser_ranger.html)

    I have written the SLANG filter for red filtering, and it works
    fine.  However, I think QuartzComposer SLANG filters fail for this
    type of application.

    On Oct 16, 2006, at 8:01 PM, John C. Randolph wrote:

    > I tend to do pixel-bashing with the help of Quartz Composer these
    > days.  It's pretty easy to extract whatever pixel-level info you
    > want from a video stream using a QC "Core Image Kernel" patch with
    > a bit of GL SLANG code.
    >
    > What are you trying to do with this red data?
    >
    > -jcr
    >
    > On Oct 16, 2006, at 4:39 PM, Jeremy Faller wrote:
    >
    >> All:
    >>
    >>
    >> I am trying to take iSight data, and get the bitmap data for
    >> post-processing.  I am currently using the WhackedTV example from
    >> Apple as a base, and it converts CVPixelBufferRef-->CIImage(s)--
    >>> NSImage-->NSBitmapImageRep, but these operations are expensive
    >> and slow.  (I am seeing that converting the images to
    >> NSBitmapImageRep can peg a processor at low frame rates.  All of
    >> the time is spent in [NSImage drawImage:], the final step to
    >> convert NSImage(s) to NSBitmapImageRep.)
    >>
    >> I am interested in knowing if there are any quick ways to access
    >> the pixel level data in any of the data structures I am using?
    >> Does anyone have any example code?
    >>
    >> As a (possibly useful) aside, I am only interested in the red
    >> data (from RGB) of the pixel data.  If it helps, I would be glad
    >> to sacrifice G/B/Alpha for just the red.
    >>
    >>
    >> Thanks in advance.
    >>
    >
    >
    > John C. Randolph,
    > VP, Engineering
    > Stealth Imaging, Inc. <jcr...>
    >
    >
    >
    >
  • Jeremy,

    (Hopefully I have read your post and understood it correctly...)

    Check out the FrameReader object in the QCTV sample code.  If I
    remember correctly, if manipulates the the pixels from the CV buffer
    directly into an image description... (No CIImage, No NSImage, No
    bitmap reps)

    Have you checked out the CIVideoDemoGL sample code?  The -
    exportMovie: routine in this sample uses the MovieExporter API and
    grabs CV buffer data directly into an image description as well. If
    you just want the Red pixels from a buffer, you should be able to
    stick the CIColorCube filter into this code and get (something close
    to) what you want.

    Hope that helps.

    later,

    douglas

    On Oct 16, 2006, at 8:03 PM, Jeremy Faller wrote:

    >
    > I'm making a laser range finder:  (http://www.pages.drexel.edu/
    > ~twd25/webcam_laser_ranger.html)
    >
    > I have written the SLANG filter for red filtering, and it works
    > fine.  However, I think QuartzComposer SLANG filters fail for this
    > type of application.
    >
    >
    > On Oct 16, 2006, at 8:01 PM, John C. Randolph wrote:
    >
    >> I tend to do pixel-bashing with the help of Quartz Composer these
    >> days.  It's pretty easy to extract whatever pixel-level info you
    >> want from a video stream using a QC "Core Image Kernel" patch with
    >> a bit of GL SLANG code.
    >>
    >> What are you trying to do with this red data?
    >>
    >> -jcr
    >>
    >> On Oct 16, 2006, at 4:39 PM, Jeremy Faller wrote:
    >>
    >>> All:
    >>>
    >>>
    >>> I am trying to take iSight data, and get the bitmap data for
    >>> post-processing.  I am currently using the WhackedTV example from
    >>> Apple as a base, and it converts CVPixelBufferRef-->CIImage(s)--
    >>>> NSImage-->NSBitmapImageRep, but these operations are expensive
    >>> and slow.  (I am seeing that converting the images to
    >>> NSBitmapImageRep can peg a processor at low frame rates.  All of
    >>> the time is spent in [NSImage drawImage:], the final step to
    >>> convert NSImage(s) to NSBitmapImageRep.)
    >>>
    >>> I am interested in knowing if there are any quick ways to
    >>> access the pixel level data in any of the data structures I am
    >>> using?  Does anyone have any example code?
    >>>
    >>> As a (possibly useful) aside, I am only interested in the red
    >>> data (from RGB) of the pixel data.  If it helps, I would be glad
    >>> to sacrifice G/B/Alpha for just the red.
    >>>
    >>>
    >>> Thanks in advance.
    >>>
    >>
    >>
    >> John C. Randolph,
    >> VP, Engineering
    >> Stealth Imaging, Inc. <jcr...>
    >>
    >>
    >>
    >>
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/douglas_welton%
    > 40earthlink.net
    >
    > This email sent to <douglas_welton...>
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today