Posts Tagged ‘iphone’

Featuring MuseARt

Posted on: 2 Comments

Today we feature MuseARt, an amazing app Salvador Sanchez has developed and I recommend you all.

MuseARt is the first application that combines art with the most advanced technologies of AUGMENTED REALITY, TEXT TO SPEECH and IMAGE RECOGNITION in REAL TIME.

With dozens of artworks from The Prado Museum, The Thyssen-Bornemisza Museum and The Reina Sofia Museum in Madrid.

MuseARt is an essential application for art lovers and for those who want to have their own audioguide when visiting a museum.

This is a collection of artwork ordered by museums, exhibitions, galleries and specific collections created by the world’s major museums.

But that’s not all: MuseARt has an AUGMENTED REALITY interface that directly identifies each artwork through the camera device, displaying in real time all the information associated with it, including the audioguide in English and Spanish, made with text to speech technology with high quality interpretation and diction, provided by the latest technology in text recognition and human intonation existing in the market.

The advantage of image identification system built into the application represents a significant advance in the currently existing audioguides and do not need to manually enter any identifier: only focusing the camera to the artwork achieve the identification, and visitors are not distracted by entering data into the device. This image identification system is the result of extensive research in Augmented Reality, making it more human and closer to the user.

The application is constantly evolving, including regular updates of artworks, exhibitions, new museums around the world and their respective audioguides.

Each artwork has a high definition version that you can download for later reference even without network connection.

iPhone video output setting YUV or BGR CVImageBufferRef to IplImage [Code snippet]

Posted on: No Comments
  • We are going to publish a series of posts with some useful code snippets for iOS and Android.

Any suggestion or contributions are welcomed ;)

Here we show how to get and IplImage from CVImageBufferRef or CMSampleBufferGetImageBuffer with the output video set to:

kCVPixelFormatType_32BGRA or

kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange or

kCVPixelFormatType_420YpCbCr8BiPlanarFullRange

Here we go:

- (IplImage *)createIplImageFromBuffer:(CVImageBufferRef)imageBuffer 
                                        withChannels:(int)channels {

    IplImage *iplimage = 0;
    if (imageBuffer) {
        // From CMSampleBufferGetImageBuffer:
        // CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
        // lock buffer
        CVPixelBufferLockBaseAddress(imageBuffer, 0);
        // get buffer's image information
        uint8_t *bufferBaseAddress = (uint8_t *)CVPixelBufferGetBaseAddress(imageBuffer);
        size_t bufferWidth = CVPixelBufferGetWidth(imageBuffer);
        size_t bufferHeight = CVPixelBufferGetHeight(imageBuffer);
        size_t bufferBytesPerRow = CVPixelBufferGetBytesPerRow(imageBuffer);
        // create IplImage
        if (bufferBaseAddress) {
            iplimage = cvCreateImage(cvSize(bufferWidth, bufferHeight), IPL_DEPTH_8U, channels);
        }
        // from YUV  - 1 channel (grey image)
        // from BGRA - 4 channels (colourful image)
        if(channels == 4)
        {
            vImage_Buffer src;
            src.width = bufferWidth;
            src.height = bufferHeight;
            src.rowBytes = bufferBytesPerRow;
            src.data = bufferBaseAddress;
            vImage_Buffer dest;
            dest.height = bufferHeight;
            dest.width = bufferWidth;
            dest.rowBytes = bufferBytesPerRow;
            dest.data = iplimage->imageData;
            // swap the pixel channels from BGRA to RGBA.
            const uint8_t map[4] = { 2, 1, 0, 3 };
            vImagePermuteChannels_ARGB8888(&src, &dest, map, kvImageNoFlags);
        }else
        {
            iplimage->imageData = (char*)bufferBaseAddress;
        }
        // unlock buffer
        CVPixelBufferUnlockBaseAddress(imageBuffer, 0);
    }
    else
        NSLog(@"No sampleBuffer!!");
    return iplimage;
}