Deleted all trailing whitespace.

This commit is contained in:
Roman Donchenko
2013-08-21 16:44:09 +04:00
parent 0d8cb2e319
commit f55740da70
193 changed files with 1685 additions and 1685 deletions

View File

@@ -11,16 +11,16 @@ to build a universal binary framework. Invoke this script from Terminal.app, wai
and you are done.
OpenCV is a Private Framework:
On Mac OS X the concept of Framework bundles is meant to simplify distribution of shared libraries,
accompanying headers and documentation. There are however to subtly different 'flavours' of
Frameworks: public and private ones. The public frameworks get installed into the Frameworks
diretories in /Library, /System/Library or ~/Library and are meant to be shared amongst
applications. The private frameworks are only distributed as parts of an Application Bundle.
This makes it easier to deploy applications because they bring their own framework invisibly to
the user. No installation of the framework is necessary and different applications can bring
On Mac OS X the concept of Framework bundles is meant to simplify distribution of shared libraries,
accompanying headers and documentation. There are however to subtly different 'flavours' of
Frameworks: public and private ones. The public frameworks get installed into the Frameworks
diretories in /Library, /System/Library or ~/Library and are meant to be shared amongst
applications. The private frameworks are only distributed as parts of an Application Bundle.
This makes it easier to deploy applications because they bring their own framework invisibly to
the user. No installation of the framework is necessary and different applications can bring
different versions of the same framework without any conflict.
Since OpenCV is still a moving target, it seems best to avoid any installation and versioning issues
for an end user. The OpenCV framework that currently comes with this demo application therefore
Since OpenCV is still a moving target, it seems best to avoid any installation and versioning issues
for an end user. The OpenCV framework that currently comes with this demo application therefore
is a Private Framework.
Use it for targets that result in an Application Bundle:

View File

@@ -3,7 +3,7 @@
if [ $# -gt 0 ] ; then
base=`basename $1 .c`
echo "compiling $base"
gcc -ggdb `pkg-config opencv --cflags --libs` $base.c -o $base
gcc -ggdb `pkg-config opencv --cflags --libs` $base.c -o $base
else
for i in *.c; do
echo "compiling $i"

View File

@@ -16,10 +16,10 @@ Then create the binary directory for the example with:
Then, if "make install" have been executed, directly running
$ cmake <OPENCV_SRC_PATH>/samples/c/example_cmake/
will detect the "OpenCVConfig.cmake" file and the project is ready to compile.
If "make install" has not been executed, you'll have to manually pick the opencv
If "make install" has not been executed, you'll have to manually pick the opencv
binary directory (Under Windows CMake may remember the correct directory). Open
the CMake gui with:
$ cmake-gui <OPENCV_SRC_PATH>/samples/c/example_cmake/
@@ -27,6 +27,6 @@ the CMake gui with:
And pick the correct value for OpenCV_DIR.

View File

@@ -27,7 +27,7 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
if(HAVE_OPENCL)
ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/ocl/include")
endif()
if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function")
endif()
@@ -47,7 +47,7 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
if(HAVE_OPENCL)
target_link_libraries(${the_target} opencv_ocl)
endif()
set_target_properties(${the_target} PROPERTIES
OUTPUT_NAME "${project}-example-${name}"
PROJECT_LABEL "(EXAMPLE_${project_upper}) ${name}")

View File

@@ -138,7 +138,7 @@ int main(int argc, const char* argv[])
CV_Assert(!useOcl);
info.clear();
}
if(useOcl)
{
CV_Assert(!useCuda);
@@ -171,7 +171,7 @@ int main(int argc, const char* argv[])
superRes = createSuperResolution_BTVL1();
Ptr<DenseOpticalFlowExt> of = createOptFlow(optFlow, useCuda);
if (of.empty())
exit(-1);
superRes->set("opticalFlow", of);

View File

@@ -46,7 +46,7 @@ int main(int argc, char** argv)
createTrackbar("Clip Limit", "CLAHE", &cliplimit, 20, (TrackbarCallback)Clip_Callback);
Mat frame, outframe;
ocl::oclMat d_outframe;
int cur_clip;
Size cur_tilesize;
if(use_cpu)

View File

@@ -258,7 +258,7 @@ void Draw(Mat& img, vector<Rect>& faces, double scale)
resize(img, img, Size((int)(img.cols/scale), (int)(img.rows/scale)));
}
imshow( "result", img );
}

View File

@@ -8,51 +8,51 @@ import sys
def shift_dft(src, dst=None):
'''
Rearrange the quadrants of Fourier image so that the origin is at
the image center. Swaps quadrant 1 with 3, and 2 with 4.
the image center. Swaps quadrant 1 with 3, and 2 with 4.
src and dst arrays must be equal size & type
'''
if dst is None:
dst = np.empty(src.shape, src.dtype)
elif src.shape != dst.shape:
raise ValueError("src and dst must have equal sizes")
elif src.dtype != dst.dtype:
raise TypeError("src and dst must have equal types")
if src is dst:
ret = np.empty(src.shape, src.dtype)
else:
ret = dst
h, w = src.shape[:2]
cx1 = cx2 = w/2
cy1 = cy2 = h/2
# if the size is odd, then adjust the bottom/right quadrants
if w % 2 != 0:
cx2 += 1
if h % 2 != 0:
cy2 += 1
cy2 += 1
# swap quadrants
# swap q1 and q3
ret[h-cy1:, w-cx1:] = src[0:cy1 , 0:cx1 ] # q1 -> q3
ret[0:cy2 , 0:cx2 ] = src[h-cy2:, w-cx2:] # q3 -> q1
# swap q2 and q4
ret[0:cy2 , w-cx2:] = src[h-cy2:, 0:cx2 ] # q2 -> q4
ret[h-cy1:, 0:cx1 ] = src[0:cy1 , w-cx1:] # q4 -> q2
if src is dst:
dst[:,:] = ret
return dst
if __name__ == "__main__":
if len(sys.argv)>1:
im = cv2.imread(sys.argv[1])
else :
@@ -62,9 +62,9 @@ if __name__ == "__main__":
# convert to grayscale
im = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
h, w = im.shape[:2]
realInput = im.astype(np.float64)
# perform an optimally sized dft
dft_M = cv2.getOptimalDFTSize(w)
dft_N = cv2.getOptimalDFTSize(h)
@@ -72,22 +72,22 @@ if __name__ == "__main__":
# copy A to dft_A and pad dft_A with zeros
dft_A = np.zeros((dft_N, dft_M, 2), dtype=np.float64)
dft_A[:h, :w, 0] = realInput
# no need to pad bottom part of dft_A with zeros because of
# use of nonzeroRows parameter in cv2.dft()
cv2.dft(dft_A, dst=dft_A, nonzeroRows=h)
cv2.imshow("win", im)
# Split fourier into real and imaginary parts
image_Re, image_Im = cv2.split(dft_A)
# Compute the magnitude of the spectrum Mag = sqrt(Re^2 + Im^2)
magnitude = cv2.sqrt(image_Re**2.0 + image_Im**2.0)
# Compute log(1 + Mag)
log_spectrum = cv2.log(1.0 + magnitude)
# Rearrange the quadrants of Fourier image so that the origin is at
# the image center
shift_dft(log_spectrum, log_spectrum)

View File

@@ -8,12 +8,12 @@ This sample shows interactive image segmentation using grabcut algorithm.
USAGE :
python grabcut.py <filename>
README FIRST:
README FIRST:
Two windows will show up, one for input and one for output.
At first, in input window, draw a rectangle around the object using
At first, in input window, draw a rectangle around the object using
mouse right button. Then press 'n' to segment the object (once or a few times)
For any finer touch-ups, you can press any of the keys below and draw lines on
For any finer touch-ups, you can press any of the keys below and draw lines on
the areas you want. Then again press 'n' for updating the output.
Key '0' - To select areas of sure background
@@ -53,7 +53,7 @@ thickness = 3 # brush thickness
def onmouse(event,x,y,flags,param):
global img,img2,drawing,value,mask,rectangle,rect,rect_or_mask,ix,iy,rect_over
# Draw Rectangle
if event == cv2.EVENT_RBUTTONDOWN:
rectangle = True
@@ -73,9 +73,9 @@ def onmouse(event,x,y,flags,param):
rect = (ix,iy,abs(ix-x),abs(iy-y))
rect_or_mask = 0
print " Now press the key 'n' a few times until no further change \n"
# draw touchup curves
if event == cv2.EVENT_LBUTTONDOWN:
if rect_over == False:
print "first draw rectangle \n"
@@ -94,7 +94,7 @@ def onmouse(event,x,y,flags,param):
drawing = False
cv2.circle(img,(x,y),thickness,value['color'],-1)
cv2.circle(mask,(x,y),thickness,value['val'],-1)
# print documentation
print __doc__
@@ -125,7 +125,7 @@ while(1):
cv2.imshow('output',output)
cv2.imshow('input',img)
k = 0xFF & cv2.waitKey(1)
# key bindings
if k == 27: # esc to exit
break
@@ -147,11 +147,11 @@ while(1):
elif k == ord('r'): # reset everything
print "resetting \n"
rect = (0,0,1,1)
drawing = False
rectangle = False
rect_or_mask = 100
rect_over = False
value = DRAW_FG
drawing = False
rectangle = False
rect_or_mask = 100
rect_over = False
value = DRAW_FG
img = img2.copy()
mask = np.zeros(img.shape[:2],dtype = np.uint8) # mask initialized to PR_BG
output = np.zeros(img.shape,np.uint8) # output image to be shown
@@ -160,15 +160,15 @@ while(1):
and again press 'n' \n"""
if (rect_or_mask == 0): # grabcut with rect
bgdmodel = np.zeros((1,65),np.float64)
fgdmodel = np.zeros((1,65),np.float64)
fgdmodel = np.zeros((1,65),np.float64)
cv2.grabCut(img2,mask,rect,bgdmodel,fgdmodel,1,cv2.GC_INIT_WITH_RECT)
rect_or_mask = 1
elif rect_or_mask == 1: # grabcut with mask
bgdmodel = np.zeros((1,65),np.float64)
fgdmodel = np.zeros((1,65),np.float64)
fgdmodel = np.zeros((1,65),np.float64)
cv2.grabCut(img2,mask,rect,bgdmodel,fgdmodel,1,cv2.GC_INIT_WITH_MASK)
mask2 = np.where((mask==1) + (mask==3),255,0).astype('uint8')
output = cv2.bitwise_and(img2,img2,mask=mask2)
output = cv2.bitwise_and(img2,img2,mask=mask2)
cv2.destroyAllWindows()

View File

@@ -11,14 +11,14 @@
-->
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SDKSample.App"
RequestedTheme="Light">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--
<!--
Styles that define common aspects of the platform look and feel
Required by Visual Studio project and item templates
-->

View File

@@ -10,7 +10,7 @@
//*********************************************************
-->
<common:LayoutAwarePage
<common:LayoutAwarePage
x:Class="SDKSample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@@ -80,7 +80,7 @@
<TextBlock Grid.Row="0" Text="Input" Style="{StaticResource H2Style}"/>
<TextBlock x:Name="ScenarioListLabel" Text="Select Scenario:" Grid.Row="1" Style="{StaticResource SubheaderTextStyle}" Margin="0,5,0,0" />
<ListBox x:Name="Scenarios" Margin="0,0,20,0" Grid.Row="2" AutomationProperties.Name="Scenarios" HorizontalAlignment="Left"
<ListBox x:Name="Scenarios" Margin="0,0,20,0" Grid.Row="2" AutomationProperties.Name="Scenarios" HorizontalAlignment="Left"
VerticalAlignment="Top" ScrollViewer.HorizontalScrollBarVisibility="Auto"
AutomationProperties.LabeledBy="{Binding ElementName=ScenarioListLabel}" MaxHeight="125">
<ListBox.ItemTemplate>

View File

@@ -3,7 +3,7 @@
//////////////////////////////////////////////////////////////////////////
// AsyncCallback [template]
//
// Description:
// Description:
// Helper class that routes IMFAsyncCallback::Invoke calls to a class
// method on the parent class.
//
@@ -24,7 +24,7 @@
template<class T>
class AsyncCallback : public IMFAsyncCallback
{
public:
public:
typedef HRESULT (T::*InvokeFn)(IMFAsyncResult *pAsyncResult);
AsyncCallback(T *pParent, InvokeFn fn) : m_pParent(pParent), m_pInvokeFn(fn)
@@ -32,13 +32,13 @@ public:
}
// IUnknown
STDMETHODIMP_(ULONG) AddRef() {
STDMETHODIMP_(ULONG) AddRef() {
// Delegate to parent class.
return m_pParent->AddRef();
return m_pParent->AddRef();
}
STDMETHODIMP_(ULONG) Release() {
STDMETHODIMP_(ULONG) Release() {
// Delegate to parent class.
return m_pParent->Release();
return m_pParent->Release();
}
STDMETHODIMP QueryInterface(REFIID iid, void** ppv)
{

View File

@@ -36,7 +36,7 @@ public:
//////////////////////////////////////////////////////////////////////////
// AutoLock
// Description: Provides automatic locking and unlocking of a
// Description: Provides automatic locking and unlocking of a
// of a critical section.
//
// Note: The AutoLock object must go out of scope before the CritSec.

View File

@@ -13,9 +13,9 @@
#pragma once
// Notes:
//
// The List class template implements a simple double-linked list.
// It uses STL's copy semantics.
//
// The List class template implements a simple double-linked list.
// It uses STL's copy semantics.
// There are two versions of the Clear() method:
// Clear(void) clears the list w/out cleaning up the object.
@@ -90,7 +90,7 @@ public:
private:
const Node *pNode;
POSITION(Node *p) : pNode(p)
POSITION(Node *p) : pNode(p)
{
}
};
@@ -123,7 +123,7 @@ protected:
}
Node *pAfter = pBefore->next;
pBefore->next = pNode;
pAfter->prev = pNode;
@@ -336,12 +336,12 @@ public:
}
HRESULT GetItemPos(POSITION pos, T *ppItem)
{
{
if (pos.pNode)
{
return GetItem(pos.pNode, ppItem);
}
else
else
{
return E_FAIL;
}
@@ -359,7 +359,7 @@ public:
}
}
// Remove an item at a position.
// Remove an item at a position.
// The item is returns in ppItem, unless ppItem is nullptr.
// NOTE: This method invalidates the POSITION object.
HRESULT Remove(POSITION& pos, T *ppItem)
@@ -390,7 +390,7 @@ public:
class ComAutoRelease
{
public:
public:
void operator()(IUnknown *p)
{
if (p)
@@ -399,10 +399,10 @@ public:
}
}
};
class MemDelete
{
public:
public:
void operator()(void *p)
{
if (p)
@@ -416,9 +416,9 @@ public:
// ComPtrList class
// Derived class that makes it safer to store COM pointers in the List<> class.
// It automatically AddRef's the pointers that are inserted onto the list
// (unless the insertion method fails).
// (unless the insertion method fails).
//
// T must be a COM interface type.
// T must be a COM interface type.
// example: ComPtrList<IUnknown>
//
// NULLABLE: If true, client can insert nullptr pointers. This means GetItem can
@@ -487,7 +487,7 @@ protected:
HRESULT RemoveItem(Node *pNode, Ptr *ppItem)
{
// ppItem can be nullptr, but we need to get the
// item so that we can release it.
// item so that we can release it.
// If ppItem is not nullptr, we will AddRef it on the way out.

View File

@@ -5,7 +5,7 @@ import "Windows.Media.idl";
namespace OcvTransform
{
[version(NTDDI_WIN8)]
runtimeclass OcvImageManipulations
runtimeclass OcvImageManipulations
{
}
}

View File

@@ -1333,7 +1333,7 @@ HRESULT OcvImageManipulations::OnProcessOutput(IMFMediaBuffer *pIn, IMFMediaBuff
const int mHistSize[] = {25};
const float baseRabge[] = {0.f,256.f};
const float* ranges[] = {baseRabge};
const cv::Scalar mColorsY[] = { cv::Scalar(76), cv::Scalar(149), cv::Scalar(29) };
const cv::Scalar mColorsUV[] = { cv::Scalar(84, 255), cv::Scalar(43, 21), cv::Scalar(255, 107) };
@@ -1370,7 +1370,7 @@ HRESULT OcvImageManipulations::OnProcessOutput(IMFMediaBuffer *pIn, IMFMediaBuff
mP2.y /= 2;
cv::line(OutputUV, mP1, mP2, mColorsUV[c], thikness/2);
}
}
}
} break;
default:
break;

View File

@@ -47,7 +47,7 @@ HRESULT WINAPI DllGetActivationFactory( _In_ HSTRING activatibleClassId, _Outptr
HRESULT WINAPI DllCanUnloadNow()
{
auto &module = Microsoft::WRL::Module<Microsoft::WRL::InProc>::GetModule();
auto &module = Microsoft::WRL::Module<Microsoft::WRL::InProc>::GetModule();
return (module.Terminate()) ? S_OK : S_FALSE;
}

View File

@@ -15,7 +15,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Non-brush values that vary across themes -->
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<x:String x:Key="BackButtonGlyph">&#xE071;</x:String>
@@ -399,7 +399,7 @@
</Style>
<!-- Standard App Bar buttons -->
<Style x:Key="SkipBackAppBarButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SkipBackAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Skip Back"/>
@@ -690,7 +690,7 @@
<!--
SnappedBackButtonStyle is used to style a Button for use in the title area of a snapped page. Margins appropriate
for the conventional page layout are included as part of the style.
The obvious duplication here is necessary as the glyphs used in snapped are not merely smaller versions of the same
glyph but are actually distinct.
-->
@@ -934,7 +934,7 @@
<TextBlock Text="{Binding Title}" TextWrapping="NoWrap" Style="{StaticResource BodyTextStyle}"/>
<TextBlock Text="{Binding Description}" MaxHeight="140" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" Style="{StaticResource BodyTextStyle}"/>
</StackPanel>
</Grid>
</Grid>
</ToolTipService.ToolTip>
</Grid>
</DataTemplate>

View File

@@ -10,7 +10,7 @@
//*********************************************************
-->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="TitleTextStyle" TargetType="TextBlock">