1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge commit '43aec5ad' into merge-2.4

Conflicts:
	cmake/OpenCVConfig.cmake
	cmake/OpenCVLegacyOptions.cmake
	modules/contrib/src/retina.cpp
	modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst
	modules/gpu/doc/video.rst
	modules/gpu/src/speckle_filtering.cpp
	modules/python/src2/cv2.cv.hpp
	modules/python/test/test2.py
	samples/python/watershed.py
This commit is contained in:
Roman Donchenko
2013-08-27 13:26:44 +04:00
448 changed files with 984 additions and 1307 deletions
@@ -2,19 +2,19 @@
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>de.rwth-aachen.ient.FaceTracker</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>de.rwth-aachen.ient.FaceTracker</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
</dict>
</plist>
+1 -1
View File
@@ -4,4 +4,4 @@ build.xml
local.properties
proguard-project.txt
project.properties
default.properties
default.properties
@@ -4,4 +4,3 @@ add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenC
if(TARGET ${sample})
add_dependencies(opencv_android_examples ${sample})
endif()
@@ -187,4 +187,4 @@ public class ColorBlobDetectionActivity extends Activity implements OnTouchListe
return new Scalar(pointMatRgba.get(0, 0));
}
}
}
@@ -10,4 +10,3 @@ add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenC
if(TARGET ${sample})
add_dependencies(opencv_android_examples ${sample})
endif()
@@ -13,4 +13,4 @@ LOCAL_LDLIBS += -llog -ldl
LOCAL_MODULE := detection_based_tracker
include $(BUILD_SHARED_LIBRARY)
include $(BUILD_SHARED_LIBRARY)
-1
View File
@@ -24,4 +24,3 @@ int main(int argc, char* argv[])
#endif
return 0;
}
@@ -40,4 +40,4 @@ public class CvNativeActivity extends Activity {
super.onResume();
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mLoaderCallback);
}
}
}
@@ -84,4 +84,4 @@ public class Tutorial3View extends JavaCameraView implements PictureCallback {
}
}
}
}
-1
View File
@@ -57,4 +57,3 @@ if (INSTALL_C_EXAMPLES AND NOT WIN32)
DESTINATION share/OpenCV/samples/c
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
endif ()
-1
View File
@@ -410,4 +410,3 @@ int main(int argc, char** argv )
return 0;
}
-3
View File
@@ -751,6 +751,3 @@ int main(int argc, char* argv[])
return 0;
} /* main() */
Executable → Regular
+11 -11
View File
@@ -1,16 +1,16 @@
#!/bin/sh
if [ $# -gt 0 ] ; then
base=`basename $1 .c`
echo "compiling $base"
gcc -ggdb `pkg-config opencv --cflags --libs` $base.c -o $base
base=`basename $1 .c`
echo "compiling $base"
gcc -ggdb `pkg-config opencv --cflags --libs` $base.c -o $base
else
for i in *.c; do
echo "compiling $i"
gcc -ggdb `pkg-config --cflags opencv` -o `basename $i .c` $i `pkg-config --libs opencv`;
done
for i in *.cpp; do
echo "compiling $i"
g++ -ggdb `pkg-config --cflags opencv` -o `basename $i .cpp` $i `pkg-config --libs opencv`;
done
for i in *.c; do
echo "compiling $i"
gcc -ggdb `pkg-config --cflags opencv` -o `basename $i .c` $i `pkg-config --libs opencv`;
done
for i in *.cpp; do
echo "compiling $i"
g++ -ggdb `pkg-config --cflags opencv` -o `basename $i .cpp` $i `pkg-config --libs opencv`;
done
fi
-3
View File
@@ -13,6 +13,3 @@ ADD_EXECUTABLE(opencv_example minarea.c)
TARGET_LINK_LIBRARIES(opencv_example ${OpenCV_LIBS})
#MESSAGE(STATUS "OpenCV_LIBS: ${OpenCV_LIBS}")
-1
View File
@@ -114,4 +114,3 @@ int main( int argc, char** argv )
#ifdef _EiC
main(1,"convexhull.c");
#endif
-1
View File
@@ -95,4 +95,3 @@ if (INSTALL_C_EXAMPLES AND NOT WIN32)
DESTINATION share/OpenCV/samples/cpp
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
endif()
@@ -302,5 +302,3 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
return 0;
}
@@ -359,5 +359,3 @@ static void loadNewFrame(const std::string filenamePrototype, const int currentF
return 0;
}
-1
View File
@@ -78,4 +78,3 @@ int main(int argc, char** argv)
return 0;
}
-1
View File
@@ -332,4 +332,3 @@ Mat cv::ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const
return generageChessBoard(bg, camMat, distCoeffs, zero, pb1, pb2, sqWidth, sqHeight, pts3d, corners);
}
-1
View File
@@ -80,4 +80,3 @@ int main(int argc, const char ** argv)
waitKey();
return 0;
}
-1
View File
@@ -61,4 +61,3 @@ int main(int argc, char** argv)
return 0;
}
-4
View File
@@ -43,7 +43,3 @@ int main(int, char* [])
return 0;
}
-1
View File
@@ -156,4 +156,3 @@ int main(int argc, char* argv[]) {
return 0;
}
-1
View File
@@ -401,4 +401,3 @@ int main(int argc, char** argv)
StereoCalib(imagelist, boardSize, true, showRectified);
return 0;
}
-2
View File
@@ -134,5 +134,3 @@ int parseCmdArgs(int argc, char** argv)
}
return 0;
}
-2
View File
@@ -771,5 +771,3 @@ int main(int argc, char* argv[])
LOGLN("Finished, total time: " << ((getTickCount() - app_start_time) / getTickFrequency()) << " sec");
return 0;
}
@@ -76,5 +76,3 @@ void Morphology_Operations( int, void* )
morphologyEx( src, dst, operation, element );
imshow( window_name, dst );
}
@@ -66,10 +66,3 @@ int main( void )
return 0;
}
@@ -61,5 +61,3 @@ int main( int, char** argv )
return 0;
}
@@ -71,5 +71,3 @@ int main( int, char** argv )
return 0;
}
@@ -92,4 +92,3 @@ void thresh_callback(int, void* )
circle( drawing, mc[i], 4, color, -1, 8, 0 );
}
}
@@ -79,5 +79,3 @@ int main( void )
waitKey(0);
return(0);
}
@@ -120,4 +120,3 @@ void myHarris_function( int, void* )
}
imshow( myHarris_window, myHarris_copy );
}
@@ -102,4 +102,3 @@ void goodFeaturesToTrack_Demo( int, void* )
for( size_t i = 0; i < corners.size(); i++ )
{ cout<<" -- Refined Corner ["<<i<<"] ("<<corners[i].x<<","<<corners[i].y<<")"<<endl; }
}
@@ -90,4 +90,3 @@ void goodFeaturesToTrack_Demo( int, void* )
namedWindow( source_window, WINDOW_AUTOSIZE );
imshow( source_window, copy );
}
@@ -168,5 +168,3 @@ void MyLine( Mat img, Point start, Point end )
thickness,
lineType );
}
@@ -75,4 +75,4 @@ int main(int argc, char ** argv)
waitKey();
return 0;
}
}
@@ -151,4 +151,4 @@ int main(int ac, char** av)
<< "Tip: Open up " << filename << " with a text editor to see the serialized data." << endl;
return 0;
}
}
@@ -214,4 +214,4 @@ Mat& ScanImageAndReduceRandomAccess(Mat& I, const uchar* const table)
}
return I;
}
}
@@ -84,4 +84,4 @@ void Sharpen(const Mat& myImage,Mat& Result)
Result.row(Result.rows-1).setTo(Scalar(0));
Result.col(0).setTo(Scalar(0));
Result.col(Result.cols-1).setTo(Scalar(0));
}
}
@@ -82,4 +82,4 @@ int main(int,char**)
cout << "A vector of 2D Points = " << vPoints << endl << endl;
return 0;
}
}
@@ -430,4 +430,3 @@ Scalar getMSSIM_GPU_optimized( const Mat& i1, const Mat& i2, BufferMSSIM& b)
}
return mssim;
}
@@ -27,4 +27,4 @@ int main( int argc, char** argv )
waitKey(0); // Wait for a keystroke in the window
return 0;
}
}
@@ -203,4 +203,4 @@ Scalar getMSSIM( const Mat& i1, const Mat& i2)
Scalar mssim = mean( ssim_map ); // mssim = average of ssim map
return mssim;
}
}
@@ -127,4 +127,4 @@ int main()
imwrite("result.png", I); // save the Image
imshow("SVM for Non-Linear Training Data", I); // show it to the user
waitKey(0);
}
}
-1
View File
@@ -458,4 +458,3 @@ inline string App::workFps() const
ss << work_fps;
return ss.str();
}
-1
View File
@@ -88,4 +88,3 @@ int main(int argc, const char* argv[])
return 0;
}
-2
View File
@@ -379,5 +379,3 @@ void App::handleKey(char key)
break;
}
}
@@ -41,4 +41,4 @@ public class DetectFaceDemo {
System.out.println(String.format("Writing %s", filename));
Highgui.imwrite(filename, image);
}
}
}
@@ -66,4 +66,4 @@ object ScalaCorrespondenceMatchingDemo {
println(s"Writing ${filename}")
assert(Highgui.imwrite(filename, correspondenceImage))
}
}
}
@@ -40,4 +40,4 @@ object ScalaDetectFaceDemo {
println(s"Writing ${filename}")
assert(Highgui.imwrite(filename, image))
}
}
}
-1
View File
@@ -57,4 +57,3 @@ if (INSTALL_C_EXAMPLES AND NOT WIN32)
DESTINATION share/opencv/samples/${project}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
endif()
+2 -2
View File
@@ -259,7 +259,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 );
}
@@ -307,4 +307,4 @@ double checkRectSimilarity(Size sz, vector<Rect>& ob1, vector<Rect>& ob2)
final_test_result = -1;
}
return final_test_result;
}
}
+1 -1
View File
@@ -261,4 +261,4 @@ nocamera:
waitKey();
return 0;
}
}
-1
View File
@@ -158,4 +158,3 @@ if __name__ == '__main__':
match_and_draw('affine find_obj')
cv2.waitKey()
cv2.destroyAllWindows()
-1
View File
@@ -70,4 +70,3 @@ if __name__ == '__main__':
print "camera matrix:\n", camera_matrix
print "distortion coefficients: ", dist_coefs.ravel()
cv2.destroyAllWindows()
-1
View File
@@ -123,4 +123,3 @@ if __name__ == '__main__':
video_src = 0
print __doc__
App(video_src).run()
-1
View File
@@ -217,4 +217,3 @@ def draw_keypoints(vis, keypoints, color = (0, 255, 255)):
for kp in keypoints:
x, y = kp.pt
cv2.circle(vis, (int(x), int(y)), 2, color)
-1
View File
@@ -125,4 +125,3 @@ if __name__ == '__main__':
if ch == ord(' '):
defocus = not defocus
update(None)
-1
View File
@@ -161,4 +161,3 @@ class App:
if __name__ == '__main__':
App().run()
-1
View File
@@ -67,4 +67,3 @@ if __name__ == '__main__':
if need_update:
update()
cv2.destroyAllWindows()
-1
View File
@@ -49,4 +49,3 @@ if __name__ == '__main__':
if ch == 27:
break
cv2.destroyAllWindows()
-1
View File
@@ -62,4 +62,3 @@ if __name__ == '__main__':
if 0xFF & cv2.waitKey(5) == 27:
break
cv2.destroyAllWindows()
+17 -17
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()
-1
View File
@@ -114,4 +114,3 @@ if __name__ == '__main__':
cv2.destroyAllWindows()
break
cv2.destroyAllWindows()
-1
View File
@@ -49,4 +49,3 @@ if __name__ == '__main__':
mark[:] = 0
sketch.show()
cv2.destroyAllWindows()
-2
View File
@@ -64,5 +64,3 @@ if __name__ == '__main__':
if cv2.waitKey(1) == 27:
break
-1
View File
@@ -85,4 +85,3 @@ if __name__ == '__main__':
cur_glitch = img.copy()
print 'glitch is', ['off', 'on'][show_glitch]
cv2.destroyAllWindows()
+2 -2
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
-->
@@ -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>
@@ -307,4 +307,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
@@ -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)
{
@@ -99,4 +99,3 @@ private:
IMFMediaBuffer *m_pBuffer;
IMF2DBuffer *m_p2DBuffer;
};
@@ -20,13 +20,13 @@ public:
DeleteCriticalSection(&m_criticalSection);
}
_Acquires_lock_(m_criticalSection)
_Acquires_lock_(m_criticalSection)
void Lock()
{
EnterCriticalSection(&m_criticalSection);
}
_Releases_lock_(m_criticalSection)
_Releases_lock_(m_criticalSection)
void Unlock()
{
LeaveCriticalSection(&m_criticalSection);
@@ -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.
@@ -47,16 +47,16 @@ class AutoLock
private:
CritSec *m_pCriticalSection;
public:
_Acquires_lock_(m_pCriticalSection)
_Acquires_lock_(m_pCriticalSection)
AutoLock(CritSec& crit)
{
m_pCriticalSection = &crit;
m_pCriticalSection->Lock();
}
_Releases_lock_(m_pCriticalSection)
_Releases_lock_(m_pCriticalSection)
~AutoLock()
{
m_pCriticalSection->Unlock();
m_pCriticalSection->Unlock();
}
};
@@ -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.
@@ -219,4 +219,4 @@ HRESULT OpQueue<T, TOperation>::ProcessQueueAsync(IMFAsyncResult *pResult)
return hr;
}
#pragma warning( pop )
#pragma warning( pop )
@@ -4,8 +4,8 @@ import "Windows.Media.idl";
namespace OcvTransform
{
[version(NTDDI_WIN8)]
runtimeclass OcvImageManipulations
[version(NTDDI_WIN8)]
runtimeclass OcvImageManipulations
{
}
}
}
}
@@ -130,7 +130,7 @@ HRESULT OcvImageManipulations::SetProperties(ABI::Windows::Foundation::Collectio
}
}
return hr;
return hr;
}
// IMFTransform methods. Refer to the Media Foundation SDK documentation for details.
@@ -1333,16 +1333,16 @@ 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) };
cv::Mat OutputY(m_imageHeightInPixels, m_imageWidthInPixels, CV_8UC1, pDest, lDestStride);
cv::Mat OutputUV(m_imageHeightInPixels/2, m_imageWidthInPixels/2,
CV_8UC2, pDest+m_imageHeightInPixels*lDestStride, lDestStride);
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) };
cv::Mat OutputY(m_imageHeightInPixels, m_imageWidthInPixels, CV_8UC1, pDest, lDestStride);
cv::Mat OutputUV(m_imageHeightInPixels/2, m_imageWidthInPixels/2,
CV_8UC2, pDest+m_imageHeightInPixels*lDestStride, lDestStride);
cv::Mat BgrFrame;
InputFrame.copyTo(OutputFrame);
InputFrame.copyTo(OutputFrame);
cv::cvtColor(InputFrame, BgrFrame, cv::COLOR_YUV420sp2BGR);
int thikness = (int) (BgrFrame.cols / (mHistSizeNum + 10) / 5);
@@ -1357,20 +1357,20 @@ HRESULT OcvImageManipulations::OnProcessOutput(IMFMediaBuffer *pIn, IMFMediaBuff
cv::normalize(hist, hist, BgrFrame.rows/2, 0, cv::NORM_INF);
for(int h=0; h<mHistSizeNum; h++) {
cv::Point mP1, mP2;
// Draw on Y plane
mP1.x = mP2.x = offset + (c * (mHistSizeNum + 10) + h) * thikness;
// Draw on Y plane
mP1.x = mP2.x = offset + (c * (mHistSizeNum + 10) + h) * thikness;
mP1.y = BgrFrame.rows-1;
mP2.y = mP1.y - 2 - (int)hist.at<float>(h);
cv::line(OutputY, mP1, mP2, mColorsY[c], thikness);
cv::line(OutputY, mP1, mP2, mColorsY[c], thikness);
// Draw on UV planes
// Draw on UV planes
mP1.x /= 2;
mP1.y /= 2;
mP2.x /= 2;
mP2.x /= 2;
mP2.y /= 2;
cv::line(OutputUV, mP1, mP2, mColorsUV[c], thikness/2);
cv::line(OutputUV, mP1, mP2, mColorsUV[c], thikness/2);
}
}
}
} break;
default:
break;
@@ -1426,7 +1426,7 @@ HRESULT OcvImageManipulations::UpdateFormatInfo()
}
// Calculate the image size for YUV NV12 image(not including padding)
m_cbImageSize = (m_imageHeightInPixels + m_imageHeightInPixels/2)*m_imageWidthInPixels;
m_cbImageSize = (m_imageHeightInPixels + m_imageHeightInPixels/2)*m_imageWidthInPixels;
}
done:
@@ -1483,4 +1483,3 @@ HRESULT GetDefaultStride(IMFMediaType *pType, LONG *plStride)
}
return hr;
}
@@ -1,4 +1,4 @@
EXPORTS
DllCanUnloadNow PRIVATE
DllGetActivationFactory PRIVATE
DllGetClassObject PRIVATE
DllGetClassObject PRIVATE
@@ -244,4 +244,4 @@ private:
IMFAttributes *m_pAttributes;
};
#endif
#endif
@@ -316,4 +316,4 @@
</Target>
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
@@ -17,7 +17,7 @@
using namespace Microsoft::WRL;
namespace Microsoft { namespace Samples {
ActivatableClass(OcvImageManipulations);
ActivatableClass(OcvImageManipulations);
}}
BOOL WINAPI DllMain( _In_ HINSTANCE hInstance, _In_ DWORD dwReason, _In_opt_ LPVOID lpReserved )
@@ -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;
}
@@ -33,4 +33,4 @@
</InProcessServer>
</Extension>
</Extensions>
</Package>
</Package>
@@ -85,21 +85,21 @@ void LayoutAwarePage::DefaultViewModel::set(IObservableMap<String^, Object^>^ va
/// <param name="e">Event data describing the conditions that led to the event.</param>
void LayoutAwarePage::OnLoaded(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
this->StartLayoutUpdates(sender, e);
this->StartLayoutUpdates(sender, e);
// Keyboard and mouse navigation only apply when occupying the entire window
if (this->ActualHeight == Window::Current->Bounds.Height &&
this->ActualWidth == Window::Current->Bounds.Width)
{
// Listen to the window directly so focus isn't required
_acceleratorKeyEventToken = Window::Current->CoreWindow->Dispatcher->AcceleratorKeyActivated +=
ref new TypedEventHandler<CoreDispatcher^, AcceleratorKeyEventArgs^>(this,
&LayoutAwarePage::CoreDispatcher_AcceleratorKeyActivated);
_pointerPressedEventToken = Window::Current->CoreWindow->PointerPressed +=
ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this,
&LayoutAwarePage::CoreWindow_PointerPressed);
_navigationShortcutsRegistered = true;
}
// Keyboard and mouse navigation only apply when occupying the entire window
if (this->ActualHeight == Window::Current->Bounds.Height &&
this->ActualWidth == Window::Current->Bounds.Width)
{
// Listen to the window directly so focus isn't required
_acceleratorKeyEventToken = Window::Current->CoreWindow->Dispatcher->AcceleratorKeyActivated +=
ref new TypedEventHandler<CoreDispatcher^, AcceleratorKeyEventArgs^>(this,
&LayoutAwarePage::CoreDispatcher_AcceleratorKeyActivated);
_pointerPressedEventToken = Window::Current->CoreWindow->PointerPressed +=
ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this,
&LayoutAwarePage::CoreWindow_PointerPressed);
_navigationShortcutsRegistered = true;
}
}
/// <summary>
@@ -109,13 +109,13 @@ void LayoutAwarePage::OnLoaded(Object^ sender, Windows::UI::Xaml::RoutedEventArg
/// <param name="e">Event data describing the conditions that led to the event.</param>
void LayoutAwarePage::OnUnloaded(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
if (_navigationShortcutsRegistered)
{
Window::Current->CoreWindow->Dispatcher->AcceleratorKeyActivated -= _acceleratorKeyEventToken;
Window::Current->CoreWindow->PointerPressed -= _pointerPressedEventToken;
_navigationShortcutsRegistered = false;
}
StopLayoutUpdates(sender, e);
if (_navigationShortcutsRegistered)
{
Window::Current->CoreWindow->Dispatcher->AcceleratorKeyActivated -= _acceleratorKeyEventToken;
Window::Current->CoreWindow->PointerPressed -= _pointerPressedEventToken;
_navigationShortcutsRegistered = false;
}
StopLayoutUpdates(sender, e);
}
#pragma region Navigation support
@@ -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>
@@ -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">