• Stars
    star
    253
  • Rank 160,776 (Top 4 %)
  • Language
    C
  • License
    Other
  • Created over 13 years ago
  • Updated over 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AR(Augmented reality) framework for iOS, based on a visual code like ARToolKit

CoreAR.framework

Introduction and information

CoreAR.framework is open source AR framework. You can make an AR application using visual code like ARToolKit using this framework. CoreAR.framework does not depend on the other computer vision library like OpenCV. Considered portability, this framework is written only C or C++. The pixel array of an image is passed to CoreAR.framework and then visual code's identification number, rotation and translation matrix are obtained from the image including a visual code. Image processing speed of this framework is about 15 fps on iPhone4.

Take notice that CoreAR.framework depends on Quartz Help Library and Real time image processing framework for iOS. You have to download these libraries and put on them at the path where CoreAR.framework has been installed.

License

BSD License.

App Store

You can take a sample application from App Store.

Sample code in C++

float codeSize = 1;
int croppingSize = 64;
int threshold = 100;
int width = (int)bufferSize.width;
int height = (int)bufferSize.height;

// do it
if (chaincodeBuff == NULL)
	chaincodeBuff = (unsigned char*)malloc(sizeof(unsigned char) * width * height);

// binarize for chain code
for (int y = 0; y < height; y++)
	for (int x = 0; x < width; x++)
		*(chaincodeBuff + x + y * width) = *(buffer + x + y * width) < threshold ? CRChainCodeFlagUnchecked : CRChainCodeFlagIgnore;

// prepare to parse chain code
CRChainCode *chaincode = new CRChainCode();
chaincode->parsePixel(chaincodeBuff, width, height);

// clear previous buffer
CRCodeList::iterator it = codeListRef->begin();
while(it != codeListRef->end()) {
	SAFE_DELETE(*it);
	++it;
}
codeListRef->clear();

// reload detected codes
if (!chaincode->blobs->empty()) {
	std::list<CRChainCodeBlob*>::iterator blobIterator = chaincode->blobs->begin();
	while(blobIterator != chaincode->blobs->end()) {
		if (!(*blobIterator)->isValid(width, height)) {
			blobIterator++;
			continue;
		}
		CRCode *code = (*blobIterator)->code();	
		if(code) {
			// estimate and optimize pose and position
			code->normalizeCornerForImageCoord(width, height, focalLength, focalLength);
			code->getSimpleHomography(codeSize);
			code->optimizeRTMatrinxWithLevenbergMarquardtMethod();
			
			// cropping code image area
			code->crop(croppingSize, croppingSize, focalLength, focalLength, codeSize, buffer, width, height);
			codeListRef->push_back(code);
		}
		blobIterator++;
	}
}

Sample code in C (depracted)

// Copy image buffer from camera into "pixel".
int width;
int height;
unsigned char *pixel = (unsigned char*)malloc(sizeof(unsigned char) * width * height);

// codeInfoStorage receives the result of visual code recognition.
CRCodeInfoStorage *codeInfoStorage = CRCreateCodeInfoStorage();

// storage to save visual code templates.
CRCodeImageTemplate *codeImageTemplateStorage = CRCreateCodeImageTemplateStorage();

// make template to recognize visual codes.
int c_width;
int c_height;
unsigned char *c_p = (unsigned char*)malloc(sizeof(unsigned char) * c_width * c_height);

/* read images of visual codes you want to recognize */

CRCodeImageTemplate *template = CRCreateCodeImageTemplate(c_p, c_width, c_height);
template->code = codeNumber;
template->size = codeSize;
CRCodeImageTemplateStorageAddNewTemplate(codeImageTemplateStorage, template);
free(c_p);

// Start extraction
CRChainCodeStorage *storage = CRCreateChainCodeStorageByParsingPixel(pixel, width, height);
CRChainCodeStorageDetectCornerWithLSM(storage);
CRCodeInfoStorageAddCodeInfoByExtractingFromChainCode(codeInfoStorage, storage, valueBuffer, width, height, codeImageTemplateStorage);

// Release
CRReleaseChainCodeStorage(&storage);
CRReleaseCodeInfoStorage(&codeInfoStorage);
free(pixel);

Frequently Asked Questions

  • I can't compile CoreAR.framework...

  • How do I render a 3D model on the code with CoreAR.framework?

    • Ans. CoreAR.framework does not support rendering any 3D model files. You have to write a code to render 3D model files with OpenGLES. Sample program does not render a cube and Utah teapot with 3D model files but with OpenGLES code.

Blog

Dependency

Acknowledgement

More Repositories

1

reddift

Swift Reddit API Wrapper
Swift
242
star
2

PopupView

PopupView for iOS, like UICalloutView. BSD License.
Objective-C
230
star
3

numsw

Swift library like numpy, playgrounds notebook like jupyter.
Swift
134
star
4

AAKeyboard

ASCI Art Keyboard
Objective-C
106
star
5

iOSCameraImageProcessing

Real time image processing framework for iOS
Objective-C
103
star
6

Quartz-Help-Library

Quartz Help Library for iOS, for image processing on iOS.
Objective-C
50
star
7

llvm-tutorial

LLVM Tutorialใ‚’ๅ‹‰ๅผทใ™ใ‚‹ใƒชใƒใ‚ธใƒˆใƒช
C++
45
star
8

HomeConMenu

App to control HomeKit Devices from macOS system
Swift
44
star
9

UZTextView

Clickable and selectable text view for iOS
HTML
40
star
10

OpenCV-Help-Library

OpenCV Help Library for iOS
Objective-C
26
star
11

iCloudSample

Objective-C
22
star
12

EvernoteAPI

Simple Evernote API management class for iOS.
Objective-C
21
star
13

IntroduceCollectionView

Getting started UICollectionView
20
star
14

YouTubeGetVideoInfoAPIParser

Swift Library to parse YouTube streaming data from get_video_info API.
Swift
18
star
15

UZMultipleLayeredPopoverController

Objective-C
17
star
16

museum2tch

2tchๅš็‰ฉ้คจ
Objective-C
16
star
17

HTMLSpecialCharacters

Library to escape/unescape HTML special characters in Swift.
Swift
16
star
18

PlayPixels

Swift Playground Book for learning image processing.
Swift
16
star
19

iCloudFileSharing

Objective-C
13
star
20

iOS_OpenCV_build_script

This is a project for building OpenCV for iOS
Objective-C
12
star
21

SBMeter

This application receives data from the SwitchBot meter via Bluetooth LE and displays it in the menu bar for macOS.
Swift
9
star
22

sonson

sonson's iPhone source codes
Ruby
8
star
23

UZImageCollection

Image collection view controller like Photo.app.
Swift
7
star
24

HandoffSample

Objective-C
6
star
25

SNStatusBarView

Blinking statusbar
Objective-C
6
star
26

AirFollow

Objective-C
5
star
27

llvm_jit_compile

Try to "Just In Time" compile using LLVM.
C++
5
star
28

AnonyFollow

Application to collecting friends of Twitter using anonymous-communication.
Objective-C
5
star
29

RMBluteooth

Bluetooth library for ROMO
Objective-C
4
star
30

hideHere

Objective-C
4
star
31

UZInputCandidateAccessory

Keyboard input accessory view that displays some candidates for a word.
Objective-C
4
star
32

MacCatalystWithAppKit

Build a Mac Catalyst application with AppKit
Swift
4
star
33

CommonCrypto

Framework to include "CommonCrypto.h" for Swift
3
star
34

iOSLegacyCodes

Objective-C
3
star
35

ProvidingDirections

New feature - Providing directions for iOS6
Objective-C
3
star
36

StoreSales

Objective-C
3
star
37

CameraPlaygrounds

Swift Playgrounds Book for image processing programming using iPad's camera.
Swift
3
star
38

swiftodon

2
star
39

ATNDEasy

Objective-C
2
star
40

iOS6_2PainViewController

Best example of container view to implement 2 pain views in one view controller.
Objective-C
2
star
41

WaveFrontObjectLoader

I want to improve the good project, WaveFrontObjectLoader. Original project is http://code.google.com/p/iphonewavefrontloader/.
Objective-C
2
star
42

Markdown

Convert text into html that looks like github.
Perl
2
star
43

StudyWatch

Swift
2
star
44

SoftwareDesignSonson

source code for monthly Software Design Magazine
Objective-C
2
star
45

SNProxyDetector

Class to detect system proxy setting.
Objective-C
1
star
46

auto.gitconfig.proxy

Automatic onfiguration gitconfig' proxy setting for OSX
Shell
1
star
47

SNReachability

Network reachability check class for iOS
Objective-C
1
star
48

SweepDesk

Temporarily hides desktop files.
Swift
1
star
49

InspectCoreText

Objective-C
1
star
50

testFoldr

foldr implementaion in Swift
Swift
1
star
51

midi-swift-code

Swift code to use CoreMIDI
Swift
1
star
52

UntarLight

A light and elementary library to extract the structure and each files in a tar file in Swift
Swift
1
star
53

zipr

Reader for a zip file including only image files.
Swift
1
star
54

spbuilder

Swift Playgrounds Book Builder
Swift
1
star
55

F2-210

Scripts, documents and config files for F2-210.
Shell
1
star
56

TodayWidgetSample

Objective-C
1
star
57

zipreview

Quick Look Plugins for an archive file.
Swift
1
star
58

CloudKitSample

Objective-C
1
star
59

StringIconv

Decode bytes array to String using iconv.
Swift
1
star